fix mutually canceling orbits

This commit is contained in:
2026-06-17 20:50:31 +02:00
parent 0cf3d64983
commit e0e11b7933
6 changed files with 54 additions and 11 deletions

View File

@@ -52,8 +52,9 @@ void MovementIntentSystem::tick(EntityAdmin& admin)
QVector2D destination = intent.target;
if (intent.orbitRadius_tiles > 0.0f)
{
const float sign = OrbitMath::resolveOrbitSign(pos.value, intent.target,
body.velocity_tpt);
const float sign = OrbitMath::resolveOrbitSign(
pos.value, intent.target, body.velocity_tpt,
intent.orbitCenterVelocity_tpt);
destination = OrbitMath::computeOrbitDestination(
pos.value, intent.target, intent.orbitRadius_tiles, sign);
}