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

 

前の記事

Is there ? http://xtube.in.net/ xtubes However, Kozak did not back down on the issue of the new law, which penalizes anyone who distributes information aimed at persuading minors that “nontraditional” relationships are normal or attractive.

 Is there ? http://xtube.in.net/ xtubes However, Kozak did not back down on the issue of the new law, which penalizes anyone who distributes information aimed at persuading minors that “nontraditional” relationships are normal or attractive.

smoant vape

 Vape Tanks - Vape Mod & Pen Tanks -Ave40vapeshopwholesale2019 Clearomizer is the most well-known atomizer for vaping and very popular for many first-time users.Looking to buy a new clearomizer for your vape? You can find a range of clearomizers from all the top brands here. [url=https://www.ave40.com/brands/smoant]smoant vape[/url] <a href="https://www.ave40.com/brands/smoant" title="smoant vape">smoant vape</a>

wholesale vape starter kit

 Want some help finding the best vape for your needs?Ave40vapeshopwholesale2019 See our top recommendations for 2019 and compare prices and delivery times from multiple online Ave40,Here is our recommendation for the best e cig brand to get started vaping in 2019,a box mod, you can see our list of the best vape mods and box mods here. [url=https://www.ave40.com/starter-kits]wholesale vape starter kit[/url] <a href="https://www.ave40.com/starter-kits" title="wholesale vape starter kit">wholesale vape starter kit</a>

vape dropshipping

 Ave40| - Premium Vape Brand - Vaping Manufacturer,Are you looking for a new or specific vape juice brand?Ave40vapeshopwholesale2019 Ave40 E Cigs is a leading vape company that prides itself in offering the best electronic cigarettes (e-cigs), e-liquids, vape pens, vape mods and pod mods. [url=https://www.ave40.com/drop-shipping]vape dropshipping[/url] <a href="https://www.ave40.com/drop-shipping" title="vape dropshipping">vape dropshipping</a>

aio vape kit

 Cartomizers & Electronic Cigarettes Refills Online Ave40vapeshopwholesale2019 | Ave40,Find the top rated cartomizers and refill cartridges for e-cigarettes,We are popular with our customers for our wide range of cartomizer options that are compatible with our exclusive vapor cigarettes. [url=https://www.ave40.com/starter-kits/vape-pen-starter-kits]aio vape kit[/url] <a href="https://www.ave40.com/starter-kits/vape-pen-starter-kits" title="aio vape kit">aio vape kit</a>

simple long evening gowns

 Cheap Wedding Dresses, Beautiful Lace Bridal Gowns Online- leading designer of affordable wedding dresses & bridesmaids gowns available for quick delivery. Find your gown today.We have one of the largest selections of bridesmaids dresses in our inventory!Our collection of cheap wedding dresses offers beautiful dresses at low prices with great customer service and speedy shipping. So, why not get one now? [url=https://cheapoccasiondresses.weebly.com/]simple long evening gowns[/url] <a href="https://cheapoccasiondresses.weebly.com/" title="simple long evening gowns">simple long evening gowns</a>

tea length wedding dresses under 100

 Mother needs a gorgeous dress.Lalamira.com offers a variety of mother of the bride dresses,colorful selection of short or plus size dresses under 100.2019 New Mother of the Bride Dresses for women. [url=https://tealengthweddingdressesunder100.weebly.com]tea length wedding dresses under 100[/url] <a href="https://tealengthweddingdressesunder100.weebly.com" title="tea length wedding dresses under 100">tea length wedding dresses under 100</a>

voopoo drag baby

 Smok - Vape Kits, Box Mods & Vape Accessories Ave40vapeshopwholesale2019 -Ave40,Vape stocks SMOK vape mods, vape pens, starter kits, tanks, coils, pens which are some the best vape products on the market.Smok Vape Deals, Smok Vape Kit & Tanks Sale 2019. [url=https://www.ave40.com/voopoo-drag-baby-kit-1500mah.html]voopoo drag baby[/url] <a href="https://www.ave40.com/voopoo-drag-baby-kit-1500mah.html" title="voopoo drag baby">voopoo drag baby</a>

wholesale Vape Starter Kit

 Vapor Accessories - Best E Cig Accessories and e cig parts with Freeshipping,Get the best deal for E-Cig & Vape Accessories from the largest online selection at Ave40.com,Ave40vapeshopwholesale2019 which offers E cig parts- E Cig Battery, Carrying Cases, Chargers, Atomizers, Cartomizers, Drip Tips, Bottles, Syringe, Vape Accessories. [url=https://www.ave40.com/starter-kits]wholesale Vape Starter Kit[/url] <a href="https://www.ave40.com/starter-kits" title="wholesale Vape Starter Kit">wholesale Vape Starter Kit</a>

Insert your card http://xnxx.zone/ xvnxx "Pre-2008, around 10 percent of the (assets under management) internationally was invested in European equities. That's now sub-1 for the last four years. Europe won't take off until those people come back."

 Insert your card http://xnxx.zone/ xvnxx "Pre-2008, around 10 percent of the (assets under management) internationally was invested in European equities. That's now sub-1 for the last four years. Europe won't take off until those people come back."

Powered By

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