Changing the height of a FPS camera
Changing the height of a FPS camera
I have imported a BSP map in an irrlicht scene but the player is too low ! I cannot resize my map from my editor. Please, help me me, I'm feel so little in my (too big) world
I have added a test collision and the camera doesn't stay at the initial position, it "falls" on the ground of my map :
But the camera (the player) stays above a certain distance of the ground. I don't found where this height can be modified. It's not in the setPosition function.
Code: Select all
(...)
ISceneManager* smgr = device->getSceneManager();
device->getFileSystem()->addZipFileArchive("common.zip");//texture file like pk3
IAnimatedMesh* mesh = smgr->getMesh("green.bsp");
ISceneNode* node = 0;
ITriangleSelector* selector = 0;
if (mesh)
node = smgr->addOctTreeSceneNode(mesh->getMesh(0));
if (node)
{
node->setPosition(vector3df(0,0,0));
// make solid the map. If not, we pass through the objects of the scene
selector = smgr->createOctTreeTriangleSelector(mesh->getMesh(0), node, 128);
node->setTriangleSelector(selector);
selector->drop();
smgr->addCameraSceneNodeFPS(0,90.0f,250.0f);
camera->setPosition(vector3df(150,1500,0)); //or (150, 0,0), idem
}
(...)
read through tutorial 7 carefully, specificly the bit that says
[/quote]...createCollisionResponseAnimator()...<snip>...And the last value is just a translation: Without this, the ellipsoid with which collision detection is done would be around the camera, and the camera would be in the middle of the ellipsoid. But as human beings, we are used to have our eyes on top of the body, with which we collide with our world, not in the middle of it...