※前回の記事の続きです。
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でオブジェクトを掴む方法の説明は終了です。
cheap evening dresses
Cheap Bridal Dress,Affordable Wedding Gown | Lalamira_Shopping for a wedding dress on a budget? Find cheap wedding dresses under $100 dollars in beautiful simple designs to glamorous gowns,#Weddingdresses,#SexyWeddingDresses,#WeddingGowns,#BridalGowns,#CheapWeddingDresses,#plussizeweddingdresses,#beachweddingdresses,#mermaidweddingdress,#laceweddingdress,#longsleeveweddingdresses,#shortweddingdresses at Lalamira's Bridal!https://www.lalamira.com/Wedding-Dresses-c2/ [url=https://www.vdressy.com/Cheap-Evening-Dresses-c17/]cheap evening dresses[/url] <a href="https://www.vdressy.com/Cheap-Evening-Dresses-c17/" title="cheap evening dresses">cheap evening dresses</a>
cute homecoming dresses
#EveningDresses,#ElegantLongEveningDresses,#CheapEveningDresses,#LongEveningDresses,#EveningDresses2019.Shop for cheap Evening Dresses? We have great 2019 Evening Dresses on sale.Buy cheap Evening Dresses online at lalamira.com today!https://www.lalamira.com/Evening-Dresses-c17 [url=https://www.vdressy.com/Cheap-Homecoming-Dresses-c22/]cute homecoming dresses[/url] <a href="https://www.vdressy.com/Cheap-Homecoming-Dresses-c22/" title="cute homecoming dresses">cute homecoming dresses</a>
tight homecoming dresses
Flower Girl Dresses in Various Colors & Styles | Find the perfect flower girl dresses at Lalamira's Bridal.Our flower girl dresses come in a variety of styles & colors including lace, tulle, purple &gold. #FlowerGirlDresses,#CheapFlowerGirlDresses,#FlowerGirlDresses2019.Shop flower girl dresses and junior bridesmaid dresses to fit your style.https://www.lalamira.com/Flower-Girl-Dresses-c10/ [url=https://www.vdressy.com/Cheap-Homecoming-Dresses-c22/]tight homecoming dresses[/url] <a href="https://www.vdressy.com/Cheap-Homecoming-Dresses-c22/" title="tight homecoming dresses">tight homecoming dresses</a>
I quite like cooking http://yuvututube.fun yuvutu U.S. endowments' awakening appetite for Africa is anothersign that the continent is shedding its past reputation forconflict, poverty and aid-dependency in favour of a morepositive image of progress.
I quite like cooking http://yuvututube.fun yuvutu U.S. endowments' awakening appetite for Africa is anothersign that the continent is shedding its past reputation forconflict, poverty and aid-dependency in favour of a morepositive image of progress.
Very Good Site http://lamalinks.fun lama nudes Iraq's delicate sectarian balance has been strained to near breaking point by the civil war in neighboring Syria, where mainly Sunni Muslim rebels are fighting to overthrow a leader backed by Shi'ite Iran.
Very Good Site http://lamalinks.fun lama nudes Iraq's delicate sectarian balance has been strained to near breaking point by the civil war in neighboring Syria, where mainly Sunni Muslim rebels are fighting to overthrow a leader backed by Shi'ite Iran.
I'm retired http://xnxx.in.net/ xnxx videos TransCanada Corp, which is planning to buildpipelines to transport Canadian gas to two LNG export projects, said its participation in projects honing in on Asia'sfast-growing demand ramped up suddenly.
I'm retired http://xnxx.in.net/ xnxx videos TransCanada Corp, which is planning to buildpipelines to transport Canadian gas to two LNG export projects, said its participation in projects honing in on Asia'sfast-growing demand ramped up suddenly.
I work for myself http://myvidster.fun vidster McIlroy, speaking at a news conference in Seoul ahead of this week's Korea Open, deflected questions about his relationship with the Danish tennis player amid reports the high-profile pair had broken up.
I work for myself http://myvidster.fun vidster McIlroy, speaking at a news conference in Seoul ahead of this week's Korea Open, deflected questions about his relationship with the Danish tennis player amid reports the high-profile pair had broken up.
I'm a housewife http://al4a.fun al4a Previously Garzon had exercised his right to remain silent when police tried to interview him, officials said. Spain's state-run train company has described him as an experience driver who knew the route well.
I'm a housewife http://al4a.fun al4a Previously Garzon had exercised his right to remain silent when police tried to interview him, officials said. Spain's state-run train company has described him as an experience driver who knew the route well.
Get a job http://planetsuzy.fun planetsuzy "There are still times where it's a little bit sore," he said. "It's something you have to fight through. If I can be out there with my team, I'm going to be out there 10 out of 10 times."
Get a job http://planetsuzy.fun planetsuzy "There are still times where it's a little bit sore," he said. "It's something you have to fight through. If I can be out there with my team, I'm going to be out there 10 out of 10 times."
formal 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://redpromdressformaldresses.weebly.com/]formal dresses[/url] <a href="https://redpromdressformaldresses.weebly.com/" title="formal dresses">formal dresses</a>