Page 1 of 1

debug draw out of sync with render mesh

Posted: Fri May 22, 2020 9:32 pm
by whitwhoa
Is there a setting that I am overlooking that determines how frequently the debug lines are drawn by the debug drawer? I have a cube shape rigid body that is updating the translation and rotation of a cube object to be rendered, but when I enable my debug drawer the lines appear to not be updating at the same rate as the actual rotation of the rigid body. When the objects start falling and end falling, the wireframe always lines up with the render box, which is why I'm thinking it might be an issue related to the aforementioned...? Going to continue to look through things, might wind up figuring this out myself, if I do, I will post my findings. Thanks!

This has been corrected, the issue was a trivial mistake on my part. My render objects use glm for transforms, and I had simply forgotten that glm places the quaternion W component as the first parameter in it's constructor as opposed to the last. Second time this has gotten me. Maybe now I'll remember!

Re: debug draw accuracy

Posted: Sat May 23, 2020 2:48 am
by whitwhoa
For clarification I have uploaded a video which shows what I am trying to explain. It maybe an issue with how I'm applying the rotation to my model???

Video Link:

I'm basically just copying the world transform every tick like such:

Code: Select all

glm::vec3 bodyTranslation = glm::vec3(cubeBody->getWorldTransform().getOrigin().getX(),

glm::quat bodyRotation = glm::quat(cubeBody->getWorldTransform().getRotation().getX(),