Code: Select all
//get a mesh from name
IMesh* roommesh = smgr->getMesh(roommesh_name.c_str())->getMesh(0);
ITriangleSelector* selector = smgr->createOctTreeTriangleSelector( roommesh,roommesh_node,128);
roommesh_node->setTriangleSelector(selector);
selector->drop();
}
}
//camera( in the scene)
ICameraSceneNode* cam = (ICameraSceneNode*)smgr->getSceneNodeFromName("cam_player");
//camera
ICameraSceneNode* cam1 = smgr->addCameraSceneNodeFPS();
cam1->setPosition(vector3df(0.0f,0.0f,100.0f));
ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(selector,cam1,vector3df(30,50,30),
vector3df(0,-3,0),//(o,-3,0)
vector3df(0,50,0));
cam1->addAnimator(anim);
anim->drop();
Ken