So well, my first post
my problem is that when creating an fps-cam, i need to modify the Y-position value that the cam doesnt "surf" on the surface you're normally walking on (the gravity pulls it down till the cams position is nearly the Y-Position of the ground -> you think your ingame character is not that tall at all ). How can I add an Y-Offset so that there's a small space between the ground and the cam? (maybe without writing a new camera class )
greets
gabs
FPS Camera Position Offset
Re: FPS Camera Position Offset
Hi, you could disable the gravity for the camera but honestly need more info, ie how have you setup the camera currently and if you using Irrlicht collsion animators or a physics engine.
"Hey Baby Wobbling Wobbling"
-Russell Peters
-Russell Peters
Re: FPS Camera Position Offset
If you use Irrlicht for the collision of the camera (which you can) ( mgr->createCollisionResponseAnimator() )
You can set ellipsoidRadius.
http://irrlicht.sourceforge.net/docu/cl ... 6a78f002be
Simple example:
Experiment a bit with the ellipsoidRadius values whats best for you.
You can set ellipsoidRadius.
http://irrlicht.sourceforge.net/docu/cl ... 6a78f002be
Simple example:
Code: Select all
// Create a FPS camera
irr::scene::ICameraSceneNode* camera = smgr->addCameraSceneNodeFPS();
// Set some values
irr::core::vector3df ellipsoidRadius = irr::core::vector3df(1, 1, 1);
irr::core::vector3df gravityPerSecond = irr::core::vector3df(0, -10, 0);
irr::core::vector3df ellipsoidTranslation = irr::core::vector3df(0, 0, 0);
// Your world node or your terrain mesh
irr::scene::IMeshSceneNode* terrainNode;
//Make Triangle Selector from Mesh
irr::scene::ITriangleSelector* sele = smgr->createTriangleSelector(terrainNode->getMesh(), terrainNode);
irr::scene::ISceneNodeAnimator* anim = smgr->createCollisionResponseAnimator(sele, camera, ellipsoidRadius, gravityPerSecond, ellipsoidTranslation);
//Add Animator to Camera
camera->addAnimator(anim);
//Clean
anim->drop();
sele->drop();
Re: FPS Camera Position Offset
Thanks, that's exactly what I needed