(C++) Sin / Cos, directions and all that trig stuff

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Zeuss
Posts: 114
Joined: Mon Nov 08, 2004 9:02 pm
Location: Canberra - Australia
Contact:

Post by Zeuss »

no worries, this should just about do it.

dt is the time between 2 frames, this is to keep movement consistant. You dont have to use it, but it is adviseable.

Code: Select all


On Button W Press....


   matrix4 Mat = cam->getRelativeTransformation();

   core::vector3df Forwards   (Mat.M[0], Mat.M[1], Mat.M[2] ); 

   cam->setPosition(cam->getPosition() + (Forwards * dt ));

Help make Irrlicht even Better! Create and submit your own Irrlicht Extension
Want a Games Education? Try The Academy of Interactive Entertainment
Post Reply