※前回の記事の続きです。
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でオブジェクトを掴む方法の説明は終了です。
Who's calling? <a href=" http://www.lasvegascomplaints.com/dutas-05mg-price/ ">where can i buy dutasteride online</a> At least one of the trucks was carrying hazardous material, but no leaks were found.
Who's calling? <a href=" http://www.lasvegascomplaints.com/dutas-05mg-price/ ">where can i buy dutasteride online</a> At least one of the trucks was carrying hazardous material, but no leaks were found.
this is be cool 8) <a href=" http://lightquick.co.uk/cbd-mo.html ">where to get cbd oil in colorado arkansas</a> After the 2011 vote the PF partyincreased the public sector wage bill by 50 percent.
this is be cool 8) <a href=" http://lightquick.co.uk/cbd-mo.html ">where to get cbd oil in colorado arkansas</a> After the 2011 vote the PF partyincreased the public sector wage bill by 50 percent.
I'd like , please <a href=" http://www.scottishhillrally.co.uk/does-imitrex-work.htm ">femtrex 30 tablets</a> (Reporting By Manya Venkatesh in Bangalore; Editing bySaumyadeb Chakrabarty and Maju Samuel)
I'd like , please <a href=" http://www.scottishhillrally.co.uk/does-imitrex-work.htm ">femtrex 30 tablets</a> (Reporting By Manya Venkatesh in Bangalore; Editing bySaumyadeb Chakrabarty and Maju Samuel)
Could you ask him to call me? <a href=" http://www.pinkmail.org/androcur-pills-for-transgender/ ">androcur tablets 100mg</a> Her firm has an online presence, offers a readily available product and works cleanly in a concreted environment.
Could you ask him to call me? <a href=" http://www.pinkmail.org/androcur-pills-for-transgender/ ">androcur tablets 100mg</a> Her firm has an online presence, offers a readily available product and works cleanly in a concreted environment.
Cool site goodluck :) <a href=" http://autodent-services.co.uk/meds-or-ke-reviews.html ">review meds.or.ke/vacancies.html reviews</a> "Serious health problems face us as a nation and yet both obesity and cardiovascular disease are largely preventable
Cool site goodluck :) <a href=" http://autodent-services.co.uk/meds-or-ke-reviews.html ">review meds.or.ke/vacancies.html reviews</a> "Serious health problems face us as a nation and yet both obesity and cardiovascular disease are largely preventable
Special Delivery <a href=" http://studentaccommodationderry.co.uk/avodart-zz ">avodart drug information card</a> But what we don't know so well is why that link might be there," said the report's coordinator Oona Brooks.
Special Delivery <a href=" http://studentaccommodationderry.co.uk/avodart-zz ">avodart drug information card</a> But what we don't know so well is why that link might be there," said the report's coordinator Oona Brooks.
I'm retired <a href=" http://www.flexss.co.uk/duromine-online-singapore/ ">duromine 40mg in south africa</a> The majority of BT’s customers are on inclusive call packages and do not pay the set-up fee or per minute charges on many calls
I'm retired <a href=" http://www.flexss.co.uk/duromine-online-singapore/ ">duromine 40mg in south africa</a> The majority of BT’s customers are on inclusive call packages and do not pay the set-up fee or per minute charges on many calls
very best job <a href=" http://www.instalacioneshidraulicas.com/forever-clean-9-detox-does-it-work/ ">forever living clean 9 detox program</a> In another player-friendly move, Silver lengthened the All-Star break from at least six days to eight.
very best job <a href=" http://www.instalacioneshidraulicas.com/forever-clean-9-detox-does-it-work/ ">forever living clean 9 detox program</a> In another player-friendly move, Silver lengthened the All-Star break from at least six days to eight.
I'd like a phonecard, please <a href=" http://guildwars2forum.com/vigor-plus-condoms/ ">vigor plus price in india</a> "We knew it was going to be a 90-minute battle, but I thought our physical presence was solid
I'd like a phonecard, please <a href=" http://guildwars2forum.com/vigor-plus-condoms/ ">vigor plus price in india</a> "We knew it was going to be a 90-minute battle, but I thought our physical presence was solid
I'd like to apply for this job <a href=" http://www.freshfurniture.co.uk/great-va/ ">great earth madras</a> Nearly 300 goes towards criminal justice, while 114 is spent on "culture" programs including libraries and museums
I'd like to apply for this job <a href=" http://www.freshfurniture.co.uk/great-va/ ">great earth madras</a> Nearly 300 goes towards criminal justice, while 114 is spent on "culture" programs including libraries and museums