Changing the height of a FPS camera

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Guest

Changing the height of a FPS camera

Post 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:
WToma
Posts: 70
Joined: Tue Aug 09, 2005 8:38 am
Location: Szeged, Hungary

Post 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
"This is not a bug, this is a feature!"
MikeR
Posts: 767
Joined: Sun Dec 26, 2004 4:03 pm
Location: Northern California USA
Contact:

Post by MikeR »

scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
camera->setPosition(core::vector3df(-50,50,-150));
If it exists in the real world, it can be created in 3d

Sys specs:
AMD 3700+ 64 processor
1.0 gb ram
e-Geforce 6600 graphics 256 mb onboard ram
Guest

Post 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.
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Post 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]
Guest

Post 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
Post Reply