trey.coursey Posted February 16, 2019 Share Posted February 16, 2019 In Unity we are able to easily restrict the user in VR to only teleport to areas we allow. In Unigine we do not see that option...it's too easy for users to teleport into walls and ceilings etc... I'ts obviously a user interaction error...if they knew what they were doing it would be fine...but restricting their abilities to only teleport to certain areas would be a huge feature request if it's not available. Thanks. 1 Link to comment
morbid Posted February 18, 2019 Share Posted February 18, 2019 Hello Trey, You can easily achieve this with Intersection mask. Create a mesh that follows the area you want to teleport Assign a similar intersection mask to the teleport ray and this mesh Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
trey.coursey Posted February 18, 2019 Author Share Posted February 18, 2019 @morbid, any chance I could get you to go into a bit more detail. Maybe a full step by step, calling out the right menu items etc? I can handle creating the geometry and putting a mask property or something...if there is coding that may be a stretch. Thanks for any more help! Link to comment
moroz Posted February 18, 2019 Share Posted February 18, 2019 2 hours ago, trey.coursey said: @morbid, any chance I could get you to go into a bit more detail. Maybe a full step by step, calling out the right menu items etc? I can handle creating the geometry and putting a mask property or something...if there is coding that may be a stretch. Thanks for any more help! Hi! At first, you can set intersection mask for teleportation ray by this method: void VRPlayerVR::setTeleportationMask(int mask). Next, you have to select desired Surface in desired ObjectMesh* and set same intersection mask. You can use some meshes for teleportation in allowed areas. 1 Link to comment
piotr.karkocha Posted March 18, 2019 Share Posted March 18, 2019 Hi @moroz, I was trying to follow your steps and it all seems very easy - I see the method setTeleportationMask just at the top of VRPlayerVR.cpp , but I still can't figure out how to assign the mask in the code. I have an intersection mask 80000000 asigned to my mesh in the editor - should I also input a numeric value in the code instead of "mask"? void VRPlayerVR::setTeleportationMask(int mask) { teleportation_mask = mask; } Thanks Link to comment
moroz Posted March 19, 2019 Share Posted March 19, 2019 @piotr.karkocha Hi! In Editor intersection mask is displayed as integer hexadecimal number. Your mask value is (int)0x80000000, you should do it: setTeleportationMask(0x80000000) . Link to comment
piotr.karkocha Posted March 20, 2019 Share Posted March 20, 2019 Hi Moroz, I tried your method but then I saw that the teleportation_mask variable is already initialized to 1 under protected in VRPlayerVR.h. So changing its value to the desired mask number did the job! Thanks Link to comment
Recommended Posts