crouching

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
gothikal1

crouching

Post by gothikal1 »

Is it possible to crouch while using the fps cam, and if so, how would one go about it?
saigumi
Posts: 921
Joined: Fri Aug 22, 2003 11:31 am
Location: St. Louis, MO USA
Contact:

Post by saigumi »

Code: Select all

  irr::vector3df vPosition = camera->getPosition();
  vPosition.Y -= 50; // Or whatever the difference between standing and crouching
camera->setPosition(vPosition);
Then, when the person lets go of the key, raise the height again.
Crud, how do I do this again?
Guest

Post by Guest »

what about the level. I tried that and it doesn't crouch because the level is in the way
dingo
Posts: 95
Joined: Tue Mar 09, 2004 5:02 am
Location: Brisbane, Australia
Contact:

Post by dingo »

You'll need to also change the size of the player for collision purposes.

Check out the collision tut and see the point where 3 numbers defin the collision ellipsoid and just change those when crouched.

Without doing this your player is still say 6 feet tall but you are just positioning his/her eyes halfway down rather then "physically" crouching.
-= Want your C code to control real life robots? www.users.on.net/~symes =-
Post Reply