※前回の記事の続きです。
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でオブジェクトを掴む方法の説明は終了です。
Your account's overdrawn <a href=" http://overchill.co.uk/rablet-20-used-for-xyz ">rablet d usage pregnancy</a> Meanwhile, Shell's profits for the quarter after stripping out one-off items, such as asset sales and accounting changes, were $3.26bn
Your account's overdrawn <a href=" http://overchill.co.uk/rablet-20-used-for-xyz ">rablet d usage pregnancy</a> Meanwhile, Shell's profits for the quarter after stripping out one-off items, such as asset sales and accounting changes, were $3.26bn
real beauty page <a href=" http://guildwars2forum.com/smarticle-english/ ">smarticle english</a> “As long as it’s done in a positive light, we are OK with people using the ”Bronx’ name,” said Borough President Ruben Diaz Jr
real beauty page <a href=" http://guildwars2forum.com/smarticle-english/ ">smarticle english</a> “As long as it’s done in a positive light, we are OK with people using the ”Bronx’ name,” said Borough President Ruben Diaz Jr
Where are you from? <a href=" http://www.instalacioneshidraulicas.com/gnc-total-lean-shake-25-meal-plan/ ">premium forskolin ultra trim</a> For example, cytokines are proteins normally produced by the immune system to help your body fight infections
Where are you from? <a href=" http://www.instalacioneshidraulicas.com/gnc-total-lean-shake-25-meal-plan/ ">premium forskolin ultra trim</a> For example, cytokines are proteins normally produced by the immune system to help your body fight infections
I've been made redundant <a href=" http://italiannetwork.co.uk/erectile-dysfunction-pharmacy-vlijmen ">erectile dysfunction online test needed</a> All content of the Dow Jones branded indices S&P Dow Jones Indices LLC 2014 and/or its affiliates.
I've been made redundant <a href=" http://italiannetwork.co.uk/erectile-dysfunction-pharmacy-vlijmen ">erectile dysfunction online test needed</a> All content of the Dow Jones branded indices S&P Dow Jones Indices LLC 2014 and/or its affiliates.
An envelope <a href=" http://www.instalacioneshidraulicas.com/fruta-planta-diet-pills-for-sale/ ">usn diet fuel ultralean</a> Blount carried the ball seven times for 32 yards while Bell added 23 yards on nine carries in the 31-21 loss.
An envelope <a href=" http://www.instalacioneshidraulicas.com/fruta-planta-diet-pills-for-sale/ ">usn diet fuel ultralean</a> Blount carried the ball seven times for 32 yards while Bell added 23 yards on nine carries in the 31-21 loss.
What do you do? <a href=" http://asoupar.ir/?novoslim-opinie-2014 ">novoslim gdzie można kupiÄ</a> Learning lines I notice I have to really work my brain and it now takes much longer, I used to be able to learn a page just by reading it once
What do you do? <a href=" http://asoupar.ir/?novoslim-opinie-2014 ">novoslim gdzie można kupiÄ</a> Learning lines I notice I have to really work my brain and it now takes much longer, I used to be able to learn a page just by reading it once
It's serious <a href=" http://guildwars2forum.com/minolast-10/ ">minolast 10</a> (The partnerships with ad networks are all monetized on a cost-per-click or cost-per-purchase model.)
It's serious <a href=" http://guildwars2forum.com/minolast-10/ ">minolast 10</a> (The partnerships with ad networks are all monetized on a cost-per-click or cost-per-purchase model.)
Very interesting tale <a href=" http://guildwars2forum.com/onapil-2-mg/ ">onapil 2 mg</a> They’ll need the entire line to “step up” on Monday and, at the very least, not be the liability that it was last season
Very interesting tale <a href=" http://guildwars2forum.com/onapil-2-mg/ ">onapil 2 mg</a> They’ll need the entire line to “step up” on Monday and, at the very least, not be the liability that it was last season
I'm at Liverpool University <a href=" http://www.pinkmail.org/acnefree-sulfur-mask/ ">acnefree cleansing brush review</a> "Our own data from the Antarctic will take a few weeks to process but we hope to confirm the findings
I'm at Liverpool University <a href=" http://www.pinkmail.org/acnefree-sulfur-mask/ ">acnefree cleansing brush review</a> "Our own data from the Antarctic will take a few weeks to process but we hope to confirm the findings
Another service? <a href=" http://guildwars2forum.com/silbostin/ ">silbostin medicine</a> The rally will now take part in the Admiralty district to build on the momentum of week-long student rallies and protests in the area.
Another service? <a href=" http://guildwars2forum.com/silbostin/ ">silbostin medicine</a> The rally will now take part in the Admiralty district to build on the momentum of week-long student rallies and protests in the area.