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

 

前の記事

telescope for kids beginner

 3.Practice Tension and Stitch Control:"wwwsentro-knittingmachinecom_2024" Experiment with different tension settings to achieve the desired stitch density and quality. Adjusting the tension can help prevent loose or tight stitches. Additionally, practice controlling the carriage or crank to achieve smooth and even knitting motions. <a href="https://www.amazon.com/Handmade-Crochet-Crocheting-Knitting-Accessories/dp/B0CJ2RNGHB" >telescope for kids beginner</a> [url=https://www.amazon.com/Handmade-Crochet-Crocheting-Knitting-Accessories/dp/B0CJ2RNGHB]telescope for kids beginner[/url]

sentro knitting machine 40 needles

 If you have any specific questions about "wwwsentro-knittingmachinecom_2024" operating a 48-needle knitting machine or need assistance with knitting-related topics, feel free to ask! sentro knitting machine 40 needles https://www.sentro-knittingmachine.com/products/digital-0-99999-row-counter-for-knitting-machine

red snowflake pillow cover

 To use a rotating double knit loom kit like the Sentro Knitting Machine: [url=https://www.amazon.com/Halloween-Spiderweb-Decorative-Pillowcases-Farmhouse/dp/B0CCP251S9]red snowflake pillow cover[/url]

bat throw pillow cover

 When choosing circular knitting needles,"wwwsentro-knittingmachinecom_2024" knitters often consider factors such as the needle size, length, material, and their personal knitting style. Additionally, user reviews and recommendations from other knitters can provide valuable insights into the performance and quality of the specific brand or model. [url=https://www.amazon.com/Umootek-Outdoor-Decorative-Pillowcases-Farmhouse/dp/B0CCP4QG8W]bat throw pillow cover[/url]

knitting machine price

 If you are interested in exploring machine-based crochet techniques,"wwwsentro-knittingmachinecom_2024" there are a few options available, such as the Addi Express King Size Knitting Machine, which can be used to create both knitting and crochet-like stitches. However, it's important to note that the results may not have the same intricate detail or flexibility as hand-crocheted items. [url=https://www.sentro-knittingmachine.com/collections/knitting-accessories]knitting machine price[/url]

grill oil brush

 1.Scarves: Knitting machines are perfect for making scarves quickly and efficiently."wwwsentro-knittingmachinecom_2024" Experiment with different stitch patterns, yarn types, and colors to create unique designs. <a href="https://www.amazon.com/Handmade-Crochet-Crocheting-Knitting-Accessories/dp/B0CJ2RNGHB" >grill oil brush</a>

yarn storage bag

 Hand crank circular knitting machines like the Sentro Knitting Machine make it easy to spin up knit projects and fiber crafts quickly."wwwsentro-knittingmachinecom_2024" The hand-crank mechanism allows you to generate knitted fabric at a faster pace compared to traditional knitting methods using needles. Here are some reasons why these machines are particularly suitable for quickly creating knit projects: <a href="https://www.sentro-knittingmachine.com/products/9-in-1-led-lighting-crochet-hooks-set" >yarn storage bag</a>

Powered By

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