Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- complex directionToThrust = next.l - myPod.l;
- if (myPod.getV() != complex(0.0f,0.0f)) {
- nextCheckpointAngle = arg(myPod.getV()) - arg(directionToThrust);
- } else {
- nextCheckpointAngle *= TO_RADIAN;
- }
- while(nextCheckpointAngle > PI){
- nextCheckpointAngle-=2*PI;
- }
- while(nextCheckpointAngle < -PI){
- nextCheckpointAngle+=2*PI;
- }
- if(abs(nextCheckpointAngle) > PI/2){
- // myPod.move(myPod.l + directionToThrust, 100);
- }
- if(abs(nextCheckpointAngle)<2*PI/3) {
- directionToThrust *= polar(1.0f, -nextCheckpointAngle / 2);
- }
- cerr << arg(directionToThrust);
- if (nextCheckpointDist > 5000 && abs(nextCheckpointAngle) < PI/6) {
- myPod.boost(next.l);
- }
- myPod.move(myPod.l + directionToThrust, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement