OGRE3DBody with existing SceneNode

andihit

05-07-2009 15:01:26

Hi,

I want to create an OGRE3DBody with an existing SceneNode.

So I 've looked at the code, and the OGRE3DRenderSystem::createBody() accepts a RigidBodyDescription.
Inside it, a new :? OGRE3DRigidBodyPrototype is created. This class has a member mNode.
Then the RigidBodyDescriptionToRigidBodyPrototype() function copies all RigidBodyDescription members to the OGRE3DRigidBodyPrototype. But, not the mNode, cause mNode is only a member of OGRE3DRigidBodyPrototype and isn't a member of RigidBodyDescription.

Yeah, then inside the createBody a OGRE3DBody is created, with a OGRE3DRigidBodyPrototype as an argument. Inside the constructor of the OGRE3DBody, there is a check for prototype->mNode.
But...that thing is always NULL, cause the RigidBodyDescriptionToRigidBodyPrototype() function copies only RigidBodyDescription members to the OGRE3DRigidBodyPrototype. So the mNode is always NULL.

So, do I have any chance to use a existing SceneNode in the Body?


Why do I need this? Cause it's a game where you can run with a character in a world around and the camera is always attached at the character. Currently I've a FloorNode, a ViewNode attached to this FloorNode, a CharacterNode which is attached to the ViewNode, and the character should be attachted at the CharacterNode, and the Camera is attached to the ViewNode.
Then, when the character/the mouse moves, the viewNode is moved.

tia :)

betajaen

05-07-2009 15:37:09

Really it is best to make your own OGRE3DBody class if you want things like this. The OGRE3DRenderSystem is purely optional and shouldn't be used for serious things.