My current method looks like this, where node is the gun and testnode is the bullet:
Code: Select all
testnode =smgr->addTestSceneNode(1,node,-1,core::vector3df(5,0,1),core::vector3df(0.0f,0.0f,0.0f));
// testnode has now been created with parent set as "node".
vector3df abspos=testnode->getAbsolutePosition();
vector3df absrot=testnode->getRotation(); // get Absolute position
absrot=absrot+testnode->getParent()->getRotation(); // get absolute rotation
testnode->setParent(smgr->getRootSceneNode()); // set parent to root
testnode->setPosition(abspos);
testnode->setRotation(absrot);