|
group2 0.1.0
CSE 125 Group 2
|
Dynamic-body state shared across the force, impulse, and (Phase 7+) constraint-solver paths. More...
#include <RigidBody.hpp>
Public Attributes | |
| float | invMass = 1.0f / 80.0f |
| Inverse mass. | |
| glm::mat3 | localInvInertia {0.0f} |
| Local-space inverse inertia tensor. | |
| glm::mat3 | invInertiaWorld {0.0f} |
| World-space inverse inertia tensor. | |
| glm::vec3 | forceAccum {0.0f} |
| Continuous force accumulator. Integrated as dv += F * dt * invMass. | |
| glm::vec3 | impulseAccum {0.0f} |
| Instantaneous impulse accumulator. | |
| glm::vec3 | torqueAccum {0.0f} |
| Continuous torque accumulator (Phase 7). | |
| glm::vec3 | angImpulseAccum {0.0f} |
| Instantaneous angular-impulse accumulator (Phase 7). | |
| float | linearDamping = 0.0f |
| Per-frame linear damping factor. | |
| float | angularDamping = 0.05f |
| Per-frame angular damping factor (Phase 7). | |
| bool | isAsleep = false |
| Sleep state (Phase 12). Sleeping bodies skip integration. | |
| uint16_t | sleepCounter = 0 |
| Frames since the body's energy dropped below the sleep threshold (Phase 12). | |
Dynamic-body state shared across the force, impulse, and (Phase 7+) constraint-solver paths.
Lifecycle. Accumulators (forceAccum, impulseAccum, torqueAccum, angImpulseAccum) are written by forces::apply* helpers throughout a tick, drained into velocity / angularVelocity by forces::integrateAccumulators at tick start, and then cleared.
| glm::vec3 RigidBody::angImpulseAccum {0.0f} |
Instantaneous angular-impulse accumulator (Phase 7).
| float RigidBody::angularDamping = 0.05f |
Per-frame angular damping factor (Phase 7).
| glm::vec3 RigidBody::forceAccum {0.0f} |
Continuous force accumulator. Integrated as dv += F * dt * invMass.
| glm::vec3 RigidBody::impulseAccum {0.0f} |
Instantaneous impulse accumulator.
Integrated as dv += J * invMass (no dt — impulses are pre-integrated forces).
| glm::mat3 RigidBody::invInertiaWorld {0.0f} |
World-space inverse inertia tensor.
Computed each tick by Phase 7's integration step as R * localInvInertia * R^T (where R is the body's rotation matrix). Phase 6 leaves this at identity since no rotation is integrated yet.
| float RigidBody::invMass = 1.0f / 80.0f |
Inverse mass.
0 = static / kinematic (infinite mass — applied forces have no effect). Defaults to 1 / 80 kg ≈ 0.0125 — a typical human-sized character mass.
| bool RigidBody::isAsleep = false |
Sleep state (Phase 12). Sleeping bodies skip integration.
| float RigidBody::linearDamping = 0.0f |
Per-frame linear damping factor.
velocity *= (1 - damping*dt). 0 = no damping. Useful for atmospheric drag on projectiles.
| glm::mat3 RigidBody::localInvInertia {0.0f} |
Local-space inverse inertia tensor.
Diagonal-only suffices for the box / capsule / sphere shapes we currently support; off-diagonal terms are zero. Phase 7 will refresh invInertiaWorld each frame from this and the body's orientation.
| uint16_t RigidBody::sleepCounter = 0 |
Frames since the body's energy dropped below the sleep threshold (Phase 12).
| glm::vec3 RigidBody::torqueAccum {0.0f} |
Continuous torque accumulator (Phase 7).