Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. cameraOrientation = cameraOrientation * framePitch * frameYaw;
  2.  
  3. cameraOrientation = framePitch * cameraOrientation * frameYaw;
  4.  
  5. currentDirection * newRotation;
  6.  
  7. newRotation * currentDirection;
  8.  
  9. if (keyboard.IsKeyDown(Keys.Up))
  10. Direction = Direction * Quaternion.CreateFromAxisAngle(new Vector3(1, 0, 0), TurnSpeed);
  11. if (keyboard.IsKeyDown(Keys.Down))
  12. Direction = Direction * Quaternion.CreateFromAxisAngle(new Vector3(-1, 0, 0), TurnSpeed);
  13. if (keyboard.IsKeyDown(Keys.Left))
  14. Direction = Quaternion.CreateFromAxisAngle(new Vector3(0, 0, 1), TurnSpeed) * Direction;
  15. if (keyboard.IsKeyDown(Keys.Right))
  16. Direction = Quaternion.CreateFromAxisAngle(new Vector3(0, 0, -1), TurnSpeed) * Direction;
  17.  
  18. playerCameraHolder.transform.Rotate(0, rotationYaw, 0);
  19. playerCamera.transform.Rotate(rotationPitch, 0, 0);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement