Jump to content
  • 1
reepblue

Parent Behavor W/O Actually Parenting

Question

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?

Share this post


Link to post

9 answers to this question

Recommended Posts

  • 0

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, :)

Share this post


Link to post
  • 0

Couldn't you unhide a model, move/rotate it, get the child's position/rotation, apply that info to another entity, then hide the model again before rendering each frame?

Share this post


Link to post
  • 0

The child will always be hidden with the parent.

I feel any delay will result in the same effect.

Share this post


Link to post
  • 0

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.

Share this post


Link to post
  • 0

Apply an invisible material to the parent. It’s a blend setting. )

Share this post


Link to post
  • 0
38 minutes ago, Josh said:

Apply an invisible material to the parent. It’s a blend setting. )

Issue was applying a new material to the controllers crashes the app.

Share this post


Link to post
  • 0

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

Share this post


Link to post
  • 0
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.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   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.

×
×
  • Create New...