Expand description
Physics simulation — rigid bodies, constraints, collision, fluid dynamics.
This module provides a simplified 2D/3D physics simulation layer for Proof Engine. All physical objects are mathematical entities — their motion is derived from differential equations integrated via RK4.
§Subsystems
RigidBody— point masses with velocity, acceleration, forcesConstraint— distance, angle, hinge, weld constraintsCollider— circle/box/capsule shapes for broad/narrow phasePhysicsWorld— simulation driver, constraint solver, broadphaseFluidSolver— grid-based Eulerian fluid (velocity + pressure)SoftBody— mass-spring soft body meshes
All positions are in world-space float coordinates.
Re-exports§
pub use joints::Joint;pub use joints::JointType;pub use joints::Ragdoll;pub use joints::RagdollBone;pub use joints::CharacterController;pub use joints::JointSolver;pub use fluid::FluidGrid;pub use soft_body::SoftBody;
Modules§
- constraints
- XPBD + Sequential-Impulse constraint solver for 2D/3D rigid bodies.
- fluid
- Eulerian grid-based fluid simulation (velocity + pressure + density).
- fluids
- SPH fluid simulation, height-field water, buoyancy, and fluid rendering integration.
- joints
- 3D Physics joints, rigid bodies, collision detection, broadphase, ray casting, impulse resolution, and sleep system.
- rigid_
body - 2D Rigid Body Physics for Proof Engine.
- soft_
body - Mass-spring soft body simulation.
Structs§
- BodyId
- Unique body identifier.
- Contact
Manifold - Result of a collision test between two bodies.
- Physics
World - The physics simulation world.
- Rigid
Body - A simulated rigid body (treated as a point mass for simplicity).
Enums§
- Collider
- Collision shape for a body.
- Constraint
- A physical constraint between two bodies.
Functions§
- aabb_
aabb - Test AABB vs AABB (using bounding boxes).
- circle_
circle - Test circle vs circle.
- resolve_
contact - Resolve a contact manifold by applying impulses to both bodies.
- rk4_2d
- Runge-Kutta 4 for a 2D position given a force function.
- verlet_
step - Verlet integration step (position + velocity-Verlet). More accurate than Euler for conservative forces.