reepblue Posted March 20, 2019 Share Posted March 20, 2019 I believe I should be able to access the models like any other models according to the API reference., but it doesn't seem to be the case. I've ran into issues previously (A while ago) with setting a different material to the controllers. I was getting a hard crash. Quote By default a visual representation of the user's VR hardware will be displayed. If you want to replace the controllers with weapons or other items, simply hide the controller models. https://www.leadwerks.com/learn?page=API-Reference_Object_VR_GetControllerModel This function was being called with my UpdateWorld function. Also if you removethe p.second != nil condition, the app will crash also. //----------------------------------------------------------------------------- // Purpose: //----------------------------------------------------------------------------- void AVRPlayer::UpdateControllers() { if (VR::GetControllerModel(VR::Left) != nil) { if (m_bControllerLeft == false) { DMsg("VR: Registered left controller.."); VR::TriggerHapticPulse(VR::Left); m_bControllerLeft = true; } UpdateLeftController(); } if (VR::GetControllerModel(VR::Right) != nil) { if (m_bControllerRight == false) { DMsg("VR: Registered right controller.."); VR::TriggerHapticPulse(VR::Right); m_bControllerRight = true; } VR::GetControllerModel(VR::Left)->Hide(); VR::GetControllerModel(VR::Right)->Hide(); UpdateRightController(); } for (auto& p : VR::devicemodel) { if (p.second != nil) { p.second->Hide(); } } } Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted March 20, 2019 Share Posted March 20, 2019 Your code above could crash if the right controller model has loaded but the left one has not. My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
reepblue Posted March 20, 2019 Author Share Posted March 20, 2019 This was a brute Force test I did before I called it a night. You can move the hide commands with the condition scopes. Regardless, still unable to access the VR stuff like traditional models. Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
reepblue Posted March 21, 2019 Author Share Posted March 21, 2019 This works with 4.5 and I think it's part of a bigger issue... Cyclone - Ultra Game System - Component Preprocessor - Tex2TGA - Darkness Awaits Template (Leadwerks) If you like my work, consider supporting me on Patreon! Link to comment Share on other sites More sharing options...
Josh Posted March 23, 2019 Share Posted March 23, 2019 Fixed for next build. 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts