投稿日:2017年10月24日  カテゴリー:VR  投稿者:SingularityMaster

■オブジェクトを掴むためのスクリプトの適用

前回の記事の続きです。

OculusTouchでオブジェクトを掴むための設定をしていきます。

 

 

まず、掴まれる側の設定です。ProjectビューのAssets->OVR->Scripts->Utilの中に、「Grabbable.cs」というファイルがあるので、これをHierarchyビューのCubeにドラッグします。掴まれる側の設定は、基本的にこれだけでOKです。

※「Grabbable.cs」は前々回の記事で「OVRGrabbable.cs」からリネームされています。

 

 

次に掴む側の設定です。まず掴む側の接触判定を作ります。HierarchyビューのLocalAvatarの直下に、空の子オブジェクトを追加します。名前は『Avatar Grab Sample』に従って、「grabber_left」とでもしてください。

 

 

次に、この「grabber_left」に接触判定のための物理演算を追加します。「grabber_left」のInspectorビュー、AddComponentから、Physics->RigidbodyとPhysics->CapsuleCliderを追加してください。RigidbodyはUseGravityのチェックを外して、IsKinematicのチェックを入れます。CapsuleCliderはIsTriggerのチェックを入れて、RadiusとHeightを『Avatar Grab Sample』に従って、それぞれ適当に0.02、0.1とでもしてください。

このCapsuleColiderが手の接触範囲となります。

 

 

そして最後に掴むためのスクリプトを設定します。ProjectビューのAssets->OVR->Scripts->Utilの中に、「Grabber.cs」というファイルがあるので、これをHierarchyビューの「grabber_left」にドラッグします。

※「Grabber.cs」は前々回の記事で「OVRGrabber.cs」からリネームされています。

 

 

「Grabber.cs」には3か所設定しないといけない場所があります。まず掴む手の位置です。とくに拘りがなければ手はデフォルトの位置で良いと思うので、HierarchyビューのLocalAvatarの子オブジェクトに「hand_left」という、左手位置のアンカー点があるので、これを「grabber_left」オブジェクトのInspectorビューのGrabberScript中のGripTransformという欄にドラッグします。

次に掴むアバターの設定。これはLocalAvatarになるので、Hierarchyビューの「LocalAvatar」を「grabber_left」オブジェクトのInspectorビューのGrabberScript中のAvatarという欄にドラッグします。

そして最後に操作するコントローラの設定。左手を設定しているので、「grabber_left」オブジェクトのInspectorビューのGrabberScript中のControllerという欄をL touchにします。

 

 

同じ要領で右手用の接触判定も作成してください。

これでOculusTouchでオブジェクトを掴むための設定はすべて完了です。

 

■シーンの実行

 

 

シーンを実行してみてください。『Avatar Grab Sample』と同様にCubeを掴めるはずです。もし掴みたいオブジェクトを追加したければ、掴みたいオブジェクトにRigidbody、適当なClider、Grabbable.csを設定すればOKです。

※オブジェクトの色が変化するのは、Grabbable.csに設定があります。該当するスクリプトをコメントアウトすれば色は変化しなくなります。

 

以上でOculusTouchでオブジェクトを掴む方法の説明は終了です。

 

前の記事

US dollars http://femjoy.in.net femjoy porn RESIDENTS across North Yorkshire are to be asked for their views on plans for cuts to social care and bus services in the region as council bosses say they have been left needing to save an extra £66 million.

 US dollars http://femjoy.in.net femjoy porn RESIDENTS across North Yorkshire are to be asked for their views on plans for cuts to social care and bus services in the region as council bosses say they have been left needing to save an extra £66 million.

Punk not dead http://al4a.fun/al4avideos/ al4 Yes there are a number of options available, you can set your browser either to reject all cookies, to allow only "trusted" sites to set them, or to only accept them from the site you are currently on.

 Punk not dead http://al4a.fun/al4avideos/ al4 Yes there are a number of options available, you can set your browser either to reject all cookies, to allow only "trusted" sites to set them, or to only accept them from the site you are currently on.

I'm a partner in http://xxxnx.world xxnxx Houston slipped down the table in the Eastern Conference after a seven-game winless streak, but the team has bounced back to win back-to-back matches, taking over the fifth and final playoff spot in the East.

 I'm a partner in http://xxxnx.world xxnxx Houston slipped down the table in the Eastern Conference after a seven-game winless streak, but the team has bounced back to win back-to-back matches, taking over the fifth and final playoff spot in the East.

The manager http://mijnnn.icu nn pics And since bikes can easily be put on trains here, I started slowly deciphering the regular train announcements: "Her can du skifter til linie F"… "Skifter" must mean "change", I concluded.

 The manager http://mijnnn.icu nn pics And since bikes can easily be put on trains here, I started slowly deciphering the regular train announcements: "Her can du skifter til linie F"… "Skifter" must mean "change", I concluded.

Photography http://al4a.fun al4 Over the longer term, investors will have to take a view on the prospects for a business that has been hit hard by the decline in private letters, but boosted by deliveries of goods bought over the internet.

 Photography http://al4a.fun al4 Over the longer term, investors will have to take a view on the prospects for a business that has been hit hard by the decline in private letters, but boosted by deliveries of goods bought over the internet.

I'm in a band http://fittor.top/ unga fittor The screening investigation by USIS turned up the report of his 2004 arrest in Seattle, triggering an interview with Alexis as well as further probes into his traffic offenses and troubled credit history.

 I'm in a band http://fittor.top/ unga fittor The screening investigation by USIS turned up the report of his 2004 arrest in Seattle, triggering an interview with Alexis as well as further probes into his traffic offenses and troubled credit history.

cheap vintage lace wedding dresses

 All colors, fabric & length available for bridesmaid dresses at cheap prices! Shop affordable gowns for maids of honor under $100. Up to 80% OFF.Shop online for high quality and stylish bridesmaid dresses & girls bridesmaid dresses with cheap price Bridesmaid Dresses | Cheap Bridesmaid Dress | Sexy bridesmaid dresses and affordable maid dress outlet online. [url=https://www.vdressy.com/Vintage-Wedding-Dresses/]cheap vintage lace wedding dresses[/url] <a href="https://www.vdressy.com/Vintage-Wedding-Dresses/" title="cheap vintage lace wedding dresses">cheap vintage lace wedding dresses</a>

cheap plus size evening dresses under 50

 Looking for the perfect Cocktail Dress for an upcoming event? Browse our selection of trendy Cocktail Dresses. FREE SHIPPING on qualifying purchases!Cocktail Dresses & Party Dresses for Women | Perfect for any holiday party or cocktail hour, in styles like lace, sequin or off the shoulder.Cocktail Dresses For Women! [url=https://www.vdressy.com/Cheap-Evening-Dresses-c17/]cheap plus size evening dresses under 50[/url] <a href="https://www.vdressy.com/Cheap-Evening-Dresses-c17/" title="cheap plus size evening dresses under 50">cheap plus size evening dresses under 50</a>

long formal evening dresses

 Cheap Bridesmaid Dresses and Bridal Party Gowns - Cheap bridal party dresses and long formal gowns.Shop range of bridesmaids' dresses, incl. elegant or embellished dresses, tulle, lace & chiffon styles, perfect for a big day on a budget!Cheap Bridesmaid Dresses Online | Bridesmaid Dresses for 2019.Fast shipping. Get the perfect bridesmaid dress under 100 for your special day! You can select red or pink bridesmaids dresses under affordable price. [url=https://www.vdressy.com/Long-Evening-Dresses/]long formal evening dresses[/url] <a href="https://www.vdressy.com/Long-Evening-Dresses/" title="long formal evening dresses">long formal evening dresses</a>

I live here http://imagefap.in.net imagefap.com Yet even this does not capture all the hidden costs met by investors. The IMA is now keen to make fund charges more transparent, and end long-running criticism that funds operate without full disclosure.

 I live here http://imagefap.in.net imagefap.com Yet even this does not capture all the hidden costs met by investors. The IMA is now keen to make fund charges more transparent, and end long-running criticism that funds operate without full disclosure.

Powered By

Copyright (C) 2017 テクノロジーカフェシンギュラリティ. All Rights Reserved.