Advertisement
Guest User

asdfasdf

a guest
Apr 13th, 2018
534
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. public void TranslateForward(float distance)
  2. {
  3. float radiansX = VoidwalkerMath.ToDegrees(Pitch) * 0.01745329F; // X rotation
  4. float radiansY = VoidwalkerMath.ToDegrees(Yaw) * 0.01745329F; // Y rotation
  5. this.Location.X += (float)(distance * Math.Cos(radiansY) * Math.Cos(radiansX));
  6. this.Location.Y += (float)(distance * Math.Sin(radiansX));
  7. this.Location.Z += (float)(distance * Math.Sin(radiansY) * Math.Cos(radiansX));
  8. }
  9.  
  10. public void TranslateBackward(float distance)
  11. {
  12. float radiansX = VoidwalkerMath.ToDegrees(Pitch) * 0.01745329F; // X rotation
  13. float radiansY = VoidwalkerMath.ToDegrees(Yaw) * 0.01745329F; // Y rotation
  14. this.Location.X -= (float)(distance * Math.Cos(radiansY) * Math.Cos(radiansX));
  15. this.Location.Y -= (float)(distance * Math.Sin(radiansX));
  16. this.Location.Z -= (float)(distance * Math.Sin(radiansY) * Math.Cos(radiansX));
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement