Advanced Ballistics - Improved spin drift calculation (#4755)

This commit is contained in:
ulteq 2016-12-09 20:22:53 +01:00 committed by PabstMirror
parent 0b854a6077
commit 8afc4083d0
2 changed files with 3 additions and 1 deletions

Binary file not shown.

View File

@ -681,7 +681,9 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function)
if (TOF > 0) { if (TOF > 0) {
double bulletDir = atan2(velocity[0], velocity[1]); double bulletDir = atan2(velocity[0], velocity[1]);
double spinAccel = bulletDatabase[index].twistDirection * (0.0482251 * (bulletDatabase[index].stabilityFactor + 1.2)) / pow(TOF, 0.17); double r1 = pow(TOF - deltaT, 0.17);
double r2 = pow(TOF, 0.17);
double spinAccel = bulletDatabase[index].twistDirection * (0.0482251 * (bulletDatabase[index].stabilityFactor + 1.2)) / ((r1 + r2) / 2.0f);
velocityOffset[0] += sin(bulletDir + M_PI / 2) * spinAccel * deltaT; velocityOffset[0] += sin(bulletDir + M_PI / 2) * spinAccel * deltaT;
velocityOffset[1] += cos(bulletDir + M_PI / 2) * spinAccel * deltaT; velocityOffset[1] += cos(bulletDir + M_PI / 2) * spinAccel * deltaT;
} }