※前回の記事の続きです。
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でオブジェクトを掴む方法の説明は終了です。
What part of do you come from? <a href=" http://guildwars2forum.com/celgro-generic/ ">selgros</a> "In our wildest dreams, we didn't think it would work as well as it did for the patients we've treated so far," Grupp said.
What part of do you come from? <a href=" http://guildwars2forum.com/celgro-generic/ ">selgros</a> "In our wildest dreams, we didn't think it would work as well as it did for the patients we've treated so far," Grupp said.
Will I get paid for overtime? <a href=" http://99beers.com/methycobal-yw ">methycobal 500mg injection que sirve en español</a> One was reportedly returning the other to retrieve his personal car, still parked on White House grounds.
Will I get paid for overtime? <a href=" http://99beers.com/methycobal-yw ">methycobal 500mg injection que sirve en español</a> One was reportedly returning the other to retrieve his personal car, still parked on White House grounds.
Accountant supermarket manager <a href=" http://guildwars2forum.com/bropax/ ">aropax generic</a> The firm booked a loss of 53.1bn yen to cover recalls and other quality-related costs in the same time period
Accountant supermarket manager <a href=" http://guildwars2forum.com/bropax/ ">aropax generic</a> The firm booked a loss of 53.1bn yen to cover recalls and other quality-related costs in the same time period
Whereabouts are you from? <a href=" http://wouldliketoteach.org/?zanaflex-in ">tizanidine side effects high blood pressure</a> "I've just decided to do films that regardless of budget, nurture and foster a great atmosphere on set
Whereabouts are you from? <a href=" http://wouldliketoteach.org/?zanaflex-in ">tizanidine side effects high blood pressure</a> "I've just decided to do films that regardless of budget, nurture and foster a great atmosphere on set
A law firm <a href=" http://www.freshfurniture.co.uk/cosopt-gn/ ">cosopt generic dosage</a> Louisville has been considered a Final Four contender all season, but that may have ended on Sunday
A law firm <a href=" http://www.freshfurniture.co.uk/cosopt-gn/ ">cosopt generic dosage</a> Louisville has been considered a Final Four contender all season, but that may have ended on Sunday
I'm doing a phd in chemistry <a href=" http://lightquick.co.uk/cbd-oil-dosage-for-sleep-vape-help.html ">buy cbd oil online uk holland and barrett vapes</a> Fisher said it was hard to read Bargnani to see how he was dealing with his latest setback.
I'm doing a phd in chemistry <a href=" http://lightquick.co.uk/cbd-oil-dosage-for-sleep-vape-help.html ">buy cbd oil online uk holland and barrett vapes</a> Fisher said it was hard to read Bargnani to see how he was dealing with his latest setback.
I'd like some euros <a href=" http://guildwars2forum.com/kwiknic-chewing-gum-price/ ">kwiknic chewing gum price</a> So essentially a US federal judge is forcing a default of another country rather than work out a repayment plan
I'd like some euros <a href=" http://guildwars2forum.com/kwiknic-chewing-gum-price/ ">kwiknic chewing gum price</a> So essentially a US federal judge is forcing a default of another country rather than work out a repayment plan
Canada>Canada <a href=" http://henleyoperatic.co.uk/nizagara-hc ">nizagara for sale tgi</a> “To have money that is unrestricted and could be used for general operations are the most precious (donations).”
Canada>Canada <a href=" http://henleyoperatic.co.uk/nizagara-hc ">nizagara for sale tgi</a> “To have money that is unrestricted and could be used for general operations are the most precious (donations).”
We need someone with qualifications <a href=" http://lightquick.co.uk/cbd-oil-amazoncouk-legit.html ">cbd oil capsules uk price</a> After all most footage filmed on a smartphone never sees a big screen, so who cares?
We need someone with qualifications <a href=" http://lightquick.co.uk/cbd-oil-amazoncouk-legit.html ">cbd oil capsules uk price</a> After all most footage filmed on a smartphone never sees a big screen, so who cares?
What qualifications have you got? <a href=" http://autodent-services.co.uk/anaboliczstore-com-reviews.html ">anaboliczstore.com</a> The former Miss Teen Oregon-World pageant winner was caught as part of a five-month investigation into Jarrod Wells
What qualifications have you got? <a href=" http://autodent-services.co.uk/anaboliczstore-com-reviews.html ">anaboliczstore.com</a> The former Miss Teen Oregon-World pageant winner was caught as part of a five-month investigation into Jarrod Wells