Guest User

Untitled

a guest
Jan 20th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. if time > 180 //ends after 180 seconds elapse
  2. {
  3. exit(0);
  4. }
  5.  
  6. else if (at('M')) //ends if one of two SPHERES are at station
  7. {
  8. exit(0);
  9. }
  10. float target[3];
  11. float diff[3];
  12. else //otherwise shoot at earth
  13. {
  14. target[0] = 0;
  15. target[1] = 1;
  16. //target[2] = 0;
  17. ZRSetPositionTarget(target);
  18. int a;
  19. for(a = 0;a <2 ;a++)
  20. {
  21. diff[a] = target[a] - myState[a];
  22. }
  23. ZRSetAttitudeTarget(mathVecNormalize(diff,2))
  24. while abs(diff[0])> .05) && abs(diff[1]) > .05)
  25. {
  26. int a;
  27. for(a = 0;a <2 ;a++)
  28. {
  29. diff[a] = target[a] - myState[a];
  30. }
  31. ZRSetAttitudeTarget(mathVecNormalize(diff,2))
  32. ZRSetVectorTarget([(diff[0],diff[1],0])
  33. }
  34.  
  35.  
  36. }
Add Comment
Please, Sign In to add comment