Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if time > 180 //ends after 180 seconds elapse
- {
- exit(0);
- }
- else if (at('M')) //ends if one of two SPHERES are at station
- {
- exit(0);
- }
- float target[3];
- float diff[3];
- else //otherwise shoot at earth
- {
- target[0] = 0;
- target[1] = 1;
- //target[2] = 0;
- ZRSetPositionTarget(target);
- int a;
- for(a = 0;a <2 ;a++)
- {
- diff[a] = target[a] - myState[a];
- }
- ZRSetAttitudeTarget(mathVecNormalize(diff,2))
- while abs(diff[0])> .05) && abs(diff[1]) > .05)
- {
- int a;
- for(a = 0;a <2 ;a++)
- {
- diff[a] = target[a] - myState[a];
- }
- ZRSetAttitudeTarget(mathVecNormalize(diff,2))
- ZRSetVectorTarget([(diff[0],diff[1],0])
- }
- }
Add Comment
Please, Sign In to add comment