Hi all,
May sound like a fairly dumb question but i was wondering if there was a way to re-initialize an AnimatedMeshSceneNode so i could change the mesh that it has.
For example.
I have 3 different type of weapons that the player can pick up. Each of these are their own .x files, however i want them all to appear at the same spot ergo i want them to all appear where the initial weapon was.
I was wondering if there was a better way than simple calling
bullet = smgr->addAnimatedMeshSceneNode(object.x);
as this seems to override the position,parenting, scaling that the other weapon had.
Thanks in advance.
Re-initalizing a Scenenode[Solved]
Re-initalizing a Scenenode[Solved]
Last edited by Atraides on Sun Jul 08, 2007 11:25 pm, edited 1 time in total.
Cheers
Courtney
Courtney
You need to keep, or get, a pointer to the IAnimatedMeshSceneNode. Once you have that you can call setMesh() to change the mesh.
Another option is to get a pointer to the old scene node, cache the position, orientation and scale, unload that scene node, create a new one and apply the cached values.
The final option would be to create a dummy scene node that has the transformation [position, rotation, scale] applied, and use that as the parent for the weapon. Then you just need to remove() the old weapon and add the new weapon as a child of the dummy node.
Travis
Another option is to get a pointer to the old scene node, cache the position, orientation and scale, unload that scene node, create a new one and apply the cached values.
The final option would be to create a dummy scene node that has the transformation [position, rotation, scale] applied, and use that as the parent for the weapon. Then you just need to remove() the old weapon and add the new weapon as a child of the dummy node.
Travis