OgreNewt with parent space

ForgottenMaster

04-12-2008 11:49:32

Hey guys,

I have just started working with OgreNewt and have run into some problems integrating it into my visual code. In the examples I have seen, it looks as though the rigid body should be attached to a direct child of root with the visual entity, then position and orientation of the body is set in world space, thus also moving the visual representation to the correct place.

However, the structure that I have at the moment is a hierarchical scene graph in which the visual entities are a few levels down. I have been using transformations in parent space down to this level, yet OgreNewt expects world coordinates. I have tried attaching the rigid body to the scene node and then using _getDerivedPosition( ) and _getDerivedOrientation to set the body, however, that just translates or orients the visual representation by that amount again, resulting in it being in the wrong place.

I have also tried setting the position and orientation of the body before attaching it, which works fine when the mass is 0, but has the same effect as above when not 0.

So my question is does anybody have an example of using OgreNewt in a hierarchical manner, wherin the visual entity scene nodes are not directly derived from root, or is deriving directly from root the only guaranteed way of achieving the correct effects?

Thanks in advance

ForgottenMaster

04-12-2008 13:22:24

actually, I just sorted it :D

I found a topic on these boards mentioning that you can use the position and orientation offset values when creating a collision object which cleared it right up