An Fps Camera and MastEventReceiver...
An Fps Camera and MastEventReceiver...
(POST REMOVED BY IYAD)
Last edited by Iyad on Fri Mar 04, 2011 10:18 pm, edited 3 times in total.
#include <Iyad.h>
-
- Posts: 1638
- Joined: Mon Apr 30, 2007 3:24 am
- Location: Montreal, CANADA
- Contact:
Hi, Used a sine wave to put an offset on the UP/Down position of my cam. Would simulate the "walk".
But you'll need to put a multiplier on the sine based on the velocity of the camera since your "legs" would move faster when you are running and slower as your are walking.
Another problem, is collisions. You'll need to stop it when your velocity as reached 0. (not fixed this yet on my own FPS cam)
I think you can find the velocity by taking the position from the previous frame by offsetting with the current frame.
But you'll need to put a multiplier on the sine based on the velocity of the camera since your "legs" would move faster when you are running and slower as your are walking.
Another problem, is collisions. You'll need to stop it when your velocity as reached 0. (not fixed this yet on my own FPS cam)
I think you can find the velocity by taking the position from the previous frame by offsetting with the current frame.
-
- Posts: 208
- Joined: Sun Apr 02, 2006 9:20 pm
You can pass your events onto the fps camera, this is one thing I do in my Freebasic IrrlichtWrapper
Code: Select all
// pass on the key event to the active camera
activeCamera = smgr->getActiveCamera();
if ( activeCamera )
activeCamera->OnEvent(event);