Horde3D
http://horde3d.org/forums/

Physics engine and global transformation
http://horde3d.org/forums/viewtopic.php?f=2&t=1603
Page 1 of 1

Author:  shd [ 06.12.2011, 01:00 ]
Post subject:  Physics engine and global transformation

I'm probably missing something obvious here, but why there is no API to set global transformation?
Does it mean, if i want to drive my physics transformations by physics engine, i have manually reverse transformations like:
world (from physics engine) -> parent(*) -> local and then set local in horde?

Doesn't it make sense to just insert every mesh as children of root, and don't care about this scene graph thingy anymore?
I don't know the answer, because i still didn't dive too much into horde3d source code, and it's not obvious for me since i still feel incompetent in graphics programming (i wish i had more time :( ).

So, how do you drive your physics transformations with horde3d (assuming you're simulating your world with help of it) ?

Author:  Orm [ 08.12.2011, 19:30 ]
Post subject:  Re: Physics engine and global transformation

You can set the absolute transformation matrix through h3dSetNodeTransMat. I use it in my engine without problems. Just be sure that whatever matrix you get from your physics engine will work with OpenGL (column major versus row major, etc...)

Author:  shd [ 08.12.2011, 20:50 ]
Post subject:  Re: Physics engine and global transformation

Orm wrote:
You can set the absolute transformation matrix through h3dSetNodeTransMat.

Thanks for answer!
So, http://www.horde3d.org/docs/html/_api.html#h3dSetNodeTransMat which describes h3dSetNodeTransMat as
Quote:
This function sets the relative transformation matrix of the specified scene node. It is basically the same as setNodeTransform but takes directly a matrix instead of individual transformation parameters.

is wrong?

If it is, someone with svn access should update description because it might be confusing for noobs like me.

Author:  Volker [ 08.12.2011, 21:22 ]
Post subject:  Re: Physics engine and global transformation

No it's not wrong. It sets the relative transformation matrix based on the scene graph hierarchy. If you don't have a hierarchy it's basically the same as an absolute matrix. But in general it's always relative to it's parent node.

Author:  shd [ 09.12.2011, 19:35 ]
Post subject:  Re: Physics engine and global transformation

Volker wrote:
No it's not wrong. It sets the relative transformation matrix based on the scene graph hierarchy. If you don't have a hierarchy it's basically the same as an absolute matrix. But in general it's always relative to it's parent node.

Oh, i thought scene graph is generally used for deep hierarchies rather than root -> model -> joints.
Thanks for answer.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/