Rigid

Engine/source/T3D/rigid.h

More...

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

```void
```
```translateCenterOfMass(const Point3F & oldPos, const Point3F & newPos)
```

Public Functions

```Rigid()
```
```void
```
```applyImpulse(const Point3F & v, const Point3F & impulse)
```
```bool
```
```checkRestCondition()
```
```void
```
```clearForces()
```
```F32
```
```getKineticEnergy()
```
```void
```
```getOriginVector(const Point3F & r, Point3F * v)
```
```void
```
```getTransform(MatrixF * mat)
```
```void
```
```getVelocity(const Point3F & p, Point3F * r)
```
```F32
```
```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.

```void
```
```integrate(F32 delta)
```
```void
```
```invertObjectInertia()
```
```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
```
```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.

```void
```
```setAtRest()
```
```void
```
```setCenterOfMass(const Point3F & v)
```
```void
```
```setObjectInertia()
```

Set the rigid body moment of inertia The moment is calculated as a unit sphere.

```void
```
```setObjectInertia(const Point3F & r)
```

Set the rigid body moment of inertia The moment is calculated as a box with the given dimensions.

```void
```
```setTransform(const MatrixF & mat)
```
```void
```
```updateCenterOfMass()
```
```void
```
```updateInertialTensor()
```
```void
```
```updateVelocity()
```

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()
```