※前回の記事の続きです。
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でオブジェクトを掴む方法の説明は終了です。
The National Gallery <a href=" http://guildwars2forum.com/cobasoft-od-composition/ ">cobasoft od</a> "We ask his mom to come once a week so that we can go to dinner, go have sushi or something like that," she said about their much-needed date night
The National Gallery <a href=" http://guildwars2forum.com/cobasoft-od-composition/ ">cobasoft od</a> "We ask his mom to come once a week so that we can go to dinner, go have sushi or something like that," she said about their much-needed date night
Your account's overdrawn <a href=" http://www.instalacioneshidraulicas.com/order-diet-whey-ultralean-shakeology/ ">african mango weight loss amazon</a> They denounced what they saw as unwanted interference in Thai affairs and bombarded the U.S
Your account's overdrawn <a href=" http://www.instalacioneshidraulicas.com/order-diet-whey-ultralean-shakeology/ ">african mango weight loss amazon</a> They denounced what they saw as unwanted interference in Thai affairs and bombarded the U.S
I'm in a band <a href=" http://tender-care.co.uk/chromadex-niagen-study ">buy evanescence tickets</a> “The production company received a phone call from the Voysey Society,” he recalled
I'm in a band <a href=" http://tender-care.co.uk/chromadex-niagen-study ">buy evanescence tickets</a> “The production company received a phone call from the Voysey Society,” he recalled
I've got a part-time job <a href=" http://www.instalacioneshidraulicas.com/testify-to-love-chords-pdf/ ">vesele Å¡tajerke ljubÄek moj</a> Pitchers may not talk for more than four minutes, and definitely must not use PowerPoint
I've got a part-time job <a href=" http://www.instalacioneshidraulicas.com/testify-to-love-chords-pdf/ ">vesele Å¡tajerke ljubÄek moj</a> Pitchers may not talk for more than four minutes, and definitely must not use PowerPoint
Get a job <a href=" http://www.motorhomescotland.co.uk/cialis-a-basso-prezzo.html ">cialis 20mg 12 stck preis</a> Pilot's Union Vereinigung Cockpit (VC) said late on Mondaythe strike, its second of 2015, would focus on short- andmedium-haul flights
Get a job <a href=" http://www.motorhomescotland.co.uk/cialis-a-basso-prezzo.html ">cialis 20mg 12 stck preis</a> Pilot's Union Vereinigung Cockpit (VC) said late on Mondaythe strike, its second of 2015, would focus on short- andmedium-haul flights
Can you put it on the scales, please? <a href=" http://autodent-services.co.uk/healthyfife-net-reviews.html ">healthyfife.net reviews</a> Right after which pop singer Katy Perry tweeted out a cryptic message starting rumors Swift's song is about her.
Can you put it on the scales, please? <a href=" http://autodent-services.co.uk/healthyfife-net-reviews.html ">healthyfife.net reviews</a> Right after which pop singer Katy Perry tweeted out a cryptic message starting rumors Swift's song is about her.
There's a three month trial period <a href=" http://guildwars2forum.com/weltone-z-20-uses/ ">weltone z 20 uses</a> “When you’re a female, there are always other people on stage watching what you’re doing
There's a three month trial period <a href=" http://guildwars2forum.com/weltone-z-20-uses/ ">weltone z 20 uses</a> “When you’re a female, there are always other people on stage watching what you’re doing
Some First Class stamps <a href=" http://zobbing.co.uk/buy-naltrexone-in-mexico ">revia dosage range</a> But Fenwick's lawyer, David Shurtz, says his client was shot four times, starting as he was simply trying to back up, not drive forward
Some First Class stamps <a href=" http://zobbing.co.uk/buy-naltrexone-in-mexico ">revia dosage range</a> But Fenwick's lawyer, David Shurtz, says his client was shot four times, starting as he was simply trying to back up, not drive forward
Sorry, I'm busy at the moment <a href=" http://asoupar.ir/?order-vaso-blaster ">vaso blast for ed</a> They say that building the aircraft is like: “Shrine buildings are razed and rebuilt every 20 years to pass on traditional building skills.”
Sorry, I'm busy at the moment <a href=" http://asoupar.ir/?order-vaso-blaster ">vaso blast for ed</a> They say that building the aircraft is like: “Shrine buildings are razed and rebuilt every 20 years to pass on traditional building skills.”
I stay at home and look after the children <a href=" http://tender-care.co.uk/cream-nm ">instantly ageless reviews australia</a> This provides valuable scientific information on the levels and types of pollutants
I stay at home and look after the children <a href=" http://tender-care.co.uk/cream-nm ">instantly ageless reviews australia</a> This provides valuable scientific information on the levels and types of pollutants