reepblue Posted March 30, 2019 Share Posted March 30, 2019 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? Quote 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 30, 2019 Author Share Posted March 30, 2019 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, Quote 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...
gamecreator Posted March 30, 2019 Share Posted March 30, 2019 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? Quote Link to comment Share on other sites More sharing options...
reepblue Posted March 30, 2019 Author Share Posted March 30, 2019 The child will always be hidden with the parent. I feel any delay will result in the same effect. Quote 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...
gamecreator Posted March 30, 2019 Share Posted March 30, 2019 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. Quote Link to comment Share on other sites More sharing options...
SpiderPig Posted May 15, 2019 Share Posted May 15, 2019 I'm having the same issue, can't test this at the moment but maybe there's a way to update an entities matrix first? Like entity->updatematrix()? Quote Link to comment Share on other sites More sharing options...
Josh Posted May 16, 2019 Share Posted May 16, 2019 Apply an invisible material to the parent. It’s a blend setting. ) Quote 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 May 16, 2019 Author Share Posted May 16, 2019 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. Quote 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 May 16, 2019 Share Posted May 16, 2019 The controller may be NULL until it loads in. Make sure it exists before you apply the material. Quote 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 May 17, 2019 Author Share Posted May 17, 2019 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. Quote 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...
Recommended Posts
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.