Jump to content

[4.6 Beta + VR] Unable to hide VR models.


Recommended Posts

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 PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

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 PreprocessorTex2TGA - Darkness Awaits Template (Leadwerks)

If you like my work, consider supporting me on Patreon!

Link to comment
Share on other sites

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...