mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Fix for the fcs
This commit is contained in:
parent
09461d94ef
commit
b20f3e5b81
@ -58,12 +58,13 @@ double traceBullet(double initSpeed, double airFriction, double angle, double an
|
||||
while (i < MAXITERATIONS) {
|
||||
lastPosX = posX;
|
||||
lastPosY = posY;
|
||||
simulationStep = 0.1 - 0.049 * (posX / posTargetX);
|
||||
velMag = sqrt(pow(velX, 2) + pow(velY, 2));
|
||||
posX += velX * simulationStep * 0.5;
|
||||
posY += velY * simulationStep * 0.5;
|
||||
velX += simulationStep * (velX * velMag * airFriction);
|
||||
velY += simulationStep * (velY * velMag * airFriction - 9.81);
|
||||
posX += velX * simulationStep;
|
||||
posY += velY * simulationStep;
|
||||
velY += simulationStep * (velY * velMag * airFriction - 9.80665);
|
||||
posX += velX * simulationStep * 0.5;
|
||||
posY += velY * simulationStep * 0.5;
|
||||
if (posX >= posTargetX) { break; }
|
||||
i++;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user