Page 1 of 1

Changing the height of a FPS camera

Posted: Wed Aug 24, 2005 9:05 am
by Guest
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 :cry:

Posted: Wed Aug 24, 2005 9:30 am
by WToma
Not sure what is your problem. If you're using a addCameraSceneNodeFPS then you can simply use the setPosition method of your ICameraSceneNode (which is an ISceneNode).
Toma

Posted: Wed Aug 24, 2005 9:47 am
by MikeR
scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
camera->setPosition(core::vector3df(-50,50,-150));

Posted: Wed Aug 24, 2005 11:34 am
by Guest
I have added a test collision and the camera doesn't stay at the initial position, it "falls" on the ground of my map :

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
   }
(...)
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.

Posted: Wed Aug 24, 2005 12:28 pm
by bitplane
read through tutorial 7 carefully, specificly the bit that says
...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...
[/quote]

Posted: Wed Aug 24, 2005 1:17 pm
by Guest
Thank you bitplane. The solution was in createCollisionResponseAnimator() .
Thanks to you, I'm a big big girl in a big big world :P