sin cos
there you go
yes im looking for the math that 1-key ghostmode uses. i have a function for it set up like this:
its going to be for any fps, thats why i have the int max_yaw and max_pitch. thanks in advance!Code:void forward( float distance, float yaw, float pitch, int max_yaw, int max_pitch )
i have a feeling this requires a lot of thinking...
wehr d0 i dl mat h?
It's uber easy it's simple trig.
Just a sampleCode:if (forward || backward) { float sign = (forward ? 1.0f : -1.0f); Posx += sign * 20.0f * sinf(Yaw); Posy += sign * 20.0f * sinf(-Pitch); Posz += sign * 20.0f * cosf(Yaw); }
what header is sinf and cosf found in?
yeah i know its not the whole thing. i just need to add my X Y Z pointers in place of the posx posy posz, and define forward/backward
Last edited by kibbles18; 04-24-2011 at 06:04 PM.