An Fps Camera and MastEventReceiver...

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
Iyad
Posts: 140
Joined: Sat Mar 07, 2009 1:18 am
Location: Montreal, Canada

An Fps Camera and MastEventReceiver...

Post by Iyad »

(POST REMOVED BY IYAD)
Last edited by Iyad on Fri Mar 04, 2011 10:18 pm, edited 3 times in total.
#include <Iyad.h>
christianclavet
Posts: 1638
Joined: Mon Apr 30, 2007 3:24 am
Location: Montreal, CANADA
Contact:

Post by christianclavet »

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.
nzervu
Posts: 17
Joined: Tue Oct 21, 2008 7:44 pm

Post by nzervu »

thank you for the snippet
Frank Dodd
Posts: 208
Joined: Sun Apr 02, 2006 9:20 pm

Post by Frank Dodd »

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);
Post Reply