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

 

前の記事

, http://stoicbaby.com/pastebin/ Kasting vudmana v rossii skachat torrent, https://www.twitch.tv/events/0tTL0IVfRgKjtNcfZbd1ig Bate papo newark, https://www.twitch.tv/events/P7lpkNmAQ1-VqRnFHuO7eQ Download sql server data tools,

 , http://stoicbaby.com/pastebin/ Kasting vudmana v rossii skachat torrent, https://www.twitch.tv/events/0tTL0IVfRgKjtNcfZbd1ig Bate papo newark, https://www.twitch.tv/events/P7lpkNmAQ1-VqRnFHuO7eQ Download sql server data tools,

qL0ckd <a href="http://gbtrbvxtchig.com/">gbtrbvxtchig</a>, [url=http://etjyoglnuhkd.com/]etjyoglnuhkd[/url], [link=http://qwfwdywxwtco.com/]qwfwdywxwtco[/link], http://uehxklvjmphv.com/

 qL0ckd <a href="http://gbtrbvxtchig.com/">gbtrbvxtchig</a>, [url=http://etjyoglnuhkd.com/]etjyoglnuhkd[/url], [link=http://qwfwdywxwtco.com/]qwfwdywxwtco[/link], http://uehxklvjmphv.com/

, https://seacurtefo.bandcamp.com/album/dating-in-the-dark-khaleel-and-harrison Dating in the dark khaleel and harrison, http://opencu.com/profiles/blogs/5441502:BlogPost:15900727 Ioril 10 instruktsiia, http://archive.is/FGZTi Gay test helloquizzy,

 , https://seacurtefo.bandcamp.com/album/dating-in-the-dark-khaleel-and-harrison Dating in the dark khaleel and harrison, http://opencu.com/profiles/blogs/5441502:BlogPost:15900727 Ioril 10 instruktsiia, http://archive.is/FGZTi Gay test helloquizzy,

, https://paste.cxcore.net/view/2b23365e Cure za vezu hrvatska, http://spazcarwiti.e-monsite.com/blog/malaysia-lesbians.html Malaysia lesbians, http://telhouwerschlor.reblog.hu/le-retour-du-heros-torrent Le retour du heros torrent,

 , https://paste.cxcore.net/view/2b23365e Cure za vezu hrvatska, http://spazcarwiti.e-monsite.com/blog/malaysia-lesbians.html Malaysia lesbians, http://telhouwerschlor.reblog.hu/le-retour-du-heros-torrent Le retour du heros torrent,

, http://u.wn.com/p/433292209/ pinga_ga_pori_pinga_video_song_download, https://u.wn.com/2018/12/10/Download_drakor_100_days_my_prince/ download_drakor_100_days_my_prince, http://u.wn.com/p/433294713/ seema_raja_songs_download,

 , http://u.wn.com/p/433292209/ pinga_ga_pori_pinga_video_song_download, https://u.wn.com/2018/12/10/Download_drakor_100_days_my_prince/ download_drakor_100_days_my_prince, http://u.wn.com/p/433294713/ seema_raja_songs_download,

, https://bitbin.it/aNfrD6Xr/ webcam_chats_like_omegle, http://archive.is/YkLP0 licni_kontakti_bitola_telefon, https://bitbin.it/0WfcgGfF/ top_free_dating_apps_for_iphone,

 , https://bitbin.it/aNfrD6Xr/ webcam_chats_like_omegle, http://archive.is/YkLP0 licni_kontakti_bitola_telefon, https://bitbin.it/0WfcgGfF/ top_free_dating_apps_for_iphone,

, https://tools.wmflabs.org/paste/view/645ef10c Gta_iv_psp_iso_free_download, https://paste.severedlink.net/code/view/ba284ce4 dating_as_a_single_mom_after_divorce, https://pcsites.pw/htdocs/index.php/view/27064dff badoo_profil_ohne_anmeldung,

 , https://tools.wmflabs.org/paste/view/645ef10c Gta_iv_psp_iso_free_download, https://paste.severedlink.net/code/view/ba284ce4 dating_as_a_single_mom_after_divorce, https://pcsites.pw/htdocs/index.php/view/27064dff badoo_profil_ohne_anmeldung,

, https://tapas.io/nedgegata lirik_lagu_yel_yel_persib_ku_yakin_kau_bisa, https://tapas.io/budlietrosan forza_horizon_4_ultimate_edition_free_download, https://tapas.io/leembturruckwind physics_study_material_for_competitive_exams_pdf,

 , https://tapas.io/nedgegata lirik_lagu_yel_yel_persib_ku_yakin_kau_bisa, https://tapas.io/budlietrosan forza_horizon_4_ultimate_edition_free_download, https://tapas.io/leembturruckwind physics_study_material_for_competitive_exams_pdf,

, https://pastelink.net/k76c crack_pro_atc_x, https://pastelink.net/kbn6 torrent_template_monster_collection, https://pastelink.net/kczc 7z1.ru_prilozhenie_dlia_shpionazha_za_akkauntami_v_odnoklassnikakh_bez_sms,

 , https://pastelink.net/k76c crack_pro_atc_x, https://pastelink.net/kbn6 torrent_template_monster_collection, https://pastelink.net/kczc 7z1.ru_prilozhenie_dlia_shpionazha_za_akkauntami_v_odnoklassnikakh_bez_sms,

, http://semgeopoile.e-monsite.com/blog/tinder-sex-app.html tinder_sex_app, http://xiewhetsfipab.e-monsite.com/blog/spoon-me.html spoon_me, http://semgeopoile.e-monsite.com/blog/approaching-women.html approaching_women,

 , http://semgeopoile.e-monsite.com/blog/tinder-sex-app.html tinder_sex_app, http://xiewhetsfipab.e-monsite.com/blog/spoon-me.html spoon_me, http://semgeopoile.e-monsite.com/blog/approaching-women.html approaching_women,

Powered By

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