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.
YankzzDev
Posts: 23 Joined: Wed Oct 05, 2011 4:37 am
Location: Indonesia
Post
by YankzzDev » Fri Nov 04, 2011 4:00 am
how to make a First Person Camera like addCameraSceneNodeFPS? i don't want to use addCameraSceneNodeFPS... but i want a use addCameraSceneNode...
below is my sample code
Code: Select all
void MainWindow::mouseMoveEvent( QMouseEvent * event )
{
ISceneManager *smgr = this->getIrrlichtWidget()->getIrrlichtDevice()->getSceneManager();
scene::ICameraSceneNode* cameraview = smgr->getActiveCamera();
vector3df Rot= cameraview->getRotation();
Rot.Y = Rot.Y + (event->y() - globalMouseY);
Rot.X = Rot.X + (event->x() - globalMouseX);
cameraview->bindTargetAndRotation(true);
cameraview->setTarget(cameraview->getAbsolutePosition());
cameraview->setRotation(Rot);
}
but it not like or same in the addCameraSceneNodeFPS...
how to solve it..
Nobody is Perfect!!
CuteAlien
Admin
Posts: 9930 Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:
Post
by CuteAlien » Fri Nov 04, 2011 9:20 am
Please use the search-function of the forum, there have been several first-person-cam implementations in the past.
But one way is to create your own class derived from ISceneNodeAnimator class, makes sure isEventReceiverEnabled () returns true and add that to your camera.