fix(physics): guard against division by zero in point gravity #144

Merged
OragonEfreet merged 1 commit from fix/physics-division-by-zero into main 2026-06-03 19:59:29 +02:00
Owner

Add checks for zero inverse_mass (infinite mass) before computing
gravitational force. Particles with infinite mass should not have
gravity forces applied to them, and division by zero inverse_mass
would cause undefined behavior.

Affects:

  • bj_apply_point_gravity_2d
  • bj_apply_point_gravity_softened_2d
Add checks for zero inverse_mass (infinite mass) before computing gravitational force. Particles with infinite mass should not have gravity forces applied to them, and division by zero inverse_mass would cause undefined behavior. Affects: - bj_apply_point_gravity_2d - bj_apply_point_gravity_softened_2d
fix(physics): guard against division by zero in point gravity
All checks were successful
Documentation / build-docs (pull_request) Successful in 8s
QA / cert (pull_request) Successful in 28s
Build and Test / linux-linux-gcc / shared (pull_request) Successful in 16s
Build and Test / linux-linux-gcc / static (pull_request) Successful in 16s
Build and Test / linux-windows-mingw / shared (pull_request) Successful in 25s
Build and Test / linux-windows-mingw / static (pull_request) Successful in 25s
03bc4ee42d
Add checks for zero inverse_mass (infinite mass) before computing
gravitational force. Particles with infinite mass should not have
gravity forces applied to them, and division by zero inverse_mass
would cause undefined behavior.

Affects:
- bj_apply_point_gravity_2d
- bj_apply_point_gravity_softened_2d
OragonEfreet added this to the 1.0 milestone 2026-06-03 17:57:12 +02:00
OragonEfreet deleted branch fix/physics-division-by-zero 2026-06-03 19:59:29 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
OragonEfreet/banjo!144
No description provided.