RCS instanced visuals: applyForce lights negative thrust, applyForces does not #1041

Closed
opened 2026-08-13 05:07:30 +00:00 by spikerj · 1 comment
Owner

RCSVisualsInstanced.applyForce treats a thruster as visible with Math.abs(magnitude) > 0.01 and scales from |F|.

applyForces writes the same local thrusterVisibility using abs, then calls ThrusterInstanceManager.updateSpacecraftThrusters, which uses force > 0.01 (no abs) and force / 10000 for scale.

So applyForce(i, -5000) lights the instance (scale 0.85) while applyForces([-5000, …]) leaves it hidden. Any controller that issues signed RCS commands will see exhaust only on the per-thruster path.

Pinned by rcs-visuals-instanced.spec.ts ("does not light negatives (unlike applyForce)").

// applyForce
const isVisible = absMagnitude > 0.01;
const scale = isVisible ? Math.min(absMagnitude / 10000, 1) * 1.5 + 0.1 : 0;

// ThrusterInstanceManager.updateSpacecraftThrusters
const visible = force > 0.01;
const scale = visible ? Math.min(force / 10000, 1) * 1.5 + 0.1 : 0;
`RCSVisualsInstanced.applyForce` treats a thruster as visible with `Math.abs(magnitude) > 0.01` and scales from `|F|`. `applyForces` writes the same local `thrusterVisibility` using abs, then calls `ThrusterInstanceManager.updateSpacecraftThrusters`, which uses `force > 0.01` (no abs) and `force / 10000` for scale. So `applyForce(i, -5000)` lights the instance (scale 0.85) while `applyForces([-5000, …])` leaves it hidden. Any controller that issues signed RCS commands will see exhaust only on the per-thruster path. Pinned by `rcs-visuals-instanced.spec.ts` ("does not light negatives (unlike applyForce)"). ```ts // applyForce const isVisible = absMagnitude > 0.01; const scale = isVisible ? Math.min(absMagnitude / 10000, 1) * 1.5 + 0.1 : 0; // ThrusterInstanceManager.updateSpacecraftThrusters const visible = force > 0.01; const scale = visible ? Math.min(force / 10000, 1) * 1.5 + 0.1 : 0; ```
Author
Owner

Already on master. applyForces already sends Math.abs magnitudes to ThrusterInstanceManager, so negative RCS lights like applyForce. Closing.

Already on `master`. applyForces already sends Math.abs magnitudes to ThrusterInstanceManager, so negative RCS lights like applyForce. Closing.
Sign in to join this conversation.