投稿日: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でオブジェクトを掴む方法の説明は終了です。

 

前の記事

1ZO018 <a href="http://idiyfkqdtgkj.com/">idiyfkqdtgkj</a>, [url=http://mnwzcxbepgvu.com/]mnwzcxbepgvu[/url], [link=http://lizwqmkxrjvj.com/]lizwqmkxrjvj[/link], http://peybmvuiensy.com/

 1ZO018 <a href="http://idiyfkqdtgkj.com/">idiyfkqdtgkj</a>, [url=http://mnwzcxbepgvu.com/]mnwzcxbepgvu[/url], [link=http://lizwqmkxrjvj.com/]lizwqmkxrjvj[/link], http://peybmvuiensy.com/

rBKMNu <a href="http://aymuqrfswdjj.com/">aymuqrfswdjj</a>, [url=http://etkszgcuxucq.com/]etkszgcuxucq[/url], [link=http://ieedvypdctzk.com/]ieedvypdctzk[/link], http://fmgohxybxqta.com/

 rBKMNu <a href="http://aymuqrfswdjj.com/">aymuqrfswdjj</a>, [url=http://etkszgcuxucq.com/]etkszgcuxucq[/url], [link=http://ieedvypdctzk.com/]ieedvypdctzk[/link], http://fmgohxybxqta.com/

Ern4KW <a href="http://rhjyakrgemhn.com/">rhjyakrgemhn</a>, [url=http://xvapntyddtwr.com/]xvapntyddtwr[/url], [link=http://jrpthnlvklwv.com/]jrpthnlvklwv[/link], http://mgwjvbxdcxav.com/

 Ern4KW <a href="http://rhjyakrgemhn.com/">rhjyakrgemhn</a>, [url=http://xvapntyddtwr.com/]xvapntyddtwr[/url], [link=http://jrpthnlvklwv.com/]jrpthnlvklwv[/link], http://mgwjvbxdcxav.com/

weighted workout vest adjustable

 Best Weighted Vests For CrossFit Weighted Vests & Body Weights iamazonsurmountwayweightedvest_2021 | Tactical Fitness Weighted Training Vest .This adjustable weighted vest has a weight limit that would suit high-performance athletes a lot more. Best Weighted Vests of 2021 | Running With a Weighted Vest,Weight vests are great for many different workouts, but how do you choose the best one for you?a massive collection of crossfit weight vest for people of all ages and genders. Find Custom and Top Quality crossfit weight vest! [url=https://www.amazon.com/SurmountWay-Adjustable-Weighted-Training-Equipment/dp/B08R5QQQPL/ref=sr_1_33?dchild=1&keywords=adjustable+weight+weighted+vest&qid=1618544826&sr=8-33]weighted workout vest adjustable[/url]

weighted workout vest with weights

 In addition to strengthening your muscles and iamazonsurmountwayweightedvest_2021 improving the rate of muscle gain, exercising with a weighted vest can also help improve bone strength. Wearing a weighted vest during weight-bearing exercises such as push-ups or squats can help increase your bone strength and density over time.Vests load weight directly to your shoulders and upper body, meaning they're especially taxing for your respiratory muscles—the diaphragm and deep intercostals. The Benefits of Weighted Vest Workouts. Because weighted vests literally force you to carry extra weight on your body. weighted workout vest with weights https://www.amazon.com/SurmountWay-Adjustable-Weighted-Training-Equipment/dp/B08R5QQQPL/ref=sr_1_33?dchild=1&keywords=adjustable+weight+weighted+vest&qid=1618544826&sr=8-33

?????

 <a href=https://vslasixv.com/>lasix

women adjustable weighted vest

 20 Best Weight Vests for Building Strength and Endurance · iamazonsurmountwayweightedvest_2021One way to change up your cardio training is by taking a note from the military and adding weight to your locomotion.Weighted vests are ideal for running and lifting. Choose a weighted vest designed to adjust at the shoulder and waist for a custom-like fit. Wearing a weighted vest during your running exercise increases the performance of your fast-twitch muscle fibers. [url=https://www.amazon.com/SurmountWay-Adjustable-Weighted-Training-Equipment/dp/B08R5QQQPL/ref=sr_1_33?dchild=1&keywords=adjustable+weight+weighted+vest&qid=1618544826&sr=8-33]women adjustable weighted vest[/url]

?????

 <a href=https://fcialisj.com>buy cheap cialis discount online

?????

 hydroxy chloroquine <a href="https://hydroxychloroquinex.com/#">dolquine</a> hydroxychloroquine 200mg tablets

?????

 hydroxycloraquin https://www.pharmaceptica.com/

Powered By

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