9#include "math_functions.h"
25#if defined( BOX3D_DOUBLE_PRECISION )
29#define b3CreateWorld b3CreateWorldDoublePrecision
415 b3DestroyDebugShapeCallback* destroyDebugShape,
void* context );
428 b3_recQueryOverlapAABB,
429 b3_recQueryOverlapShape,
431 b3_recQueryCastShape,
432 b3_recQueryCastRayClosest,
433 b3_recQueryCastMover,
434 b3_recQueryCollideMover,
void b3Body_SetUserData(b3BodyId bodyId, void *userData)
Set the user data for a body.
b3BodyCastResult b3Body_CastRay(b3BodyId bodyId, b3Pos origin, b3Vec3 translation, b3QueryFilter filter, float maxFraction, b3WorldTransform bodyTransform)
Cast a ray at a specific body using a specified body transform.
void b3Body_ApplyForceToCenter(b3BodyId bodyId, b3Vec3 force, bool wake)
Apply a force to the center of mass.
b3BodyType
The body simulation type.
Definition types.h:225
bool b3Body_IsValid(b3BodyId id)
Body identifier validation.
void b3Body_SetGravityScale(b3BodyId bodyId, float gravityScale)
Adjust the gravity scale.
float b3Body_GetSleepThreshold(b3BodyId bodyId)
Get the sleep threshold, usually in meters per second.
void b3Body_SetSleepThreshold(b3BodyId bodyId, float sleepThreshold)
Set the sleep threshold, usually in meters per second.
b3Vec3 b3Body_GetAngularVelocity(b3BodyId bodyId)
Get the angular velocity of a body in radians per second.
void b3Body_EnableHitEvents(b3BodyId bodyId, bool enableHitEvents)
Enable/disable hit events on all shapes.
void b3Body_SetTransform(b3BodyId bodyId, b3Pos position, b3Quat rotation)
Set the world transform of a body.
b3Vec3 b3Body_GetLinearVelocity(b3BodyId bodyId)
Get the linear velocity of a body's center of mass. Usually in meters per second.
int b3Body_GetContactData(b3BodyId bodyId, b3ContactData *contactData, int capacity)
Get the touching contact data for a body.
void b3Body_SetTargetTransform(b3BodyId bodyId, b3WorldTransform target, float timeStep, bool wake)
Set the velocity to reach the given transform after a given time step.
void b3Body_Disable(b3BodyId bodyId)
Disable a body by removing it completely from the simulation. This is expensive.
void b3Body_ApplyLinearImpulse(b3BodyId bodyId, b3Vec3 impulse, b3Pos point, bool wake)
Apply an impulse at a point.
int b3Body_CollideMover(b3BodyId bodyId, b3BodyPlaneResult *bodyPlanes, int planeCapacity, b3Pos origin, const b3Capsule *mover, b3QueryFilter filter, b3WorldTransform bodyTransform)
Collide a character mover with a specific body using a specified body transform.
const char * b3Body_GetName(b3BodyId bodyId)
Get the body name.
void b3Body_ApplyMassFromShapes(b3BodyId bodyId)
This updates the mass properties to the sum of the mass properties of the shapes.
b3Pos b3Body_GetPosition(b3BodyId bodyId)
Get the world position of a body. This is the location of the body origin.
void b3Body_SetAngularVelocity(b3BodyId bodyId, b3Vec3 angularVelocity)
Set the angular velocity of a body in radians per second.
b3Vec3 b3Body_GetLocalCenterOfMass(b3BodyId bodyId)
Get the center of mass position of the body in local space.
int b3Body_GetShapes(b3BodyId bodyId, b3ShapeId *shapeArray, int capacity)
Get the shape ids for all shapes on this body, up to the provided capacity.
b3Quat b3Body_GetRotation(b3BodyId bodyId)
Get the world rotation of a body as a quaternion.
void b3Body_SetBullet(b3BodyId bodyId, bool flag)
Set this body to be a bullet.
bool b3Body_IsContactRecyclingEnabled(b3BodyId bodyId)
Is contact recycling enabled on this body?
int b3Body_GetJointCount(b3BodyId bodyId)
Get the number of joints on this body.
void b3Body_Enable(b3BodyId bodyId)
Enable a body by adding it to the simulation. This is expensive.
void b3DestroyBody(b3BodyId bodyId)
Destroy a rigid body given an id.
void b3Body_SetAwake(b3BodyId bodyId, bool awake)
Wake a body from sleep.
b3Vec3 b3Body_GetLocalPointVelocity(b3BodyId bodyId, b3Vec3 localPoint)
Get the linear velocity of a local point attached to a body. Usually in meters per second.
void b3Body_SetAngularDamping(b3BodyId bodyId, float angularDamping)
Adjust the angular damping. Normally this is set in b3BodyDef before creation.
void b3Body_ApplyLinearImpulseToCenter(b3BodyId bodyId, b3Vec3 impulse, bool wake)
Apply an impulse to the center of mass.
float b3Body_GetAngularDamping(b3BodyId bodyId)
Get the current angular damping.
b3BodyCastResult b3Body_CastShape(b3BodyId bodyId, b3Pos origin, const b3ShapeProxy *proxy, b3Vec3 translation, b3QueryFilter filter, float maxFraction, bool canEncroach, b3WorldTransform bodyTransform)
Cast a shape at a specific body using a specified body transform.
int b3Body_GetShapeCount(b3BodyId bodyId)
Get the number of shapes on this body.
b3Pos b3Body_GetWorldPoint(b3BodyId bodyId, b3Vec3 localPoint)
Get a world point on a body given a local point.
b3WorldId b3Body_GetWorld(b3BodyId bodyId)
Get the world that owns this body.
float b3Body_GetInverseMass(b3BodyId bodyId)
Get the inverse mass of the body, usually in 1/kilograms.
float b3Body_GetLinearDamping(b3BodyId bodyId)
Get the current linear damping.
void b3Body_ApplyAngularImpulse(b3BodyId bodyId, b3Vec3 impulse, bool wake)
Apply an angular impulse in world space.
void b3Body_SetName(b3BodyId bodyId, const char *name)
Set the body name. Up to B3_BODY_NAME_LENGTH characters including null termination.
float b3Body_GetMass(b3BodyId bodyId)
Get the mass of the body, usually in kilograms.
bool b3Body_IsSleepEnabled(b3BodyId bodyId)
Returns true if sleeping is enabled for this body.
float b3Body_GetGravityScale(b3BodyId bodyId)
Get the current gravity scale.
b3WorldTransform b3Body_GetTransform(b3BodyId bodyId)
Get the world transform of a body.
b3BodyId b3CreateBody(b3WorldId worldId, const b3BodyDef *def)
Create a rigid body given a definition.
void b3Body_EnableSleep(b3BodyId bodyId, bool enableSleep)
Enable or disable sleeping for this body. If sleeping is disabled the body will wake.
bool b3Body_IsBullet(b3BodyId bodyId)
Is this body a bullet?
b3Pos b3Body_GetWorldCenterOfMass(b3BodyId bodyId)
Get the center of mass position of the body in world space.
void b3Body_SetMassData(b3BodyId bodyId, b3MassData massData)
Override the body's mass properties.
void b3Body_EnableContactRecycling(b3BodyId bodyId, bool flag)
Enable or disable contact recycling for this body.
float b3Body_GetClosestPoint(b3BodyId bodyId, b3Vec3 *result, b3Vec3 target)
Get the closest point on a body to a world target.
b3AABB b3Body_ComputeAABB(b3BodyId bodyId)
Get the current world AABB that contains all the attached shapes.
b3Vec3 b3Body_GetLocalVector(b3BodyId bodyId, b3Vec3 worldVector)
Get a local vector on a body given a world vector.
bool b3Body_IsAwake(b3BodyId bodyId)
b3BodyType b3Body_GetType(b3BodyId bodyId)
Get the body type: static, kinematic, or dynamic.
void b3Body_SetLinearVelocity(b3BodyId bodyId, b3Vec3 linearVelocity)
Set the linear velocity of a body. Usually in meters per second.
bool b3Body_IsEnabled(b3BodyId bodyId)
Returns true if this body is enabled.
b3Vec3 b3Body_GetLocalPoint(b3BodyId bodyId, b3Pos worldPoint)
Get a local point on a body given a world point.
void b3Body_ApplyTorque(b3BodyId bodyId, b3Vec3 torque, bool wake)
Apply a torque.
b3Vec3 b3Body_GetWorldPointVelocity(b3BodyId bodyId, b3Pos worldPoint)
Get the linear velocity of a world point attached to a body. Usually in meters per second.
void b3Body_SetLinearDamping(b3BodyId bodyId, float linearDamping)
Adjust the linear damping. Normally this is set in b3BodyDef before creation.
void b3Body_SetType(b3BodyId bodyId, b3BodyType type)
Change the body type.
void b3Body_ApplyForce(b3BodyId bodyId, b3Vec3 force, b3Pos point, bool wake)
Apply a force at a world point.
void b3Body_SetMotionLocks(b3BodyId bodyId, b3MotionLocks locks)
Set the motion locks on this body.
void * b3Body_GetUserData(b3BodyId bodyId)
Get the user data stored in a body.
b3Matrix3 b3Body_GetWorldInverseRotationalInertia(b3BodyId bodyId)
Get the inverse rotational inertia of the body in world space, usually in 1/kg*m^2.
b3Matrix3 b3Body_GetLocalRotationalInertia(b3BodyId bodyId)
Get the rotational inertia of the body in local space, usually in kg*m^2.
b3Vec3 b3Body_GetWorldVector(b3BodyId bodyId, b3Vec3 localVector)
Get a world vector on a body given a local vector.
int b3Body_GetContactCapacity(b3BodyId bodyId)
Get the maximum capacity required for retrieving all the touching contacts on a body.
b3MotionLocks b3Body_GetMotionLocks(b3BodyId bodyId)
Get the motion locks for this body.
int b3Body_GetJoints(b3BodyId bodyId, b3JointId *jointArray, int capacity)
Get the joint ids for all joints on this body, up to the provided capacity.
bool b3Body_OverlapShape(b3BodyId bodyId, b3Pos origin, const b3ShapeProxy *proxy, b3QueryFilter filter, b3WorldTransform bodyTransform)
Overlap a shape with a specific body using a specified body transform.
b3MassData b3Body_GetMassData(b3BodyId bodyId)
Get the mass data for a body.
A body definition holds all the data needed to construct a rigid body.
Definition types.h:268
Motion locks to restrict the body movement.
Definition types.h:242
A solid capsule can be viewed as two hemispheres connected by a rectangle.
Definition types.h:1905
bool b3MoverFilterFcn(b3ShapeId shapeId, void *context)
Used to filter shapes for shape casting character movers.
Definition types.h:1853
bool b3PlaneResultFcn(b3ShapeId shapeId, const b3PlaneResult *plane, int planeCount, void *context)
Used to collect collision planes for character movers.
Definition types.h:1849
Body plane result for movers.
Definition types.h:1839
The runtime data for a compound shape.
Definition types.h:2414
void * b3CreateDebugShapeCallback(const b3DebugShape *debugShape, void *userContext)
The user needs to be able to create debug draw shapes for multi-pass rendering to work efficiently.
Definition types.h:47
void b3DistanceJoint_EnableMotor(b3JointId jointId, bool enableMotor)
Enable/disable the distance joint motor.
void b3DistanceJoint_SetSpringHertz(b3JointId jointId, float hertz)
Set the spring stiffness in Hertz.
void b3DistanceJoint_GetSpringForceRange(b3JointId jointId, float *lowerForce, float *upperForce)
Get the force range for the spring.
float b3DistanceJoint_GetMinLength(b3JointId jointId)
Get the distance joint minimum length.
void b3DistanceJoint_SetLengthRange(b3JointId jointId, float minLength, float maxLength)
Set the minimum and maximum length parameters of a distance joint.
void b3DistanceJoint_SetSpringDampingRatio(b3JointId jointId, float dampingRatio)
Set the spring damping ratio, non-dimensional.
b3JointId b3CreateDistanceJoint(b3WorldId worldId, const b3DistanceJointDef *def)
Create a distance joint.
void b3DistanceJoint_SetMaxMotorForce(b3JointId jointId, float force)
Set the distance joint maximum motor force, usually in newtons.
float b3DistanceJoint_GetMotorSpeed(b3JointId jointId)
Get the distance joint motor speed, usually in meters per second.
float b3DistanceJoint_GetMaxLength(b3JointId jointId)
Get the distance joint maximum length.
float b3DistanceJoint_GetSpringDampingRatio(b3JointId jointId)
Get the spring damping ratio.
float b3DistanceJoint_GetMaxMotorForce(b3JointId jointId)
Get the distance joint maximum motor force, usually in newtons.
bool b3DistanceJoint_IsMotorEnabled(b3JointId jointId)
Is the distance joint motor enabled?
void b3DistanceJoint_EnableLimit(b3JointId jointId, bool enableLimit)
Enable joint limit.
float b3DistanceJoint_GetLength(b3JointId jointId)
Get the rest length of a distance joint.
float b3DistanceJoint_GetCurrentLength(b3JointId jointId)
Get the current length of a distance joint.
void b3DistanceJoint_SetLength(b3JointId jointId, float length)
Set the rest length of a distance joint.
void b3DistanceJoint_EnableSpring(b3JointId jointId, bool enableSpring)
Enable/disable the distance joint spring. When disabled the distance joint is rigid.
bool b3DistanceJoint_IsSpringEnabled(b3JointId jointId)
Is the distance joint spring enabled?
float b3DistanceJoint_GetMotorForce(b3JointId jointId)
Get the distance joint current motor force, usually in newtons.
bool b3DistanceJoint_IsLimitEnabled(b3JointId jointId)
Is the distance joint limit enabled?
void b3DistanceJoint_SetMotorSpeed(b3JointId jointId, float motorSpeed)
Set the distance joint motor speed, usually in meters per second.
float b3DistanceJoint_GetSpringHertz(b3JointId jointId)
Get the spring Hertz.
void b3DistanceJoint_SetSpringForceRange(b3JointId jointId, float lowerForce, float upperForce)
Set the force range for the spring.
Distance joint definition.
Definition types.h:648
Body events are buffered in the world and are available as event arrays after the time step is comple...
Definition types.h:1216
Joint events are buffered in the world and are available as event arrays after the time step is compl...
Definition types.h:1239
Sensor events are buffered in the world and are available as begin/end overlap event arrays after the...
Definition types.h:1079
b3JointId b3CreateFilterJoint(b3WorldId worldId, const b3FilterJointDef *def)
Create a filter joint.
A filter joint is used to disable collision between two specific bodies.
Definition types.h:739
This holds the mass data computed for a shape.
Definition types.h:1867
A height field with compressed storage.
Definition types.h:2260
A convex hull.
Definition types.h:1964
Body id references a body instance. This should be treated as an opaque handle.
Definition id.h:45
Joint id references a joint instance. This should be treated as an opaque handle.
Definition id.h:61
Shape id references a shape instance. This should be treated as an opaque handle.
Definition id.h:53
World id references a world instance. This should be treated as an opaque handle.
Definition id.h:38
b3JointType
Joint type enumeration.
Definition types.h:587
b3Vec3 b3Joint_GetConstraintForce(b3JointId jointId)
Get the current constraint force for this joint.
void * b3Joint_GetUserData(b3JointId jointId)
Get the user data on a joint.
float b3Joint_GetAngularSeparation(b3JointId jointId)
Get the current angular separation error for this joint. Does not consider admissible movement....
bool b3Joint_GetCollideConnected(b3JointId jointId)
Is collision allowed between connected bodies?
b3JointType b3Joint_GetType(b3JointId jointId)
Get the joint type.
void b3Joint_SetLocalFrameA(b3JointId jointId, b3Transform localFrame)
Set the local frame on bodyA.
float b3Joint_GetForceThreshold(b3JointId jointId)
Get the force threshold for joint events (Newtons).
void b3DestroyJoint(b3JointId jointId, bool wakeAttached)
Destroy a joint.
void b3Joint_SetForceThreshold(b3JointId jointId, float threshold)
Set the force threshold for joint events (Newtons).
b3Transform b3Joint_GetLocalFrameA(b3JointId jointId)
Get the local frame on bodyA.
void b3Joint_SetCollideConnected(b3JointId jointId, bool shouldCollide)
Toggle collision between connected bodies.
b3BodyId b3Joint_GetBodyA(b3JointId jointId)
Get body A id on a joint.
bool b3Joint_IsValid(b3JointId id)
Joint identifier validation. Provides validation for up to 64K allocations.
b3Vec3 b3Joint_GetConstraintTorque(b3JointId jointId)
Get the current constraint torque for this joint.
b3BodyId b3Joint_GetBodyB(b3JointId jointId)
Get body B id on a joint.
void b3Joint_SetConstraintTuning(b3JointId jointId, float hertz, float dampingRatio)
Set the joint constraint tuning.
void b3Joint_SetLocalFrameB(b3JointId jointId, b3Transform localFrame)
Set the local frame on bodyB.
b3WorldId b3Joint_GetWorld(b3JointId jointId)
Get the world that owns this joint.
b3Transform b3Joint_GetLocalFrameB(b3JointId jointId)
Get the local frame on bodyB.
float b3Joint_GetTorqueThreshold(b3JointId jointId)
Get the torque threshold for joint events (N-m).
void b3Joint_GetConstraintTuning(b3JointId jointId, float *hertz, float *dampingRatio)
Get the joint constraint tuning. Advanced feature.
void b3Joint_SetTorqueThreshold(b3JointId jointId, float threshold)
Set the torque threshold for joint events (N-m).
void b3Joint_SetUserData(b3JointId jointId, void *userData)
Set the user data on a joint.
void b3Joint_WakeBodies(b3JointId jointId)
Wake the bodies connect to this joint.
float b3Joint_GetLinearSeparation(b3JointId jointId)
Get the current linear separation error for this joint. Does not consider admissible movement....
b3Vec3 b3Pos
In single precision mode these types are the same.
Definition math_functions.h:90
b3Transform b3WorldTransform
In single precision mode these types are the same.
Definition math_functions.h:93
Axis aligned bounding box.
Definition math_functions.h:105
A 3x3 matrix.
Definition math_functions.h:99
A quaternion.
Definition math_functions.h:58
A 3D vector.
Definition math_functions.h:41
This allows mesh data to be re-used with different scales.
Definition types.h:2199
This is a sorted triangle collision bounding volume hierarchy.
Definition types.h:2147
float b3MotorJoint_GetLinearDampingRatio(b3JointId jointId)
Get the spring linear damping ratio.
float b3MotorJoint_GetMaxVelocityForce(b3JointId jointId)
Get the motor joint maximum force, usually in newtons.
void b3MotorJoint_SetAngularVelocity(b3JointId jointId, b3Vec3 velocity)
Set the desired relative angular velocity in radians per second.
b3Vec3 b3MotorJoint_GetAngularVelocity(b3JointId jointId)
Get the desired relative angular velocity in radians per second.
void b3MotorJoint_SetLinearDampingRatio(b3JointId jointId, float damping)
Set the spring linear damping ratio. Use 1.0 for critical damping.
void b3MotorJoint_SetLinearVelocity(b3JointId jointId, b3Vec3 velocity)
Set the desired relative linear velocity in meters per second.
float b3MotorJoint_GetMaxSpringForce(b3JointId jointId)
Get the maximum spring force in newtons.
void b3MotorJoint_SetAngularHertz(b3JointId jointId, float hertz)
Set the spring angular hertz stiffness.
void b3MotorJoint_SetMaxVelocityForce(b3JointId jointId, float maxForce)
Set the motor joint maximum force, usually in newtons.
b3Vec3 b3MotorJoint_GetLinearVelocity(b3JointId jointId)
Get the desired relative linear velocity in meters per second.
float b3MotorJoint_GetMaxVelocityTorque(b3JointId jointId)
Get the motor joint maximum torque, usually in newton-meters.
void b3MotorJoint_SetMaxVelocityTorque(b3JointId jointId, float maxTorque)
Set the motor joint maximum torque, usually in newton-meters.
b3JointId b3CreateMotorJoint(b3WorldId worldId, const b3MotorJointDef *def)
Create a motor joint.
void b3MotorJoint_SetMaxSpringForce(b3JointId jointId, float maxForce)
Set the maximum spring force in newtons.
float b3MotorJoint_GetAngularHertz(b3JointId jointId)
Get the spring angular hertz stiffness.
void b3MotorJoint_SetLinearHertz(b3JointId jointId, float hertz)
Set the spring linear hertz stiffness.
float b3MotorJoint_GetMaxSpringTorque(b3JointId jointId)
Get the maximum spring torque in newtons * meters.
float b3MotorJoint_GetAngularDampingRatio(b3JointId jointId)
Get the spring angular damping ratio.
float b3MotorJoint_GetLinearHertz(b3JointId jointId)
Get the spring linear hertz stiffness.
void b3MotorJoint_SetAngularDampingRatio(b3JointId jointId, float damping)
Set the spring angular damping ratio. Use 1.0 for critical damping.
void b3MotorJoint_SetMaxSpringTorque(b3JointId jointId, float maxTorque)
Set the maximum spring torque in newtons * meters.
A motor joint is used to control the relative position and velocity between two bodies.
Definition types.h:697
void b3ParallelJoint_SetSpringHertz(b3JointId jointId, float hertz)
Set the spring stiffness in Hertz.
void b3ParallelJoint_SetMaxTorque(b3JointId jointId, float force)
Set the maximum spring torque, usually in newton-meters.
b3JointId b3CreateParallelJoint(b3WorldId worldId, const b3ParallelJointDef *def)
Create a parallel joint.
void b3ParallelJoint_SetSpringDampingRatio(b3JointId jointId, float dampingRatio)
Set the spring damping ratio, non-dimensional.
float b3ParallelJoint_GetMaxTorque(b3JointId jointId)
Get the maximum spring torque, usually in newton-meters.
float b3ParallelJoint_GetSpringHertz(b3JointId jointId)
Get the spring Hertz.
float b3ParallelJoint_GetSpringDampingRatio(b3JointId jointId)
Get the spring damping ratio.
Parallel joint definition.
Definition types.h:752
float b3PrismaticJoint_GetMotorSpeed(b3JointId jointId)
Get the prismatic joint motor speed, usually in meters per second.
float b3PrismaticJoint_GetSpeed(b3JointId jointId)
Get the current joint translation speed, usually in meters per second.
float b3PrismaticJoint_GetTargetTranslation(b3JointId jointId)
Get the prismatic joint target translation. Usually in meters.
float b3PrismaticJoint_GetUpperLimit(b3JointId jointId)
Get the prismatic joint upper limit.
void b3PrismaticJoint_SetMotorSpeed(b3JointId jointId, float motorSpeed)
Set the prismatic joint motor speed, usually in meters per second.
bool b3PrismaticJoint_IsLimitEnabled(b3JointId jointId)
Is the prismatic joint limit enabled?
bool b3PrismaticJoint_IsSpringEnabled(b3JointId jointId)
Is the prismatic joint spring enabled or not?
float b3PrismaticJoint_GetSpringHertz(b3JointId jointId)
Get the prismatic joint stiffness in Hertz.
void b3PrismaticJoint_SetMaxMotorForce(b3JointId jointId, float force)
Set the prismatic joint maximum motor force, usually in newtons.
float b3PrismaticJoint_GetSpringDampingRatio(b3JointId jointId)
Get the prismatic spring damping ratio (non-dimensional).
void b3PrismaticJoint_SetSpringHertz(b3JointId jointId, float hertz)
Set the prismatic joint stiffness in Hertz.
void b3PrismaticJoint_SetTargetTranslation(b3JointId jointId, float targetTranslation)
Set the prismatic joint target translation. Usually in meters.
void b3PrismaticJoint_EnableMotor(b3JointId jointId, bool enableMotor)
Enable/disable a prismatic joint motor.
void b3PrismaticJoint_SetLimits(b3JointId jointId, float lower, float upper)
Set the prismatic joint limits.
b3JointId b3CreatePrismaticJoint(b3WorldId worldId, const b3PrismaticJointDef *def)
Create a prismatic (slider) joint.
void b3PrismaticJoint_EnableLimit(b3JointId jointId, bool enableLimit)
Enable/disable a prismatic joint limit.
void b3PrismaticJoint_SetSpringDampingRatio(b3JointId jointId, float dampingRatio)
Set the prismatic joint damping ratio (non-dimensional).
float b3PrismaticJoint_GetMotorForce(b3JointId jointId)
Get the prismatic joint current motor force, usually in newtons.
float b3PrismaticJoint_GetMaxMotorForce(b3JointId jointId)
Get the prismatic joint maximum motor force, usually in newtons.
float b3PrismaticJoint_GetTranslation(b3JointId jointId)
Get the current joint translation, usually in meters.
void b3PrismaticJoint_EnableSpring(b3JointId jointId, bool enableSpring)
Enable/disable the joint spring.
float b3PrismaticJoint_GetLowerLimit(b3JointId jointId)
Get the prismatic joint lower limit.
bool b3PrismaticJoint_IsMotorEnabled(b3JointId jointId)
Is the prismatic joint motor enabled?
Prismatic joint definition.
Definition types.h:776
b3CastOutput b3WorldCastOutput
Same type in single precision.
Definition types.h:1464
Body cast result for ray and shape casts.
Definition types.h:1470
The query filter is used to filter collisions between queries and shapes.
Definition types.h:1284
Result from b3World_RayCastClosest.
Definition types.h:1322
A shape proxy is used by the GJK algorithm. It can represent a convex shape.
Definition types.h:1358
struct b3Recording b3Recording
Opaque recording handle. Create with b3CreateRecording, destroy with b3DestroyRecording.
Definition box3d.h:262
const uint8_t * b3Recording_GetData(const b3Recording *recording)
Get a pointer to the raw recording bytes.
int b3RecPlayer_GetFrameCount(const b3RecPlayer *player)
b3RecPlayerInfo b3RecPlayer_GetInfo(const b3RecPlayer *player)
void b3RecPlayer_SetKeyframePolicy(b3RecPlayer *player, size_t budgetBytes, int minIntervalFrames)
Tune the keyframe ring used to speed up backward seeking.
b3RecPlayer * b3RecPlayer_Create(const void *data, int size, int workerCount)
Create a player over a recording.
b3RecQueryInfo b3RecPlayer_GetFrameQuery(const b3RecPlayer *player, int index)
Get a recorded query from the most recently replayed frame by index.
b3Recording * b3CreateRecording(int byteCapacity)
Create a recording buffer with an optional initial byte capacity.
bool b3RecPlayer_StepFrame(b3RecPlayer *player)
Advance one frame: dispatch ops until the next Step completes.
void b3RecPlayer_SeekFrame(b3RecPlayer *player, int targetFrame)
Seek to a specific frame.
b3Recording * b3LoadRecordingFromFile(const char *path)
Load a recording from a file.
b3RecQueryType
The kind of a recorded spatial query, matching the public query and cast functions.
Definition box3d.h:427
int b3RecPlayer_GetFrameQueryCount(const b3RecPlayer *player)
void b3RecPlayer_Destroy(b3RecPlayer *player)
Destroy the player and free all memory. Restores the previous global length scale.
int b3RecPlayer_GetBodyCount(const b3RecPlayer *player)
void b3RecPlayer_SetWorkerCount(b3RecPlayer *player, int count)
Set the worker count of the replay world.
int b3Recording_GetSize(const b3Recording *recording)
Get the number of bytes currently in the recording buffer.
int b3RecPlayer_GetDivergeFrame(const b3RecPlayer *player)
int b3RecPlayer_GetKeyframeMinInterval(const b3RecPlayer *player)
bool b3ValidateReplay(const void *data, int size, int workerCount)
Replay a recording from memory and verify it reproduces the same world-state hashes.
void b3RecPlayer_SetDebugShapeCallbacks(b3RecPlayer *player, b3CreateDebugShapeCallback *createDebugShape, b3DestroyDebugShapeCallback *destroyDebugShape, void *context)
Wire host debug-shape callbacks into the player's replay world so a renderer can build per-shape draw...
bool b3RecPlayer_IsAtEnd(const b3RecPlayer *player)
struct b3RecPlayer b3RecPlayer
Opaque incremental replay player with a keyframe ring for O(interval) backward seek.
Definition box3d.h:313
b3WorldId b3RecPlayer_GetWorldId(const b3RecPlayer *player)
void b3World_StartRecording(b3WorldId worldId, b3Recording *recording)
Begin recording world mutations into the provided buffer.
bool b3SaveRecordingToFile(const b3Recording *recording, const char *path)
Save the recording buffer to a file.
size_t b3RecPlayer_GetKeyframeBytes(const b3RecPlayer *player)
int b3RecPlayer_GetFrame(const b3RecPlayer *player)
void b3DestroyRecording(b3Recording *recording)
Destroy a recording and free its buffer.
void b3RecPlayer_DrawFrameQueries(b3RecPlayer *player, b3DebugDraw *draw, int queryIndex, int selectedIndex)
Draw the spatial queries recorded during the most recently replayed frame, layered on top of the worl...
b3RecQueryHit b3RecPlayer_GetFrameQueryHit(const b3RecPlayer *player, int queryIndex, int hitIndex)
Get one result of a recorded query from the most recently replayed frame.
size_t b3RecPlayer_GetKeyframeBudget(const b3RecPlayer *player)
int b3RecPlayer_GetKeyframeInterval(const b3RecPlayer *player)
b3BodyId b3RecPlayer_GetBodyId(const b3RecPlayer *player, int index)
Resolve a creation ordinal to the live body id at the current frame.
bool b3RecPlayer_HasDiverged(const b3RecPlayer *player)
void b3World_StopRecording(b3WorldId worldId)
End the current recording session.
void b3RecPlayer_Restart(b3RecPlayer *player)
Rewind to frame 0 (in-place restore so the world id stays stable).
Summary of a recording, read once at open so a viewer can frame and label it.
Definition box3d.h:317
One result of a recorded spatial query.
Definition box3d.h:453
A spatial query recorded during a replayed frame, exposed for inspection.
Definition box3d.h:439
float b3RevoluteJoint_GetLowerLimit(b3JointId jointId)
Get the revolute joint lower limit in radians.
void b3RevoluteJoint_SetSpringDampingRatio(b3JointId jointId, float dampingRatio)
Set the revolute joint spring damping ratio, non-dimensional.
bool b3RevoluteJoint_IsLimitEnabled(b3JointId jointId)
Is the revolute joint limit enabled?
void b3RevoluteJoint_SetMotorSpeed(b3JointId jointId, float motorSpeed)
Set the revolute joint motor speed in radians per second.
float b3RevoluteJoint_GetMotorSpeed(b3JointId jointId)
Get the revolute joint motor speed in radians per second.
bool b3RevoluteJoint_IsMotorEnabled(b3JointId jointId)
Is the revolute joint motor enabled?
void b3RevoluteJoint_SetLimits(b3JointId jointId, float lowerLimitRadians, float upperLimitRadians)
Set the revolute joint limits in radians.
float b3RevoluteJoint_GetTargetAngle(b3JointId jointId)
Get the revolute joint target angle in radians.
float b3RevoluteJoint_GetSpringHertz(b3JointId jointId)
Get the revolute joint spring stiffness in Hertz.
void b3RevoluteJoint_SetSpringHertz(b3JointId jointId, float hertz)
Set the revolute joint spring stiffness in Hertz.
float b3RevoluteJoint_GetMotorTorque(b3JointId jointId)
Get the revolute joint current motor torque, usually in newton-meters.
float b3RevoluteJoint_GetMaxMotorTorque(b3JointId jointId)
Get the revolute joint maximum motor torque, usually in newton-meters.
void b3RevoluteJoint_EnableSpring(b3JointId jointId, bool enableSpring)
Enable/disable the revolute joint spring.
float b3RevoluteJoint_GetSpringDampingRatio(b3JointId jointId)
Get the revolute joint spring damping ratio, non-dimensional.
void b3RevoluteJoint_EnableMotor(b3JointId jointId, bool enableMotor)
Enable/disable a revolute joint motor.
float b3RevoluteJoint_GetAngle(b3JointId jointId)
Get the revolute joint current angle in radians relative to the reference angle.
void b3RevoluteJoint_SetTargetAngle(b3JointId jointId, float targetRadians)
Set the revolute joint target angle in radians.
b3JointId b3CreateRevoluteJoint(b3WorldId worldId, const b3RevoluteJointDef *def)
Create a revolute joint.
void b3RevoluteJoint_SetMaxMotorTorque(b3JointId jointId, float torque)
Set the revolute joint maximum motor torque, usually in newton-meters.
float b3RevoluteJoint_GetUpperLimit(b3JointId jointId)
Get the revolute joint upper limit in radians.
bool b3RevoluteJoint_IsSpringEnabled(b3JointId jointId)
Is the revolute angular spring enabled?
void b3RevoluteJoint_EnableLimit(b3JointId jointId, bool enableLimit)
Enable/disable the revolute joint limit.
Revolute joint definition.
Definition types.h:820
b3ShapeId b3CreateHullShape(b3BodyId bodyId, const b3ShapeDef *def, const b3HullData *hull)
Create a convex hull shape and attach it to a body.
b3Filter b3Shape_GetFilter(b3ShapeId shapeId)
Get the shape filter.
void b3DestroyShape(b3ShapeId shapeId, bool updateBodyMass)
Destroy a shape.
void b3Shape_SetCapsule(b3ShapeId shapeId, const b3Capsule *capsule)
Allows you to change a shape to be a capsule or update the current capsule.
void b3Shape_SetHull(b3ShapeId shapeId, const b3HullData *hull)
Allows you to change a shape to be a hull or update the current hull.
bool b3Shape_AreHitEventsEnabled(b3ShapeId shapeId)
Returns true if hit events are enabled.
b3ShapeId b3CreateCapsuleShape(b3BodyId bodyId, const b3ShapeDef *def, const b3Capsule *capsule)
Create a capsule shape and attach it to a body.
b3AABB b3Shape_GetAABB(b3ShapeId shapeId)
Get the current world AABB.
bool b3Shape_AreContactEventsEnabled(b3ShapeId shapeId)
Returns true if contact events are enabled.
b3WorldId b3Shape_GetWorld(b3ShapeId shapeId)
Get the world that owns this shape.
int b3Shape_GetMeshMaterialCount(b3ShapeId shapeId)
Get the number of mesh surface materials.
b3ShapeId b3CreateSphereShape(b3BodyId bodyId, const b3ShapeDef *def, const b3Sphere *sphere)
Create a circle shape and attach it to a body.
void b3Shape_SetRestitution(b3ShapeId shapeId, float restitution)
Set the shape restitution (bounciness).
void b3Shape_SetFriction(b3ShapeId shapeId, float friction)
Set the friction on a shape.
b3SurfaceMaterial b3Shape_GetMeshSurfaceMaterial(b3ShapeId shapeId, int index)
Get a surface material for a mesh shape.
void b3Shape_EnableHitEvents(b3ShapeId shapeId, bool flag)
Enable contact hit events for this shape.
void b3Shape_EnableContactEvents(b3ShapeId shapeId, bool flag)
Enable contact events for this shape.
b3ShapeId b3CreateTransformedHullShape(b3BodyId bodyId, const b3ShapeDef *def, const b3HullData *hull, b3Transform transform, b3Vec3 scale)
Create a convex hull shape and attach it to a body.
void b3Shape_SetFilter(b3ShapeId shapeId, b3Filter filter, bool invokeContacts)
Set the current filter.
void b3Shape_ApplyWind(b3ShapeId shapeId, b3Vec3 wind, float drag, float lift, float maxSpeed, bool wake)
Apply a wind force to the body for this shape using the density of air.
void b3Shape_SetDensity(b3ShapeId shapeId, float density, bool updateBodyMass)
Set the mass density of a shape, usually in kg/m^3.
b3ShapeId b3CreateMeshShape(b3BodyId bodyId, const b3ShapeDef *def, const b3MeshData *mesh, b3Vec3 scale)
Create a mesh hull shape and attach it to a body.
b3MassData b3Shape_ComputeMassData(b3ShapeId shapeId)
Compute the mass data for a shape.
int b3Shape_GetSensorCapacity(b3ShapeId shapeId)
Get the maximum capacity required for retrieving all the overlapped shapes on a sensor shape.
void b3Shape_SetSurfaceMaterial(b3ShapeId shapeId, b3SurfaceMaterial surfaceMaterial)
Set the shape base surface material. Does not change per triangle materials.
void * b3Shape_GetUserData(b3ShapeId shapeId)
Get the user data for a shape.
bool b3Shape_ArePreSolveEventsEnabled(b3ShapeId shapeId)
Returns true if pre-solve events are enabled.
b3ShapeType
Shape type.
Definition types.h:431
b3SurfaceMaterial b3Shape_GetSurfaceMaterial(b3ShapeId shapeId)
Get the base shape surface material.
float b3Shape_GetFriction(b3ShapeId shapeId)
Get the friction of a shape.
b3BodyId b3Shape_GetBody(b3ShapeId shapeId)
Get the id of the body that a shape is attached to.
const b3HullData * b3Shape_GetHull(b3ShapeId shapeId)
Get the shape's convex hull. Asserts the type is correct.
b3ShapeId b3CreateCompoundShape(b3BodyId bodyId, b3ShapeDef *def, const b3CompoundData *compound)
Compound shapes are only allowed on static bodies.
b3ShapeId b3CreateHeightFieldShape(b3BodyId bodyId, const b3ShapeDef *def, const b3HeightFieldData *heightField)
Create a height-field shape and attach it to a body.
void b3Shape_SetMeshMaterial(b3ShapeId shapeId, b3SurfaceMaterial surfaceMaterial, int index)
Set a surface material for a mesh shape.
int b3Shape_GetContactCapacity(b3ShapeId shapeId)
Get the maximum capacity required for retrieving all the touching contacts on a shape.
b3Mesh b3Shape_GetMesh(b3ShapeId shapeId)
Get the shape's mesh. Asserts the type is correct.
b3WorldCastOutput b3Shape_RayCast(b3ShapeId shapeId, b3Pos origin, b3Vec3 translation)
Ray cast a shape directly.
int b3Shape_GetContactData(b3ShapeId shapeId, b3ContactData *contactData, int capacity)
Get the touching contact data for a shape.
int b3Shape_GetSensorData(b3ShapeId shapeId, b3ShapeId *visitorIds, int capacity)
Get the overlap data for a sensor shape.
void b3Shape_SetMesh(b3ShapeId shapeId, const b3MeshData *meshData, b3Vec3 scale)
Allows you to change a shape to be a mesh or update the current mesh.
bool b3Shape_AreSensorEventsEnabled(b3ShapeId shapeId)
Returns true if sensor events are enabled.
void b3Shape_SetUserData(b3ShapeId shapeId, void *userData)
Set the user data for a shape.
void b3Shape_EnableSensorEvents(b3ShapeId shapeId, bool flag)
Enable sensor events for this shape.
const b3HeightFieldData * b3Shape_GetHeightField(b3ShapeId shapeId)
Get the shape's height field. Asserts the type is correct.
bool b3Shape_IsValid(b3ShapeId id)
Shape identifier validation. Provides validation for up to 64K allocations.
void b3Shape_EnablePreSolveEvents(b3ShapeId shapeId, bool flag)
Enable pre-solve contact events for this shape.
b3ShapeType b3Shape_GetType(b3ShapeId shapeId)
Get the type of a shape.
float b3Shape_GetRestitution(b3ShapeId shapeId)
Get the shape restitution.
b3Vec3 b3Shape_GetClosestPoint(b3ShapeId shapeId, b3Vec3 target)
Get the closest point on a shape to a target point. Target and result are in world space.
void b3Shape_SetSphere(b3ShapeId shapeId, const b3Sphere *sphere)
Allows you to change a shape to be a sphere or update the current sphere.
b3Sphere b3Shape_GetSphere(b3ShapeId shapeId)
Get a copy of the shape's sphere. Asserts the type is correct.
bool b3Shape_IsSensor(b3ShapeId shapeId)
Returns true if the shape is a sensor.
float b3Shape_GetDensity(b3ShapeId shapeId)
Get the density of a shape, usually in kg/m^3.
b3Capsule b3Shape_GetCapsule(b3ShapeId shapeId)
Get a copy of the shape's capsule. Asserts the type is correct.
This is used to filter collision on shapes.
Definition types.h:359
Used to create a shape.
Definition types.h:457
Material properties supported per triangle on meshes and height fields.
Definition types.h:399
A solid sphere.
Definition types.h:1886
b3Vec3 b3SphericalJoint_GetMotorTorque(b3JointId jointId)
Get the spherical joint current motor torque, usually in newton-meters.
void b3SphericalJoint_SetSpringDampingRatio(b3JointId jointId, float dampingRatio)
Set the spherical joint spring damping ratio, non-dimensional.
void b3SphericalJoint_SetTargetRotation(b3JointId jointId, b3Quat targetRotation)
Set the spherical joint spring target rotation.
float b3SphericalJoint_GetSpringDampingRatio(b3JointId jointId)
Get the spherical joint spring damping ratio, non-dimensional.
bool b3SphericalJoint_IsTwistLimitEnabled(b3JointId jointId)
Is the spherical joint limit enabled?
void b3SphericalJoint_SetTwistLimits(b3JointId jointId, float lowerLimitRadians, float upperLimitRadians)
Set the spherical joint limits in radians.
void b3SphericalJoint_EnableMotor(b3JointId jointId, bool enableMotor)
Enable/disable a spherical joint motor.
void b3SphericalJoint_SetSpringHertz(b3JointId jointId, float hertz)
Set the spherical joint spring stiffness in Hertz.
b3JointId b3CreateSphericalJoint(b3WorldId worldId, const b3SphericalJointDef *def)
Create a spherical joint.
b3Vec3 b3SphericalJoint_GetMotorVelocity(b3JointId jointId)
Get the spherical joint motor velocity in radians per second.
void b3SphericalJoint_EnableTwistLimit(b3JointId jointId, bool enableLimit)
Enable/disable the spherical joint limit.
void b3SphericalJoint_SetMaxMotorTorque(b3JointId jointId, float torque)
Set the spherical joint maximum motor torque, usually in newton-meters.
bool b3SphericalJoint_IsMotorEnabled(b3JointId jointId)
Is the spherical joint motor enabled?
float b3SphericalJoint_GetConeAngle(b3JointId jointId)
Get the spherical joint current cone angle in radians.
float b3SphericalJoint_GetConeLimit(b3JointId jointId)
Get the spherical joint cone limit in radians.
float b3SphericalJoint_GetLowerTwistLimit(b3JointId jointId)
Get the spherical joint lower limit in radians.
void b3SphericalJoint_EnableSpring(b3JointId jointId, bool enableSpring)
Enable/disable the spherical joint spring.
float b3SphericalJoint_GetTwistAngle(b3JointId jointId)
Get the spherical joint current twist angle in radians.
void b3SphericalJoint_SetConeLimit(b3JointId jointId, float angleRadians)
Set the spherical joint limits in radians.
float b3SphericalJoint_GetUpperTwistLimit(b3JointId jointId)
Get the spherical joint upper limit in radians.
float b3SphericalJoint_GetMaxMotorTorque(b3JointId jointId)
Get the spherical joint maximum motor torque, usually in newton-meters.
void b3SphericalJoint_SetMotorVelocity(b3JointId jointId, b3Vec3 motorVelocity)
Set the spherical joint motor velocity in radians per second.
float b3SphericalJoint_GetSpringHertz(b3JointId jointId)
Get the spherical joint spring stiffness in Hertz.
bool b3SphericalJoint_IsSpringEnabled(b3JointId jointId)
Is the spherical angular spring enabled?
bool b3SphericalJoint_IsConeLimitEnabled(b3JointId jointId)
Is the spherical joint cone limit enabled?
void b3SphericalJoint_EnableConeLimit(b3JointId jointId, bool enableLimit)
Enable/disable the spherical joint cone limit.
b3Quat b3SphericalJoint_GetTargetRotation(b3JointId jointId)
Get the spherical joint spring target rotation.
Spherical joint definition.
Definition types.h:864
These are performance results returned by dynamic tree queries.
Definition types.h:1760
float b3WeldJoint_GetAngularDampingRatio(b3JointId jointId)
Get the weld joint angular damping ratio, non-dimensional.
void b3WeldJoint_SetLinearHertz(b3JointId jointId, float hertz)
Set the weld joint linear stiffness in Hertz. 0 is rigid.
float b3WeldJoint_GetLinearHertz(b3JointId jointId)
Get the weld joint linear stiffness in Hertz.
float b3WeldJoint_GetAngularHertz(b3JointId jointId)
Get the weld joint angular stiffness in Hertz.
void b3WeldJoint_SetAngularHertz(b3JointId jointId, float hertz)
Set the weld joint angular stiffness in Hertz. 0 is rigid.
void b3WeldJoint_SetLinearDampingRatio(b3JointId jointId, float dampingRatio)
Set the weld joint linear damping ratio (non-dimensional).
float b3WeldJoint_GetLinearDampingRatio(b3JointId jointId)
Get the weld joint linear damping ratio (non-dimensional).
void b3WeldJoint_SetAngularDampingRatio(b3JointId jointId, float dampingRatio)
Set weld joint angular damping ratio, non-dimensional.
b3JointId b3CreateWeldJoint(b3WorldId worldId, const b3WeldJointDef *def)
Create a weld joint.
Weld joint definition Connects two bodies together rigidly.
Definition types.h:916
void b3WheelJoint_EnableSpinMotor(b3JointId jointId, bool flag)
Enable/disable the wheel joint motor.
float b3WheelJoint_GetUpperSuspensionLimit(b3JointId jointId)
Get the wheel joint upper limit.
float b3WheelJoint_GetSuspensionDampingRatio(b3JointId jointId)
Get the wheel joint damping ratio, non-dimensional.
b3JointId b3CreateWheelJoint(b3WorldId worldId, const b3WheelJointDef *def)
Create a wheel joint.
void b3WheelJoint_SetSuspensionLimits(b3JointId jointId, float lower, float upper)
Set the wheel joint limits.
bool b3WheelJoint_IsSteeringEnabled(b3JointId jointId)
Can the wheel steer?
void b3WheelJoint_SetSuspensionHertz(b3JointId jointId, float hertz)
Set the wheel joint stiffness in Hertz.
bool b3WheelJoint_IsSpinMotorEnabled(b3JointId jointId)
Is the wheel joint motor enabled?
float b3WheelJoint_GetSteeringHertz(b3JointId jointId)
Get the wheel joint steering stiffness in Hertz.
void b3WheelJoint_EnableSuspensionLimit(b3JointId jointId, bool flag)
Enable/disable the wheel joint limit.
float b3WheelJoint_GetTargetSteeringAngle(b3JointId jointId)
Get the wheel joint target steering angle in radians.
float b3WheelJoint_GetLowerSteeringLimit(b3JointId jointId)
Get the wheel joint lower steering limit in radians.
bool b3WheelJoint_IsSuspensionLimitEnabled(b3JointId jointId)
Is the wheel joint limit enabled?
bool b3WheelJoint_IsSuspensionEnabled(b3JointId jointId)
Is the wheel joint spring enabled?
void b3WheelJoint_SetSteeringHertz(b3JointId jointId, float hertz)
Set the wheel joint steering stiffness in Hertz.
bool b3WheelJoint_IsSteeringLimitEnabled(b3JointId jointId)
Is the wheel joint steering limit enabled?
void b3WheelJoint_SetMaxSteeringTorque(b3JointId jointId, float torque)
Set the wheel joint maximum steering torque in N*m.
void b3WheelJoint_SetTargetSteeringAngle(b3JointId jointId, float radians)
Set the wheel joint target steering angle in radians.
void b3WheelJoint_SetSuspensionDampingRatio(b3JointId jointId, float dampingRatio)
Set the wheel joint damping ratio, non-dimensional.
float b3WheelJoint_GetSuspensionHertz(b3JointId jointId)
Get the wheel joint stiffness in Hertz.
void b3WheelJoint_SetSteeringDampingRatio(b3JointId jointId, float dampingRatio)
Set the wheel joint steering damping ratio, non-dimensional.
void b3WheelJoint_SetSpinMotorSpeed(b3JointId jointId, float speed)
Set the wheel joint motor speed in radians per second.
float b3WheelJoint_GetMaxSpinTorque(b3JointId jointId)
Get the wheel joint maximum motor torque, usually in newton-meters.
float b3WheelJoint_GetLowerSuspensionLimit(b3JointId jointId)
Get the wheel joint lower limit.
void b3WheelJoint_SetMaxSpinTorque(b3JointId jointId, float torque)
Set the wheel joint maximum motor torque, usually in newton-meters.
float b3WheelJoint_GetSpinTorque(b3JointId jointId)
Get the wheel joint current motor torque, usually in newton-meters.
float b3WheelJoint_GetSteeringTorque(b3JointId jointId)
Get the current steering torque in N*m.
float b3WheelJoint_GetUpperSteeringLimit(b3JointId jointId)
Get the wheel joint upper steering limit in radians.
float b3WheelJoint_GetMaxSteeringTorque(b3JointId jointId)
Get the wheel joint maximum steering torque in N*m.
void b3WheelJoint_EnableSteering(b3JointId jointId, bool flag)
Enable/disable wheel steering. Steering allows the wheel to rotate about the suspension axis.
void b3WheelJoint_EnableSuspension(b3JointId jointId, bool flag)
Enable/disable the wheel joint spring.
float b3WheelJoint_GetSteeringDampingRatio(b3JointId jointId)
Get the wheel joint steering damping ratio, non-dimensional.
float b3WheelJoint_GetSpinMotorSpeed(b3JointId jointId)
Get the wheel joint motor speed in radians per second.
float b3WheelJoint_GetSpinSpeed(b3JointId jointId)
Get the current spin speed in radians per second.
float b3WheelJoint_GetSteeringAngle(b3JointId jointId)
Get the current steering angle in radians.
void b3WheelJoint_SetSteeringLimits(b3JointId jointId, float lowerRadians, float upperRadians)
Set the wheel joint steering limits in radians.
void b3WheelJoint_EnableSteeringLimit(b3JointId jointId, bool flag)
Enable/disable the wheel joint steering limit.
Wheel joint definition Body A is the chassis and body B is the wheel.
Definition types.h:944
float b3World_GetRestitutionThreshold(b3WorldId worldId)
Get the restitution speed threshold. Usually in meters per second.
void b3World_SetRestitutionCallback(b3WorldId worldId, b3RestitutionCallback *callback)
Set the restitution callback. Passing NULL resets to default.
void b3World_SetMaximumLinearSpeed(b3WorldId worldId, float maximumLinearSpeed)
Set the maximum linear speed. Usually in m/s.
void b3World_Draw(b3WorldId worldId, b3DebugDraw *draw, uint64_t maskBits)
Call this to draw shapes and other debug draw data.
bool b3PreSolveFcn(b3ShapeId shapeIdA, b3ShapeId shapeIdB, b3Pos point, b3Vec3 normal, void *context)
Prototype for a pre-solve callback.
Definition types.h:88
void b3World_SetPreSolveCallback(b3WorldId worldId, b3PreSolveFcn *fcn, void *context)
Register the pre-solve callback. This is optional.
void b3World_SetHitEventThreshold(b3WorldId worldId, float value)
Adjust the hit event threshold.
b3Vec3 b3World_GetGravity(b3WorldId worldId)
Get the gravity vector.
b3Capacity b3World_GetMaxCapacity(b3WorldId worldId)
Get max capacity. This can be used with b3WorldDef to avoid run-time allocations and copies.
void b3World_CollideMover(b3WorldId worldId, b3Pos origin, const b3Capsule *mover, b3QueryFilter filter, b3PlaneResultFcn *fcn, void *context)
Collide a capsule mover with the world, gathering collision planes that can be fed to b3SolvePlanes.
float b3World_CastMover(b3WorldId worldId, b3Pos origin, const b3Capsule *mover, b3Vec3 translation, b3QueryFilter filter, b3MoverFilterFcn *fcn, void *context)
Cast a capsule mover through the world.
b3TreeStats b3World_OverlapShape(b3WorldId worldId, b3Pos origin, const b3ShapeProxy *proxy, b3QueryFilter filter, b3OverlapResultFcn *fcn, void *context)
Overlap test for all shapes that overlap the provided shape proxy.
void b3World_SetContactTuning(b3WorldId worldId, float hertz, float dampingRatio, float contactSpeed)
Adjust contact tuning parameters.
void b3World_Dump(b3WorldId worldId)
Dump world to a text file. Meshes are saved to binary b3m files.
int b3World_GetWorkerCount(b3WorldId worldId)
Get the worker count.
bool b3CustomFilterFcn(b3ShapeId shapeIdA, b3ShapeId shapeIdB, void *context)
Prototype for a contact filter callback.
Definition types.h:73
b3RayResult b3World_CastRayClosest(b3WorldId worldId, b3Pos origin, b3Vec3 translation, b3QueryFilter filter)
Cast a ray into the world to collect the closest hit.
float b3World_GetHitEventThreshold(b3WorldId worldId)
Get the hit event speed threshold. Usually in meters per second.
b3WorldId b3CreateWorld(const b3WorldDef *def)
Create a world for rigid body simulation.
bool b3World_IsSleepingEnabled(b3WorldId worldId)
Is body sleeping enabled?
void b3World_EnableContinuous(b3WorldId worldId, bool flag)
Enable/disable continuous collision between dynamic and static bodies.
void b3World_RebuildStaticTree(b3WorldId worldId)
This is for internal testing.
void b3World_SetContactRecycleDistance(b3WorldId worldId, float recycleDistance)
Set the contact point recycling distance.
bool b3World_IsContinuousEnabled(b3WorldId worldId)
Is continuous collision enabled?
b3BodyEvents b3World_GetBodyEvents(b3WorldId worldId)
Get the body events for the current time step. The event data is transient. Do not store a reference ...
float b3FrictionCallback(float frictionA, uint64_t userMaterialIdA, float frictionB, uint64_t userMaterialIdB)
Optional friction mixing callback.
Definition types.h:54
void b3World_SetCustomFilterCallback(b3WorldId worldId, b3CustomFilterFcn *fcn, void *context)
Register the custom filter callback. This is optional.
void b3World_EnableSpeculative(b3WorldId worldId, bool flag)
This is for internal testing.
bool b3World_IsWarmStartingEnabled(b3WorldId worldId)
Is constraint warm starting enabled?
b3JointEvents b3World_GetJointEvents(b3WorldId worldId)
Get the joint events for the current time step. The event data is transient. Do not store a reference...
float b3RestitutionCallback(float restitutionA, uint64_t userMaterialIdA, float restitutionB, uint64_t userMaterialIdB)
Optional restitution mixing callback.
Definition types.h:60
b3Counters b3World_GetCounters(b3WorldId worldId)
Get world counters and sizes.
float b3World_GetContactRecycleDistance(b3WorldId worldId)
Get the contact point recycling distance. Usually in meters.
void b3World_SetGravity(b3WorldId worldId, b3Vec3 gravity)
Set the gravity vector for the entire world.
bool b3OverlapResultFcn(b3ShapeId shapeId, void *context)
Prototype callback for overlap queries.
Definition types.h:95
b3ContactEvents b3World_GetContactEvents(b3WorldId worldId)
Get contact events for this current time step. The event data is transient. Do not store a reference ...
void b3DestroyWorld(b3WorldId worldId)
Destroy a world.
b3AABB b3World_GetBounds(b3WorldId worldId)
Get the world's bounds.
void b3World_SetWorkerCount(b3WorldId worldId, int count)
Set the worker count. Must be in the range [1, B3_MAX_WORKERS].
void b3World_Explode(b3WorldId worldId, const b3ExplosionDef *explosionDef)
Apply a radial explosion.
bool b3World_IsValid(b3WorldId id)
World id validation. Provides validation for up to 64K allocations.
b3TreeStats b3World_CastRay(b3WorldId worldId, b3Pos origin, b3Vec3 translation, b3QueryFilter filter, b3CastResultFcn *fcn, void *context)
Cast a ray into the world to collect shapes in the path of the ray.
float b3World_GetMaximumLinearSpeed(b3WorldId worldId)
Get the maximum linear speed. Usually in m/s.
float b3CastResultFcn(b3ShapeId shapeId, b3Pos point, b3Vec3 normal, float fraction, uint64_t userMaterialId, int triangleIndex, int childIndex, void *context)
Prototype callback for ray casts.
Definition types.h:115
b3Profile b3World_GetProfile(b3WorldId worldId)
Get the current world performance profile.
void * b3World_GetUserData(b3WorldId worldId)
Get the user data pointer.
b3TreeStats b3World_OverlapAABB(b3WorldId worldId, b3AABB aabb, b3QueryFilter filter, b3OverlapResultFcn *fcn, void *context)
Overlap test for all shapes that potentially overlap the provided AABB.
void b3World_SetFrictionCallback(b3WorldId worldId, b3FrictionCallback *callback)
Set the friction callback. Passing NULL resets to default.
void b3World_SetUserData(b3WorldId worldId, void *userData)
Set the user data pointer.
void b3World_DumpAwake(b3WorldId worldId)
Dump world to a text file.
int b3GetMaxWorldCount(void)
Get the maximum number of simultaneous worlds that have been created.
void b3World_EnableWarmStarting(b3WorldId worldId, bool flag)
Enable/disable constraint warm starting.
void b3World_SetRestitutionThreshold(b3WorldId worldId, float value)
Adjust the restitution threshold.
int b3GetWorldCount(void)
Get the current number of worlds.
void b3World_DumpMemoryStats(b3WorldId worldId)
Dump memory stats to log.
void b3World_EnableSleeping(b3WorldId worldId, bool flag)
Enable/disable sleep.
int b3World_GetAwakeBodyCount(b3WorldId worldId)
Get the number of awake bodies.
void b3World_DumpShapeBounds(b3WorldId worldId, b3BodyType type)
Dump shape bounds to box3d_bounds.txt.
b3TreeStats b3World_CastShape(b3WorldId worldId, b3Pos origin, const b3ShapeProxy *proxy, b3Vec3 translation, b3QueryFilter filter, b3CastResultFcn *fcn, void *context)
Cast a shape through the world.
void b3World_Step(b3WorldId worldId, float timeStep, int subStepCount)
Simulate a world for one time step.
b3SensorEvents b3World_GetSensorEvents(b3WorldId worldId)
Get sensor events for the current time step. The event data is transient. Do not store a reference to...
Optional world capacities that can be use to avoid run-time allocations.
Definition types.h:121
The explosion definition is used to configure options for explosions.
Definition types.h:1008
World definition used to create a simulation world.
Definition types.h:141
This struct is passed to b3World_Draw to draw a debug view of the simulation world.
Definition types.h:2948