Xenomorph
12-04-2010 16:56:45
Hi there,
I'm trying to create physic bodies for my avatar that is loaded from OgreMax dotScene file. I have looked around the forum and came to the conclusion that I have to create a kinematicBody for each mesh in the dotScene file.
Now I have some question on how to do this.
Btw, my actor doesn't have to have the exact shape of the mesh, a sphere or box is good enough.
So, first I thought I just create a kinematicBody for each mesh like this for example
After I do this for every mesh inside the file, how can I combine those kinematicBodies into one, so that I only have to move one body and all the other ones move with it. Like I have with the dotScene object. Once I load a dotScene file I have a rootNode where everything is attached to and I only have to move this node to move all nodes. I want the same behavior with the kinematic bodies if possible. Also, how can I name the sceneNodes each body is attached to. I don't see any parameter where I can set the name of the node. It is always something like "Unnamed_xx" where xx is some number. I need this to avoid name conflicts when loading multiple dotScene files.
If this is not possible what other solution is there?
Is it also possible to just create kinematicActors for each mesh and then combine those? This was my first idea on how to do it, but it doesn't seem to be possible to just create kinematic actors.
If anybody can help me with this or can give me some pointers that would be great!
Thanks in advance!
I'm trying to create physic bodies for my avatar that is loaded from OgreMax dotScene file. I have looked around the forum and came to the conclusion that I have to create a kinematicBody for each mesh in the dotScene file.
Now I have some question on how to do this.
Btw, my actor doesn't have to have the exact shape of the mesh, a sphere or box is good enough.
So, first I thought I just create a kinematicBody for each mesh like this for example
mKB = mRenderSystem->createKinematicBody(new NxOgre::Box(10,10,10), NxOgre::Vec3(0,0,0), "main_rotor.mesh");
After I do this for every mesh inside the file, how can I combine those kinematicBodies into one, so that I only have to move one body and all the other ones move with it. Like I have with the dotScene object. Once I load a dotScene file I have a rootNode where everything is attached to and I only have to move this node to move all nodes. I want the same behavior with the kinematic bodies if possible. Also, how can I name the sceneNodes each body is attached to. I don't see any parameter where I can set the name of the node. It is always something like "Unnamed_xx" where xx is some number. I need this to avoid name conflicts when loading multiple dotScene files.
If this is not possible what other solution is there?
Is it also possible to just create kinematicActors for each mesh and then combine those? This was my first idea on how to do it, but it doesn't seem to be possible to just create kinematic actors.
If anybody can help me with this or can give me some pointers that would be great!
Thanks in advance!