I'm having an issue where when I do something for an object that is the same mesh as another object, it does that thing for both.
So for example, I'm using the code:
Code: Select all
IAnimatedMeshSceneNode* Mouse::getMesh()
{
core::line3d<f32> ray = Game::smgr->getSceneCollisionManager()->getRayFromScreenCoordinates(Game::device->getCursorControl()->getPosition());
core::vector3df intersection;
core::triangle3df hitTriangle;
scene::IAnimatedMeshSceneNode * selectedSceneNode =
(IAnimatedMeshSceneNode*)Game::smgr->getSceneCollisionManager()->getSceneNodeAndCollisionPointFromRay(
ray,
intersection, // This will be the position of the collision
hitTriangle, // This will be the triangle hit in the collision
0, // This ensures that only nodes that we have
// set up to be pickable are considered
0); // Check the entire scene (this is actually the implicit default)
return selectedSceneNode;
}
Then if I use code
Code: Select all
Game::smgr->getMeshManipulator()->setVertexColors(Mouse::getMesh(), SColor(255,255,255,255));
Similarly, if I update the bone position of one mesh, the bones of all the other meshes will also update.
So if I set the animation loop on one object to be a running motion, all other similar models will also do the run loop when they shouldn't.
Take this picture for example,
Only one head mesh should be green, not both.
If one starts walking, the other also starts walking in place.