Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void TranslateForward(float distance)
- {
- float radiansX = VoidwalkerMath.ToDegrees(Pitch) * 0.01745329F; // X rotation
- float radiansY = VoidwalkerMath.ToDegrees(Yaw) * 0.01745329F; // Y rotation
- this.Location.X += (float)(distance * Math.Cos(radiansY) * Math.Cos(radiansX));
- this.Location.Y += (float)(distance * Math.Sin(radiansX));
- this.Location.Z += (float)(distance * Math.Sin(radiansY) * Math.Cos(radiansX));
- }
- public void TranslateBackward(float distance)
- {
- float radiansX = VoidwalkerMath.ToDegrees(Pitch) * 0.01745329F; // X rotation
- float radiansY = VoidwalkerMath.ToDegrees(Yaw) * 0.01745329F; // Y rotation
- this.Location.X -= (float)(distance * Math.Cos(radiansY) * Math.Cos(radiansX));
- this.Location.Y -= (float)(distance * Math.Sin(radiansX));
- this.Location.Z -= (float)(distance * Math.Sin(radiansY) * Math.Cos(radiansX));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement