coastline 0.0.4
Loading...
Searching...
No Matches
RigidBody Struct Reference

A rigid body: the body of a vehicle or of one of its wheels. More...

#include <rigidbody.h>

Collaboration diagram for RigidBody:

Public Attributes

u32 unreconstructed0
struct RigidBody * wheels [4]
u32 unreconstructed14
RigidBodyForce * forces
s32 kind
Vec3f size
f32 mass
f32 inertia [3][3]
f32 inverseInertia [3][3]
RigidBodyState state
f32 orientation [4][4]
Vec3f force
Vec3f torque
RigidBodyState stepStates [2]
struct TrackTriangle * ground
u8 surface
union { 
   Vec3f   groundNormal 
   f32   groundNormalComponents [3] 
}; 
f32 groundOffset
s32 contactFrames
f32 springRate
f32 damping
f32 steerAngle
f32 spinRate
f32 radius
f32 drive
f32 brake
f32 rollAngle
f32 suspension
Vec3f boxSize
f32 boxCenterZ
Vec3f impactPoint
s32 uprightFrames
u8 impactSpeed
u8 tireType
u8 vehicleImpactVolume
u8 impactVolume
u8 framesSinceImpact
u8 framesSinceVehicleImpact
u8 unreconstructed202
u8 landed
u8 skidding

Detailed Description

A rigid body: the body of a vehicle or of one of its wheels.

A wheel uses the ground, steering, spin and suspension fields, the body of a vehicle the springs, box and collision fields.

Member Data Documentation

◆ unreconstructed0

u32 RigidBody::unreconstructed0

Of unknown use; cleared on setup.

◆ wheels

struct RigidBody* RigidBody::wheels[4]

The wheel bodies of the body of a vehicle, the rear two first and the front two after.

◆ unreconstructed14

u32 RigidBody::unreconstructed14

Of unknown use; cleared on setup.

◆ forces

RigidBodyForce* RigidBody::forces

The list of forces applied at each step.

◆ kind

s32 RigidBody::kind

The kind of body, a RIGID_BODY_ value.

◆ size

Vec3f RigidBody::size

The sides of the box the inertia is computed from.

◆ mass

f32 RigidBody::mass

The mass, 1000 for the body of a vehicle and 0 for a wheel.

◆ inertia

f32 RigidBody::inertia[3][3]

The inertia tensor in the frame of the body.

◆ inverseInertia

f32 RigidBody::inverseInertia[3][3]

The inverse inertia tensor; setup computes only its diagonal.

◆ state

RigidBodyState RigidBody::state

The motion of the body at the current step.

◆ orientation

f32 RigidBody::orientation[4][4]

The matrix of the orientation and position of the state.

◆ force

Vec3f RigidBody::force

The sum of the forces of a step, then the linear acceleration it gives.

◆ torque

Vec3f RigidBody::torque

The sum of the torques of a step, then the angular acceleration it gives.

◆ stepStates

RigidBodyState RigidBody::stepStates[2]

The states of the steps of the integration.

◆ ground

struct TrackTriangle* RigidBody::ground

The triangle of the track under a wheel, or NULL.

◆ surface

u8 RigidBody::surface

The surface of the ground triangle, a TRACK_SURFACE_ value.

◆ groundNormal

Vec3f RigidBody::groundNormal

The normal of the plane of the ground triangle.

◆ groundNormalComponents

f32 RigidBody::groundNormalComponents[3]

The normal components for indexed wheel physics.

◆ [union]

union { ... } RigidBody

◆ groundOffset

f32 RigidBody::groundOffset

The offset of the plane of the ground triangle along its normal.

◆ contactFrames

s32 RigidBody::contactFrames

The frames a wheel has touched the ground, up to 100, or 0 off the ground.

◆ springRate

f32 RigidBody::springRate

The rate of the suspension springs of the body of a vehicle, (4 times the suspension stiffness plus 20) times 16000.

◆ damping

f32 RigidBody::damping

The damping of the suspension of the body of a vehicle, -3000.

◆ steerAngle

f32 RigidBody::steerAngle

The angle a front wheel is steered to, in radians.

◆ spinRate

f32 RigidBody::spinRate

How fast a wheel spins, in radians a second.

◆ radius

f32 RigidBody::radius

The radius of a wheel, 0.5 from setup.

◆ drive

f32 RigidBody::drive

The drive the throttle gives a wheel.

◆ brake

f32 RigidBody::brake

The braking of a wheel.

◆ rollAngle

f32 RigidBody::rollAngle

How far a wheel has turned, in degrees; how far the body of a vehicle leans in a skid.

◆ suspension

f32 RigidBody::suspension

How far below the body of a vehicle the ground is under a wheel.

◆ boxSize

Vec3f RigidBody::boxSize

The box of the body of a vehicle the track collides with.

◆ boxCenterZ

f32 RigidBody::boxCenterZ

The height of the middle of the collision box.

◆ impactPoint

Vec3f RigidBody::impactPoint

Where the last hard hit was.

◆ uprightFrames

s32 RigidBody::uprightFrames

35 while the vehicle is upright, then counting down each step it is upside down.

◆ impactSpeed

u8 RigidBody::impactSpeed

The recorded speed of the last hit.

◆ tireType

u8 RigidBody::tireType

The tyres of the car, from 1; a higher type has less grip.

◆ vehicleImpactVolume

u8 RigidBody::vehicleImpactVolume

The loudest hit of another vehicle since the sounds played.

◆ impactVolume

u8 RigidBody::impactVolume

The loudest hit of the track since the sounds played.

◆ framesSinceImpact

u8 RigidBody::framesSinceImpact

The steps since the track was hit, up to 40.

◆ framesSinceVehicleImpact

u8 RigidBody::framesSinceVehicleImpact

The steps since another vehicle was hit.

◆ unreconstructed202

u8 RigidBody::unreconstructed202

Of unknown use; the vehicle sounds clear it while no effect other than a skid or a roll plays.

◆ landed

u8 RigidBody::landed

Set to 0x80 when a wheel lands, then cleared when the sound plays.

◆ skidding

u8 RigidBody::skidding

Set to 0x80 when the tyres skid.


The documentation for this struct was generated from the following file: