summaryrefslogtreecommitdiffstats
path: root/src/atragmx.c
diff options
context:
space:
mode:
authorhybrid <hybrid@hybridlabs.pro>2026-07-18 11:44:43 +0300
committerhybrid <hybrid@hybridlabs.pro>2026-07-18 11:44:43 +0300
commit17eaf66bb7713378b95cce0fccd2cf32bde213a6 (patch)
treed5a0d7221c6976ab7dbdd6a53e04d47208ac83ac /src/atragmx.c
parent2cff971b86fdd0f53014d302d66c83cd5a6088c5 (diff)
downloada3catragmx-17eaf66bb7713378b95cce0fccd2cf32bde213a6.tar.gz
a3catragmx-17eaf66bb7713378b95cce0fccd2cf32bde213a6.tar.bz2
a3catragmx-17eaf66bb7713378b95cce0fccd2cf32bde213a6.zip
add: tmp
Diffstat (limited to 'src/atragmx.c')
-rw-r--r--src/atragmx.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/atragmx.c b/src/atragmx.c
index ff684c3..c9cebae 100644
--- a/src/atragmx.c
+++ b/src/atragmx.c
@@ -128,17 +128,28 @@ ATragMXSolution *ATragMXCalcSolution(ATragMXContext *ctx, ace_config *ace) {
// calculate magnitude of bullet.velocity
bullet.speed = hypot(bullet.velocity[0],
hypot(bullet.velocity[1], bullet.velocity[2]));
+
memcpy(local_solution.true_velocity,
(double[3]){bullet.velocity[0] - wind1[0],
bullet.velocity[1] - wind1[1],
bullet.velocity[2] - wind1[2]},
sizeof(local_solution.true_velocity));
+
local_solution.true_speed = hypot(local_solution.true_velocity[0],
hypot(local_solution.true_velocity[1],
local_solution.true_velocity[2]));
- if (ace->ballistics->enabled)
-
+ if (ace->ballistics->enabled) {
+ double data = retard(ctx->gun.drag_model,
+ ctx->gun.ballistic_coef,
+ ctx->gun.muzzle_velocity,
+ ctx->atmosphere.temperature);
+ memcpy(bullet.accel,
+ (double[3]){bullet.accel[0] != 0 ? -data : 0,
+ bullet.accel[1] != 0 ? -data : 0,
+ bullet.accel[2] != 0 ? -data : 0},
+
+ }
}
return sln;