# Thread: [help] ghostmode math

1. ## [help] ghostmode math

yes im looking for the math that 1-key ghostmode uses. i have a function for it set up like this:
Code:
`void forward( float distance, float yaw, float pitch, int max_yaw, int max_pitch )`
its going to be for any fps, thats why i have the int max_yaw and max_pitch. thanks in advance!

2. sin cos
there you go

3. i have a feeling this requires a lot of thinking...

4. Originally Posted by kibbles18
i have a feeling this requires a lot of thinking...
learn math?

5. wehr d0 i dl mat h?

6. Originally Posted by kibbles18
wehr d0 i dl mat h?
ummm what

7. It's uber easy it's simple trig.

8. Originally Posted by Crash
It's uber easy it's simple trig.
yarr crash for CA minion

9. Code:
```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);
}```
Just a sample

10. Originally Posted by _Fk127_
Just a sample
if that works i will piss my pants

11. Originally Posted by kibbles18
if that works i will piss my pants
lol thats not the whole thing

12. 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

13. Originally Posted by ᴺᴼᴼᴮ

yarr crash for CA minion
nuuu i nid NOOB's seal OF approvel

14. #include <math.h>
god damn...

15. Originally Posted by kibbles18
what header is sinf and cosf found in?
A LITTLE PART OF ME JUST DIED INSIDE.

Page 1 of 2 12 Last