i am using an FPS camera, and when i run my app, the camera continually rotates upward, and will not stay still.
here is the code for my Camera class:
Code: Select all
#include "Camera.hh"
#include "IrrManager.hh"
using namespace irr;
Camera::Camera()
{
scene::ISceneManager* smgr = IrrManager::get()->getSceneManager();
node = smgr->addCameraSceneNodeFPS( 0, 100.0, 500.0 );
node->setParent( smgr->getRootSceneNode() );
node->setFarValue( 12000.0 );
node->setUpVector( core::vector3df( 0.0, 1.0, 0.0 ) );
}
void Camera::setPosition( core::vector3df position )
{
node->setPosition( position );
}
void Camera::setTarget( core::vector3df target )
{
node->setTarget( target );
}
void Camera::setParent( scene::ISceneNode* parent )
{
node->setParent( parent );
}
core::vector3df Camera::getPosition()
{
return node->getPosition();
}
core::vector3df Camera::getTarget()
{
return node->getTarget();
}
scene::ISceneNode* Camera::getParent()
{
return node->getParent();
}
scene::ICameraSceneNode* Camera::getCameraNode()
{
return node;
}
Code: Select all
// Add camera
camera = new Camera();
camera->setPosition( core::vector3df( 1900*2, 255*2, 3700*2 ) );
camera->setTarget( core::vector3df( 2397*2, 343*2, 2700*2 ) );
has anyone seen this problem?