three questions todo with a FPS camera and animator. How do I...
Jump?:
Probably been asked, but it needs collision detection ect
Crouch?:
Is there a way to resize the collision sphere in an animator?(like the last one... probably been done )
Climb A ladder?:
My idea was to have a cylinder around the ladder that turns off gravity when your inside it... any ideas?
Jump... Roll... Ladder
Re: Jump... Roll... Ladder
I'd look at irr::scene::CSceneNodeAnimatorFollowSpline. You could either set up a spline for the path you want the camera to follow, or just use it as an example. Doing something really full-featured that interacts "properly" with gravity probably requires building some physics.JPulham wrote:three questions todo with a FPS camera and animator. How do I...
Jump?:
Probably been asked, but it needs collision detection ect
According to the API, irr::scene::ISceneNodeAnimatorCollisionResponse has the method setEllipsoidRadius().Crouch?:
Is there a way to resize the collision sphere in an animator?(like the last one... probably been done )
My approach to this would be to have the camera animator remap what forward and backward do when you're close to a ladder, but I've never tried it.Climb A ladder?:
My idea was to have a cylinder around the ladder that turns off gravity when your inside it... any ideas?
Jump... I'll look into it...
Crouch:
Ladder (ish):
this could also be used for Halo Style Jets if the set gravity becomes vector3<0,1,0> (very weak compared to normal gravity).
I'll get back to you with some code maybe (code snippets forum)...
Crouch:
Code: Select all
OnKeyForCrouchDown()
{
Animator->setEllipsoidRadius(vector3<16,32,16>);
}
OnKeyForCrouchUp()
{
Animator->setEllipsoidRadius(vector3<16,64,16>);
}
Code: Select all
if(collision)
{
Animator->setGravity(vector3<0,0,0>);
}
if(!collision & Animator->getGravity() == vector3<0,0,0> )
{
Animator->setGravity(vector3<0,-4,0>);
}
I'll get back to you with some code maybe (code snippets forum)...
pushpork