when i try to rotate a mesh, it simply doesn't rotate
this is the code :
Code: Select all
void addTunnelMesh(systemRoot *root,const irr::c8 *fname,core::vector3df pos,core::vector3df rot,core::vector3df scale)
{
scene::IAnimatedMesh* levelmesh=root->vsmgr->getMesh(fname);
if(levelmesh)
{
root->vsmgr->getMeshManipulator()->makePlanarTextureMapping(levelmesh->getMesh(0),1.0f);
//scene::IAnimatedMeshSceneNode* level=device->getSceneManager()->addAnimatedMeshSceneNode(levelmesh);
scene::ISceneNode* level=root->vsmgr->addMeshSceneNode(levelmesh->getMesh(0));
level->setScale(scale);
level->setPosition(pos);
level->setRotation(rot);
std::cout<<level->getRotation().X<<" "<<level->getRotation().Y<<" "<<level->getRotation().Z<<" "<<std::endl;
level->getMaterial(0).setFlag(video::EMF_LIGHTING,false);
level->getMaterial(0).setFlag(video::EMF_NORMALIZE_NORMALS,true);
level->getMaterial(0).setFlag(video::EMF_BACK_FACE_CULLING,false);
level->getMaterial(0).setFlag(video::EMF_ANISOTROPIC_FILTER,true);
level->getMaterial(0).setTexture(0,root->vdriver->getTexture("tex.bmp"));
NxActor* level_actor=root->CreateTriMesh(levelmesh->getMesh(0),"t1.pmap",32,pos,scale,0);
Nodes.push_back(new EntNode(level_actor,level,1));
}
}
Code: Select all
addTunnelMesh(root,"tp1.3ds",core::vector3df(0,0,4),core::vector3df(25,25,0),core::vector3df(1,1,1));