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

 

前の記事

Túi Hermes siêu cấp

 Adjustable Weighted Vest for Fitness -luxurysjp2023 adding more to your workouts with the one size fits all WEIGHTED VEST. Carrying extra weight during your workouts demands more,Weighted vests are ideal for any workout, they can help you build muscle or lose calories. We carry two different sizes, 20 LB and 40 LB.Weight vests are great for many different workouts, but how do you choose the best one for you?You can wear a weight vest during workouts to help build muscle while also burning fat and calories. Weight vests can be especially helpful for burning calories. [url=https://www.duybrand.com/brand-23-c0.html]Túi Hermes siêu cấp[/url]

Miniature Doll House

 Easy to Use & Dishwasher Safe-"wwwsentro-knittingmachinecom_2023" Fill the silicone ice trays ice cube mold with water, close the lid, and slide the tray into the freezer. In addition to water, you can fill the ice cubes reusable with fruit, ice cream, soda, cocktails, whiskey, vodka, iced coffee and wine to customize your favorite flavors. It also can be use as fondant tools silicone mold. And you can simply put them in the dishwasher after use. [url=https://www.amazon.com/Dollhouse-Furniture-Decoration-Accessories-Toys%EF%BC%8CDollhouse/dp/B0C6MF2HZ5]Miniature Doll House[/url]

Realistic Baby Doll

 Clear Ice Ball Mold - Amazon ,"wwwsentro-knittingmachinecom_2023" Bar Party Silicone Trays Fun Shapes Molds, Silicone Mold for ice, chocolate cakes designs. EASY TO REMOVE : The silicone ice cube tray is very flexible, you can pop out the ice cubes or you can rinse the bottom for a few seconds or leave it for 30 seconds to make it easier to release.Included: You will get a seal and dolphin mold锛?the production difficulty is very small, this is very suitable for beginners, he will be stunning to you, you have any questions can always contact us [url=https://www.amazon.com/qooarker-Lifelike-Reborn-Baby-Dolls/dp/B0C6XFKYNF]Realistic Baby Doll[/url]

vokpxmwzje

 Singularity-labo [url=http://www.gmg8833499v66imj3p0g5zo8yo58z0xfs.org/]uvokpxmwzje[/url] <a href="http://www.gmg8833499v66imj3p0g5zo8yo58z0xfs.org/">avokpxmwzje</a> vokpxmwzje http://www.gmg8833499v66imj3p0g5zo8yo58z0xfs.org/

Anatomical Structures

 It's worth noting that while knitting machines can expedite the process of creating garments, they require practice and experimentation to achieve desired results. Consider starting with simpler projects and gradually progress to more complex designs as you become more familiar with your knitting machine's capabilities and your knitting skills improve. [url=https://www.amazon.com/Qooarker-Replica-Anatomical-Structures-Teaching/dp/B0C4SMS8SH]Anatomical Structures[/url]

diy dollhouse

 2.Continuous Knitting: With circular knitting machines, you can knit in a continuous spiral, forming a seamless tube."wwwsentro-knittingmachinecom_2024" The stitches are created as the machine's needles or hooks travel in a circular motion around the bed. This allows for efficient and faster knitting compared to traditional flat knitting. [url=https://www.amazon.com/Miniature-Dollhouse-Furniture-Handmade-Wooden/dp/B0C7CGPZ7T]diy dollhouse[/url]

Decorative ambiance wall art

 1.Circular Knitting Machines:"wwwsentro-knittingmachinecom_2024" These machines resemble a round table with multiple hooks or needles positioned around the circumference. They can be manually operated, allowing you to create circular or tubular crocheted pieces such as hats, socks, and sleeves more quickly. [url=https://www.amazon.com/qooarker-Lighting-Painting-Picture%EF%BC%8CDecorative-Decorative/dp/B0C5XB6MD1]Decorative ambiance wall art[/url]

Doll House Accessories

 5.Endless Possibilities:"wwwsentro-knittingmachinecom_2024" From hats and scarves to sweaters, blankets, and more, the possibilities of what you can create with a knitting machine are virtually limitless. Doll House Accessories https://www.amazon.com/Dollhouse-Furniture-Decoration-Accessories-Toys%EF%BC%8CDollhouse/dp/B0C6MF2HZ5

Decorative painting

 3.Cast On: Begin by casting on the desired number of stitches onto the machine's needles."wwwsentro-knittingmachinecom_2024" This will determine the circumference of the hat. The specific method of casting on may vary depending on the circular knitting machine model you are using. [url=https://www.amazon.com/qooarker-Lighting-Painting-Picture%EF%BC%8CDecorative-Decorative/dp/B0C5ZV2XXY]Decorative painting[/url]

Balloons kit for Birthday Party Wedding

 3.Cast On: Start by casting on stitches."wwwsentro-knittingmachinecom_2024" Begin by securing the yarn to the first peg and then wrapping it around each subsequent peg in a clockwise or counterclockwise direction. There are different cast-on methods you can use, such as the e-wrap or figure-eight cast-on. Refer to the instructions provided with your specific machine or loom for the recommended cast-on technique. [url=https://www.amazon.com/Balloons-decoration-Artificial-Decorations-Graduation/dp/B0C7QLXFSX]Balloons kit for Birthday Party Wedding[/url]

Powered By

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