Rigid
Public Attributes
Angular momentum.
Current rotation.
Angular velocity.
bool
Center of mass in object space.
Inverse moment of inertia.
Inverse moment of inertia in world space.
Linear momentum.
Current position.
Linear velocity.
Moment of inertia.
1 / mass
Collision restitution.
CofM in world space.
Public Functions
Rigid()
bool
getOriginVector(const Point3F & r, Point3F * v)
getTransform(MatrixF * mat)
getVelocity(const Point3F & p, Point3F * r)
getZeroImpulse(const Point3F & r, const Point3F & normal)
Calculate the inertia along the given vector This function can be used to calculate the amount of force needed to affect a change in velocity along the specified normal applied at the given point.
bool
resolveCollision(const Point3F & p, const Point3F & normal)
Resolve collision with an immovable object Computes & applies the collision impulse needed to keep the body from penetrating the given surface.
bool
setCenterOfMass(const Point3F & v)
Set the rigid body moment of inertia The moment is calculated as a unit sphere.
setObjectInertia(const Point3F & r)
Set the rigid body moment of inertia The moment is calculated as a box with the given dimensions.
setTransform(const MatrixF & mat)
Detailed Description
Public Attributes
Point3F angMomentum
Angular momentum.
QuatF angPosition
Current rotation.
Point3F angVelocity
Angular velocity.
bool atRest
Point3F centerOfMass
Center of mass in object space.
Point3F force
F32 friction
Friction coefficient.
MatrixF invObjectInertia
Inverse moment of inertia.
MatrixF invWorldInertia
Inverse moment of inertia in world space.
Point3F linMomentum
Linear momentum.
Point3F linPosition
Current position.
Point3F linVelocity
Linear velocity.
F32 mass
Rigid body mass.
MatrixF objectInertia
Moment of inertia.
F32 oneOverMass
1 / mass
F32 restitution
Collision restitution.
Point3F torque
Point3F worldCenterOfMass
CofM in world space.
Private Functions
translateCenterOfMass(const Point3F & oldPos, const Point3F & newPos)
Public Functions
Rigid()
applyImpulse(const Point3F & v, const Point3F & impulse)
checkRestCondition()
clearForces()
getKineticEnergy()
getOriginVector(const Point3F & r, Point3F * v)
getTransform(MatrixF * mat)
getVelocity(const Point3F & p, Point3F * r)
getZeroImpulse(const Point3F & r, const Point3F & normal)
Calculate the inertia along the given vector This function can be used to calculate the amount of force needed to affect a change in velocity along the specified normal applied at the given point.
integrate(F32 delta)
invertObjectInertia()
resolveCollision(const Point3F & p, const Point3F & normal)
Resolve collision with an immovable object Computes & applies the collision impulse needed to keep the body from penetrating the given surface.
resolveCollision(const Point3F & p, const Point3F & normal, Rigid * )
Resolve collision with another rigid body Computes & applies the collision impulses needed to keep the bodies from interpenetrating.
tg: This function was commented out... I uncommented it, but haven't double checked the math.
setAtRest()
setCenterOfMass(const Point3F & v)
setObjectInertia()
Set the rigid body moment of inertia The moment is calculated as a unit sphere.
setObjectInertia(const Point3F & r)
Set the rigid body moment of inertia The moment is calculated as a box with the given dimensions.
setTransform(const MatrixF & mat)
updateCenterOfMass()
updateInertialTensor()
updateVelocity()