I can avoid this? I write some piece of code here for well explanation:
Code: Select all
//add camera and collision detection
scene::ICameraSceneNode* camera =
camera = smgr->addCameraSceneNodeFPS(0,100.0f,300.0f);
camera->setPosition(core::vector3df(-100,50,-150));
scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(
selector, camera, core::vector3df(30,50,30),
core::vector3df(0,-3,0),
core::vector3df(0,50,0));
camera->addAnimator(anim);
anim->drop();
//add the arm & weapon model
scene::IAnimatedMesh * weaponmesh= smgr->getMesh("Data/weapon.ms3d");
scene::IAnimatedMeshSceneNode * weaponode=smgr->addAnimatedMeshSceneNode(weaponmesh,camera,-1);
if (weaponode)
{
weaponode->setMaterialTexture( 0, driver->getTexture("Data/weapontext.bmp") );
weaponode->setMaterialFlag(EMF_LIGHTING, false);
weaponode->setFrameLoop(0, 1);
weaponode->setScale(core::vector3df(6,6,6));
weaponode->setPosition(core::vector3df(0,-52,100));
camera->setPosition(core::vector3df(-60,60,-40));
}