AndrewofDoom

Untitled

Jun 27th, 2012
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. --Triggers the force rotation algorithm. rotation in RADIENS
  2. --if boolean_direction is true, rotate clockwise, if false it rotates counterclockwise.
  3. function fpo(shipName, rotate_amount, boolean_direction)
  4. ship_to_rotate = mn.Ships[shipName]
  5. local vect_rotVelMax = ship_to_rotate.Physics.RotationalVelocityMax
  6. local t = rotate_amount/vect_rotVelMax["x"] --solve for the time.
  7. if boolean_direction == true then
  8. ship_to_rotate:doManeuver(t,0,100,0,true,0,0,0,false)
  9. elseif boolean_direction == false then
  10. ship_to_rotate:doManeuver(t,0,-100,0,true,0,0,0,false)
  11. else
  12. --nothing. If somehow this is nil then it'll go here.
  13. end
  14. end
Advertisement
Add Comment
Please, Sign In to add comment