Box3D 0.1.0
A 3D physics engine for games
Loading...
Searching...
No Matches

The wheel joint can be used to simulate wheels on vehicles. More...

Collaboration diagram for Wheel Joint:

Data Structures

struct  b3WheelJointDef
 Wheel joint definition Body A is the chassis and body B is the wheel. More...

Functions

b3JointId b3CreateWheelJoint (b3WorldId worldId, const b3WheelJointDef *def)
 Create a wheel joint.
void b3WheelJoint_EnableSuspension (b3JointId jointId, bool flag)
 Enable/disable the wheel joint spring.
bool b3WheelJoint_IsSuspensionEnabled (b3JointId jointId)
 Is the wheel joint spring enabled?
void b3WheelJoint_SetSuspensionHertz (b3JointId jointId, float hertz)
 Set the wheel joint stiffness in Hertz.
float b3WheelJoint_GetSuspensionHertz (b3JointId jointId)
 Get the wheel joint stiffness in Hertz.
void b3WheelJoint_SetSuspensionDampingRatio (b3JointId jointId, float dampingRatio)
 Set the wheel joint damping ratio, non-dimensional.
float b3WheelJoint_GetSuspensionDampingRatio (b3JointId jointId)
 Get the wheel joint damping ratio, non-dimensional.
void b3WheelJoint_EnableSuspensionLimit (b3JointId jointId, bool flag)
 Enable/disable the wheel joint limit.
bool b3WheelJoint_IsSuspensionLimitEnabled (b3JointId jointId)
 Is the wheel joint limit enabled?
float b3WheelJoint_GetLowerSuspensionLimit (b3JointId jointId)
 Get the wheel joint lower limit.
float b3WheelJoint_GetUpperSuspensionLimit (b3JointId jointId)
 Get the wheel joint upper limit.
void b3WheelJoint_SetSuspensionLimits (b3JointId jointId, float lower, float upper)
 Set the wheel joint limits.
void b3WheelJoint_EnableSpinMotor (b3JointId jointId, bool flag)
 Enable/disable the wheel joint motor.
bool b3WheelJoint_IsSpinMotorEnabled (b3JointId jointId)
 Is the wheel joint motor enabled?
void b3WheelJoint_SetSpinMotorSpeed (b3JointId jointId, float speed)
 Set the wheel joint motor speed in radians per second.
float b3WheelJoint_GetSpinMotorSpeed (b3JointId jointId)
 Get the wheel joint motor speed in radians per second.
void b3WheelJoint_SetMaxSpinTorque (b3JointId jointId, float torque)
 Set the wheel joint maximum motor torque, usually in newton-meters.
float b3WheelJoint_GetMaxSpinTorque (b3JointId jointId)
 Get the wheel joint maximum motor torque, usually in newton-meters.
float b3WheelJoint_GetSpinSpeed (b3JointId jointId)
 Get the current spin speed in radians per second.
float b3WheelJoint_GetSpinTorque (b3JointId jointId)
 Get the wheel joint current motor torque, usually in newton-meters.
void b3WheelJoint_EnableSteering (b3JointId jointId, bool flag)
 Enable/disable wheel steering. Steering allows the wheel to rotate about the suspension axis.
bool b3WheelJoint_IsSteeringEnabled (b3JointId jointId)
 Can the wheel steer?
void b3WheelJoint_SetSteeringHertz (b3JointId jointId, float hertz)
 Set the wheel joint steering stiffness in Hertz.
float b3WheelJoint_GetSteeringHertz (b3JointId jointId)
 Get the wheel joint steering stiffness in Hertz.
void b3WheelJoint_SetSteeringDampingRatio (b3JointId jointId, float dampingRatio)
 Set the wheel joint steering damping ratio, non-dimensional.
float b3WheelJoint_GetSteeringDampingRatio (b3JointId jointId)
 Get the wheel joint steering damping ratio, non-dimensional.
void b3WheelJoint_SetMaxSteeringTorque (b3JointId jointId, float torque)
 Set the wheel joint maximum steering torque in N*m.
float b3WheelJoint_GetMaxSteeringTorque (b3JointId jointId)
 Get the wheel joint maximum steering torque in N*m.
void b3WheelJoint_EnableSteeringLimit (b3JointId jointId, bool flag)
 Enable/disable the wheel joint steering limit.
bool b3WheelJoint_IsSteeringLimitEnabled (b3JointId jointId)
 Is the wheel joint steering limit enabled?
float b3WheelJoint_GetLowerSteeringLimit (b3JointId jointId)
 Get the wheel joint lower steering limit in radians.
float b3WheelJoint_GetUpperSteeringLimit (b3JointId jointId)
 Get the wheel joint upper steering limit in radians.
void b3WheelJoint_SetSteeringLimits (b3JointId jointId, float lowerRadians, float upperRadians)
 Set the wheel joint steering limits in radians.
void b3WheelJoint_SetTargetSteeringAngle (b3JointId jointId, float radians)
 Set the wheel joint target steering angle in radians.
float b3WheelJoint_GetTargetSteeringAngle (b3JointId jointId)
 Get the wheel joint target steering angle in radians.
float b3WheelJoint_GetSteeringAngle (b3JointId jointId)
 Get the current steering angle in radians.
float b3WheelJoint_GetSteeringTorque (b3JointId jointId)
 Get the current steering torque in N*m.
b3WheelJointDef b3DefaultWheelJointDef (void)
 Use this to initialize your joint definition.

Detailed Description

The wheel joint can be used to simulate wheels on vehicles.

The wheel joint restricts body B to move along a local axis in body A. Body B is free to rotate. Supports a linear spring, linear limits, and a rotational motor.


Data Structure Documentation

◆ b3WheelJointDef

struct b3WheelJointDef

Wheel joint definition Body A is the chassis and body B is the wheel.

The wheel rotates around the local z-axis in frame B. The wheel translates along the local x-axis in frame A. The wheel can optionally steer along the x-axis in frame A.

Collaboration diagram for b3WheelJointDef:
Data Fields
b3JointDef base Base joint definition.
bool enableSpinMotor Enable/disable the joint rotational motor.
bool enableSteering Enable steering, otherwise the steering is fixed forward.
bool enableSteeringLimit Enable/disable the steering angular limit.
bool enableSuspensionLimit Enable/disable the joint linear limit.
bool enableSuspensionSpring Enable a linear spring along the local axis.
float lowerSteeringLimit The lower steering angle in radians.
float lowerSuspensionLimit The lower suspension translation limit.
float maxSpinTorque The maximum motor torque, typically in newton-meters.
float maxSteeringTorque The maximum steering torque in N*m.
float spinSpeed The desired motor speed in radians per second.
float steeringDampingRatio Spring damping ratio, non-dimensional.
float steeringHertz Steering stiffness in Hertz.
float suspensionDampingRatio Spring damping ratio, non-dimensional.
float suspensionHertz Spring stiffness in Hertz.
float targetSteeringAngle The target steering angle in radians.
float upperSteeringLimit The upper steering angle in radians.
float upperSuspensionLimit The upper translation limit.

Function Documentation

◆ b3CreateWheelJoint()

b3JointId b3CreateWheelJoint ( b3WorldId worldId,
const b3WheelJointDef * def )

Create a wheel joint.

See also
b3WheelJointDef for details.