I am using engine 0.4.0, and I tried it with a .md2, and a .3ds models, and I get the same results.
Here is my problem:
I am trying to attach a gun to a CameraSceneNodeFPS as a child, so that it moves, and rotates with it like any gun in a FPS should do. This is what my code looks like, and take into account that this is just a test case, and the design for my program is going to be completly different.
The rpoblem is that my md2 mesh doesn't move with my camera. I had the program output the position of X for the camera & node, and they camera moves, but the node doesn't change its position at all.
Code: Select all
//Global Camera & Node
scene::ICameraSceneNode* camera = 0;
IAnimatedMeshSceneNode* node = 0;
//In Main
camera = smgr->addCameraSceneNodeFPS();
device->getCursorControl()->setVisible(false);
core::vector3df posWeaponCam(10,-15,15);
IAnimatedMesh* mesh = smgr->getMesh(test->getMeshName());
node = smgr->addAnimatedMeshSceneNode( mesh, camera, 0, posWeaponCam );
if(node){
node->setMaterialFlag(EMF_LIGHTING, false);
//node->setFrameLoop(0, 310);
node->setMaterialTexture(0, driver->getTexture(test->getTextureName()));
}
Thanks for any replies.