Jump to content

Parent Behavor W/O Actually Parenting


reepblue
 Share

Recommended Posts

Hello,

This is going to be hard to explain, but I need to parent a model to an entity that I want hidden in-order to get custom VR models to work correctly. The issue is tjhat when the parent is hidden, all of it's children are forced hidden as well. There is a rubber band effect when you just apply the the parent's matrix to the child's matrix every frame.

	// Update The model to the controller's matrix
	if (m_pControllerA != nil)
	{
		m_pControllerA->SetMatrix(VR::GetControllerModel(m_intControllerA)->GetMatrix());
	}

	if (m_pControllerB != nil)
	{
		m_pControllerB->SetMatrix(VR::GetControllerModel(m_intControllerB)->GetMatrix());
	}

When it is parented to the controller, the models are one-to-one and there is no delay.My question is how do I mimic the matrix updating without actually doing any parenting?

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

I've decided to take a different direction with this. While It's still not 1:1, I now have a perk in doing it the way I am now. Still, would like some insight for future issues, :)

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

Yeah, now that I think about it, I had a similar issue trying to position and rotate a camera behind a player.  I only solved that by parenting the camera (which I know is not an option for you).  One other possibility: have you tried calling world->Update() after the SetMatrix function?  Seems like Leadwerks needs to catch up on positioning and that might do it.

Link to comment
Share on other sites

  • 1 month later...
On 5/16/2019 at 7:41 AM, Josh said:

The controller may be NULL until it loads in. Make sure it exists before you apply the material.

I'll be sure to try again. If it's still crashing, I'll file a bug report.

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...