Emulate CameraSceneNodeFPS mouse look using CameraSceneNode?

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
denzelbro
Posts: 50
Joined: Wed Jun 27, 2018 11:53 pm

Emulate CameraSceneNodeFPS mouse look using CameraSceneNode?

Post by denzelbro »

It seems this was asked before in some form, but searching other related topics I can't find a clear answer and maybe this one is a specific case so I would like to find out how do you emulate the mouse look feature of AddCameraSceneNodeFPS with just using the AddCameraSceneNode?
CuteAlien
Admin
Posts: 9647
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Emulate CameraSceneNodeFPS mouse look using CameraSceneN

Post by CuteAlien »

If you check the code of source/Irrlicht/CSceneNodeAnimatorCameraFPS.cpp/.h then you can see how the camera is animated for the FPS camera. Copy out the parts you need and add your own animator to the camera. Note that you can also disable input or even remove animators - then the fps-camera gets back to being a normal camera.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
denzelbro
Posts: 50
Joined: Wed Jun 27, 2018 11:53 pm

Re: Emulate CameraSceneNodeFPS mouse look using CameraSceneN

Post by denzelbro »

CuteAlien wrote:If you check the code of source/Irrlicht/CSceneNodeAnimatorCameraFPS.cpp/.h then you can see how the camera is animated for the FPS camera. Copy out the parts you need and add your own animator to the camera. Note that you can also disable input or even remove animators - then the fps-camera gets back to being a normal camera.
Thanks CuteAlien, I think I'll do some experimentation with this one since I was just testing some old snippet that I need which uses this setup (actually it uses mouse velocity to turn and respond). I also did a bit of searching and found out that it is sort of a struggle to get this to work with Irrlicht even for bigger projects.. https://github.com/minetest/minetest/issues/3756
Post Reply