I'd like to know how to re-create the FPS camera without using the existing fpscamera supplied with irrlicht. The reason for this is because I want to be able to control the event reciever on my own.
How does the rotation part work? setting the direction of the camera only takes a vector.. how would I go about creating a direction vector from a X & Y degree?
FPS camera without using FPScamera...
The simplest way, I think, is to copy the code of FPS camera and just change the event receiver part.
If you want to create a direction vector, you can do as the following:
let alpha be the angle around y axis and let beta be the angle around x axis. We use degrees as unit, because most irrlicht functions use degrees, too. Then you can create your direction vector:
Toma
If you want to create a direction vector, you can do as the following:
let alpha be the angle around y axis and let beta be the angle around x axis. We use degrees as unit, because most irrlicht functions use degrees, too. Then you can create your direction vector:
Code: Select all
//first, we convert the angles into radians
float alpha_rad=(alpha/180.0f)*M_PI;
float beta_rad=(beta/180.0f)*M_PI;
direction_vector=core::vector3df(cos(alpha_rad), sin(beta_rad), sin(alpha_rad));
"This is not a bug, this is a feature!"
Have a look at my 2nd post in this thread:
http://irrlicht.sourceforge.net/phpBB2/ ... 0ec26bc26e
Maybe this could help you...
http://irrlicht.sourceforge.net/phpBB2/ ... 0ec26bc26e
Maybe this could help you...
while(!asleep) sheep++;
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
IrrExtensions:
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
-
- Posts: 98
- Joined: Mon Dec 13, 2004 11:47 am
- Location: Japan
If you want the built-in FPS camera and also to control the event receiver, rig up your own receiver as described in the tutorials, but return false instead of true if it's a camera event. This tells Irrlicht that you haven't dealt with the event yourself and so it will be passed to the default event receiver and therefore picked up by your FPS camera.