14#if defined( BOX2D_DOUBLE_PRECISION )
18#define b2CreateWorld b2CreateWorldDoublePrecision
1078 float* upperForce );
1657 int minIntervalFrames );
float b2Body_GetSafetyFactor(b2BodyId bodyId)
Get the continuous collision safety factor. Non-dimensional.
void b2Body_SetTargetTransform(b2BodyId bodyId, b2WorldTransform target, float timeStep, bool wake)
Set the velocity to reach the given transform after a given time step.
void b2Body_Enable(b2BodyId bodyId)
Enable a body by adding it to the simulation. This is expensive.
void b2Body_SetAngularVelocity(b2BodyId bodyId, float angularVelocity)
Set the angular velocity of a body in radians per second.
float b2Body_GetSleepThreshold(b2BodyId bodyId)
Get the sleep threshold, usually in meters per second.
void * b2Body_GetUserData(b2BodyId bodyId)
Get the user data stored in a body.
bool b2Body_IsBullet(b2BodyId bodyId)
Is this body a bullet?
void b2Body_ApplyForce(b2BodyId bodyId, b2Vec2 force, b2Pos point, bool wake)
Apply a force at a world point.
void b2Body_ApplyForceToCenter(b2BodyId bodyId, b2Vec2 force, bool wake)
Apply a force to the center of mass.
float b2Body_GetRotationalInertia(b2BodyId bodyId)
Get the rotational inertia of the body, usually in kg*m^2.
void b2Body_ApplyLinearImpulse(b2BodyId bodyId, b2Vec2 impulse, b2Pos point, bool wake)
Apply an impulse at a point.
void b2Body_SetMotionLocks(b2BodyId bodyId, b2MotionLocks locks)
Set the motion locks on this body.
int b2Body_GetShapes(b2BodyId bodyId, b2ShapeId *shapeArray, int capacity)
Get the shape ids for all shapes on this body, up to the provided capacity.
void b2Body_EnableContactEvents(b2BodyId bodyId, bool flag)
Enable/disable contact events on all shapes.
b2Vec2 b2Body_GetLocalPoint(b2BodyId bodyId, b2Pos worldPoint)
Get a local point on a body given a world point.
void b2Body_SetGravityScale(b2BodyId bodyId, float gravityScale)
Adjust the gravity scale.
void b2Body_WakeTouching(b2BodyId bodyId)
Wake bodies touching this body. Works for static bodies.
void b2Body_SetSafetyFactor(b2BodyId bodyId, float safetyFactor)
Set the continuous collision safety factor.
b2WorldTransform b2Body_GetTransform(b2BodyId bodyId)
Get the world transform of a body.
float b2Body_GetMass(b2BodyId bodyId)
Get the mass of the body, usually in kilograms.
void b2Body_ApplyLinearImpulseToCenter(b2BodyId bodyId, b2Vec2 impulse, bool wake)
Apply an impulse to the center of mass.
void b2Body_ApplyTorque(b2BodyId bodyId, float torque, bool wake)
Apply a torque.
bool b2Body_IsAwake(b2BodyId bodyId)
int b2Body_GetShapeCount(b2BodyId bodyId)
Get the number of shapes on this body.
b2Rot b2Body_GetRotation(b2BodyId bodyId)
Get the world rotation of a body as a cosine/sine pair (complex number).
b2MotionLocks b2Body_GetMotionLocks(b2BodyId bodyId)
Get the motion locks for this body.
const char * b2Body_GetName(b2BodyId bodyId)
Get the body name.
float b2Body_GetLinearDamping(b2BodyId bodyId)
Get the current linear damping.
void b2Body_SetTransform(b2BodyId bodyId, b2Pos position, b2Rot rotation)
Set the world transform of a body.
bool b2Body_IsSleepingEnabled(b2BodyId bodyId)
Returns true if sleeping is enabled for this body.
b2Vec2 b2Body_GetWorldPointVelocity(b2BodyId bodyId, b2Pos worldPoint)
Get the linear velocity of a world point attached to a body. Usually in meters per second.
int b2Body_GetJoints(b2BodyId bodyId, b2JointId *jointArray, int capacity)
Get the joint ids for all joints on this body, up to the provided capacity.
b2Vec2 b2Body_GetLinearVelocity(b2BodyId bodyId)
Get the linear velocity of a body's center of mass. Usually in meters per second.
b2BodyType
The body simulation type.
Definition types.h:190
bool b2Body_IsContactRecyclingEnabled(b2BodyId bodyId)
Is contact recycling enabled on this body?
int b2Body_GetContactData(b2BodyId bodyId, b2ContactData *contactData, int capacity)
Get the touching contact data for a body.
void b2Body_EnableContactRecycling(b2BodyId bodyId, bool flag)
Enable or disable contact recycling for this body.
b2Pos b2Body_GetWorldCenter(b2BodyId bodyId)
Get the center of mass position of the body in world space.
void b2Body_SetSleepThreshold(b2BodyId bodyId, float sleepThreshold)
Set the sleep threshold, usually in meters per second.
void b2Body_Disable(b2BodyId bodyId)
Disable a body by removing it completely from the simulation. This is expensive.
void b2Body_SetName(b2BodyId bodyId, const char *name)
Set the body name. See B2_NAME_LENGTH.
float b2Body_GetMaxExtent(b2BodyId bodyId)
The maximum distance from any point on the body shapes to the center of mass.
b2Vec2 b2Body_GetWorldVector(b2BodyId bodyId, b2Vec2 localVector)
Get a world vector on a body given a local vector.
b2AABB b2Body_ComputeBounds(b2BodyId bodyId)
Get the current world AABB that contains all the attached shapes.
void b2Body_SetType(b2BodyId bodyId, b2BodyType type)
Change the body type.
b2Pos b2Body_GetWorldPoint(b2BodyId bodyId, b2Vec2 localPoint)
Get a world point on a body given a local point.
int b2Body_GetJointCount(b2BodyId bodyId)
Get the number of joints on this body.
void b2Body_SetMassData(b2BodyId bodyId, b2MassData massData)
Override the body's mass properties.
b2Pos b2Body_GetPosition(b2BodyId bodyId)
Get the world position of a body. This is the location of the body origin.
void b2Body_ApplyAngularImpulse(b2BodyId bodyId, float impulse, bool wake)
Apply an angular impulse.
float b2Body_GetAngularDamping(b2BodyId bodyId)
Get the current angular damping.
float b2Body_GetGravityScale(b2BodyId bodyId)
Get the current gravity scale.
void b2Body_EnableSleeping(b2BodyId bodyId, bool enableSleep)
Enable or disable sleeping for this body.
void b2Body_SetLinearDamping(b2BodyId bodyId, float linearDamping)
Adjust the linear damping. Normally this is set in b2BodyDef before creation.
void b2Body_SetBullet(b2BodyId bodyId, bool flag)
Set this body to be a bullet.
float b2Body_GetMaxExtentFromOrigin(b2BodyId bodyId)
The maximum distance from any point on the body shapes to the body origin. Conservative.
float b2Body_GetMinExtent(b2BodyId bodyId)
The minimum distance from any point on the body shapes to the center of mass.
void b2Body_SetAwake(b2BodyId bodyId, bool awake)
Wake a body from sleep.
b2Vec2 b2Body_GetLocalVector(b2BodyId bodyId, b2Vec2 worldVector)
Get a local vector on a body given a world vector.
int b2Body_GetContactCapacity(b2BodyId bodyId)
Get the maximum capacity required for retrieving all the touching contacts on a body.
void b2Body_SetAngularDamping(b2BodyId bodyId, float angularDamping)
Adjust the angular damping. Normally this is set in b2BodyDef before creation.
b2Vec2 b2Body_GetLocalPointVelocity(b2BodyId bodyId, b2Vec2 localPoint)
Get the linear velocity of a local point attached to a body. Usually in meters per second.
b2BodyId b2CreateBody(b2WorldId worldId, const b2BodyDef *def)
Create a rigid body given a definition.
void b2Body_ClearForces(b2BodyId bodyId)
Clear the force and torque on this body.
float b2Body_GetAngularVelocity(b2BodyId bodyId)
Get the angular velocity of a body in radians per second.
b2MassData b2Body_GetMassData(b2BodyId bodyId)
Get the mass data for a body.
void b2Body_UpdateMassFromShapes(b2BodyId bodyId)
This updates the mass properties to the sum of the mass properties of the shapes.
b2Vec2 b2Body_GetLocalCenter(b2BodyId bodyId)
Get the center of mass position of the body in local space.
b2WorldId b2Body_GetWorld(b2BodyId bodyId)
Get the world that owns this body.
void b2Body_SetUserData(b2BodyId bodyId, void *userData)
Set the user data for a body.
bool b2Body_IsValid(b2BodyId id)
Body identifier validation.
void b2Body_EnableHitEvents(b2BodyId bodyId, bool flag)
Enable/disable hit events on all shapes.
void b2Body_SetLinearVelocity(b2BodyId bodyId, b2Vec2 linearVelocity)
Set the linear velocity of a body. Usually in meters per second.
void b2DestroyBody(b2BodyId bodyId)
Destroy a rigid body given an id.
b2BodyType b2Body_GetType(b2BodyId bodyId)
Get the body type: static, kinematic, or dynamic.
bool b2Body_IsEnabled(b2BodyId bodyId)
Returns true if this body is enabled.
A body definition holds all the data needed to construct a rigid body.
Definition types.h:223
Motion locks to restrict the body movement.
Definition types.h:207
b2SurfaceMaterial b2Chain_GetSurfaceMaterial(b2ChainId chainId, int segmentIndex)
Get a chain material by segment index.
int b2Chain_GetSegments(b2ChainId chainId, b2ShapeId *segmentArray, int capacity)
Fill a user array with chain segment shape ids up to the specified capacity.
void b2Chain_SetAllSurfaceMaterials(b2ChainId chainId, const b2SurfaceMaterial *material)
Set the chain material on all segments.
int b2Chain_GetSegmentCount(b2ChainId chainId)
Get the number of segments on this chain.
b2WorldId b2Chain_GetWorld(b2ChainId chainId)
Get the world that owns this chain shape.
void b2DestroyChain(b2ChainId chainId)
Destroy a chain shape.
void b2Chain_SetSurfaceMaterial(b2ChainId chainId, const b2SurfaceMaterial *material, int segmentIndex)
Set a chain material by segment index.
bool b2Chain_IsValid(b2ChainId id)
Chain identifier validation. Provides validation for up to 64K allocations.
b2ChainId b2CreateChain(b2BodyId bodyId, const b2ChainDef *def)
Create a chain shape.
Used to create a chain of line segments.
Definition types.h:510
bool b2PlaneResultCallbackFcn(b2ShapeId shapeId, const b2PlaneResult *plane, void *context)
Used to collect collision planes for character movers.
Definition types.h:1334
float b2DistanceJoint_GetTargetMotorSpeed(b2JointId jointId)
Get the distance joint motor speed, usually in meters per second.
void b2DistanceJoint_SetSpringDampingRatio(b2JointId jointId, float dampingRatio)
Set the spring damping ratio, non-dimensional.
float b2DistanceJoint_GetUpperLimit(b2JointId jointId)
Get the distance joint maximum length.
float b2DistanceJoint_GetMaxMotorForce(b2JointId jointId)
Get the distance joint maximum motor force, usually in newtons.
float b2DistanceJoint_GetCurrentMotorForce(b2JointId jointId)
Get the distance joint current motor force, usually in newtons.
void b2DistanceJoint_EnableSpring(b2JointId jointId, bool enableSpring)
Enable/disable the distance joint spring. When disabled the distance joint is rigid.
float b2DistanceJoint_GetSpringDampingRatio(b2JointId jointId)
Get the spring damping ratio.
float b2DistanceJoint_GetSpringForce(b2JointId jointId)
Get the current spring force.
float b2DistanceJoint_GetSpringHertz(b2JointId jointId)
Get the spring Hertz.
bool b2DistanceJoint_IsSpringEnabled(b2JointId jointId)
Is the distance joint spring enabled?
void b2DistanceJoint_EnableMotor(b2JointId jointId, bool enableMotor)
Enable/disable the distance joint motor.
void b2DistanceJoint_SetSpringHertz(b2JointId jointId, float hertz)
Set the spring stiffness in Hertz.
b2JointId b2CreateDistanceJoint(b2WorldId worldId, const b2DistanceJointDef *def)
Create a distance joint.
void b2DistanceJoint_SetSpringForceRange(b2JointId jointId, float lowerForce, float upperForce)
Set the force range for the spring.
bool b2DistanceJoint_IsLimitEnabled(b2JointId jointId)
Is the distance joint limit enabled?
void b2DistanceJoint_GetSpringForceRange(b2JointId jointId, float *lowerForce, float *upperForce)
Get the force range for the spring.
float b2DistanceJoint_GetCurrentLength(b2JointId jointId)
Get the current length of a distance joint.
void b2DistanceJoint_SetMaxMotorForce(b2JointId jointId, float force)
Set the distance joint maximum motor force, usually in newtons.
bool b2DistanceJoint_IsMotorEnabled(b2JointId jointId)
Is the distance joint motor enabled?
void b2DistanceJoint_SetRestLength(b2JointId jointId, float length)
Set the rest length of a distance joint.
void b2DistanceJoint_EnableLimit(b2JointId jointId, bool enableLimit)
Enable joint limit.
float b2DistanceJoint_GetLowerLimit(b2JointId jointId)
Get the distance joint minimum length.
float b2DistanceJoint_GetRestLength(b2JointId jointId)
Get the rest length of a distance joint.
void b2DistanceJoint_SetTargetMotorSpeed(b2JointId jointId, float motorSpeed)
Set the distance joint motor speed, usually in meters per second.
void b2DistanceJoint_SetLimits(b2JointId jointId, float minLength, float maxLength)
Set the minimum and maximum length parameters of a distance joint.
Distance joint definition Connects a point on body A with a point on body B by a segment.
Definition types.h:670
Body events are buffered in the Box2D world and are available as event arrays after the time step is ...
Definition types.h:1215
Joint events are buffered in the world and are available as event arrays after the time step is compl...
Definition types.h:1237
Sensor events are buffered in the world and are available as begin/end overlap event arrays after the...
Definition types.h:1088
b2JointId b2CreateFilterJoint(b2WorldId worldId, const b2FilterJointDef *def)
Create a filter joint.
A filter joint is used to disable collision between two specific bodies.
Definition types.h:723
b2CastOutput b2WorldCastOutput
This is an alias in single precision.
Definition collision.h:109
A solid capsule can be viewed as two semicircles connected by a rectangle.
Definition collision.h:138
A line segment with one-sided collision.
Definition collision.h:186
A solid circle.
Definition collision.h:128
This holds the mass data computed for a shape.
Definition collision.h:115
A solid convex polygon.
Definition collision.h:155
A line segment with two-sided collision.
Definition collision.h:174
A distance proxy is used by the GJK algorithm.
Definition collision.h:44
Body id references a body instance. This should be treated as an opaque handle.
Definition id.h:46
Chain id references a chain instance. This should be treated as an opaque handle.
Definition id.h:62
Joint id references a joint instance. This should be treated as an opaque handle.
Definition id.h:70
Shape id references a shape instance. This should be treated as an opaque handle.
Definition id.h:54
World id references a world instance. This should be treated as an opaque handle.
Definition id.h:39
b2JointType
Joint type enumeration.
Definition types.h:612
bool b2Joint_IsValid(b2JointId id)
Joint identifier validation. Provides validation for up to 64K allocations.
void b2Joint_SetUserData(b2JointId jointId, void *userData)
Set the user data on a joint.
void b2Joint_WakeBodies(b2JointId jointId)
Wake the bodies connected to this joint.
b2BodyId b2Joint_GetBodyA(b2JointId jointId)
Get body A id on a joint.
void b2Joint_SetLocalFrameB(b2JointId jointId, b2Transform localFrame)
Set the local frame on bodyB.
bool b2Joint_GetCollideConnected(b2JointId jointId)
Is collision allowed between connected bodies?
void b2Joint_GetConstraintTuning(b2JointId jointId, float *hertz, float *dampingRatio)
Get the joint constraint tuning. Advanced feature.
void * b2Joint_GetUserData(b2JointId jointId)
Get the user data on a joint.
b2Transform b2Joint_GetLocalFrameA(b2JointId jointId)
Get the local frame on bodyA.
void b2Joint_SetCollideConnected(b2JointId jointId, bool shouldCollide)
Toggle collision between connected bodies.
float b2Joint_GetLinearSeparation(b2JointId jointId)
Get the current linear separation error for this joint.
b2Transform b2Joint_GetLocalFrameB(b2JointId jointId)
Get the local frame on bodyB.
b2JointType b2Joint_GetType(b2JointId jointId)
Get the joint type.
float b2Joint_GetAngularSeparation(b2JointId jointId)
Get the current angular separation error for this joint.
float b2Joint_GetConstraintTorque(b2JointId jointId)
Get the current constraint torque for this joint. Usually in Newton * meters.
float b2Joint_GetForceThreshold(b2JointId jointId)
Get the force threshold for joint events (Newtons).
void b2Joint_SetForceThreshold(b2JointId jointId, float threshold)
Set the force threshold for joint events (Newtons).
void b2Joint_SetTorqueThreshold(b2JointId jointId, float threshold)
Set the torque threshold for joint events (N-m).
b2Vec2 b2Joint_GetConstraintForce(b2JointId jointId)
Get the current constraint force for this joint. Usually in Newtons.
void b2Joint_SetLocalFrameA(b2JointId jointId, b2Transform localFrame)
Set the local frame on bodyA.
b2WorldId b2Joint_GetWorld(b2JointId jointId)
Get the world that owns this joint.
void b2Joint_SetConstraintTuning(b2JointId jointId, float hertz, float dampingRatio)
Set the joint constraint tuning.
float b2Joint_GetTorqueThreshold(b2JointId jointId)
Get the torque threshold for joint events (N-m).
void b2DestroyJoint(b2JointId jointId)
Destroy a joint.
b2BodyId b2Joint_GetBodyB(b2JointId jointId)
Get body B id on a joint.
b2Vec2 b2Pos
Alias in single precision.
Definition math_types.h:61
b2Transform b2WorldTransform
Alias in single precision.
Definition math_types.h:64
Axis-aligned bounding box.
Definition math_types.h:77
2D rotation This is similar to using a complex number for rotation
Definition math_types.h:29
2D vector This can be used to represent a point or free vector
Definition math_types.h:14
float b2MotorJoint_GetLinearDampingRatio(b2JointId jointId)
Get the spring linear damping ratio.
float b2MotorJoint_GetAngularVelocity(b2JointId jointId)
Get the desired relative angular velocity in radians per second.
b2JointId b2CreateMotorJoint(b2WorldId worldId, const b2MotorJointDef *def)
Create a motor joint.
float b2MotorJoint_GetMaxSpringForce(b2JointId jointId)
Get the maximum spring force in newtons.
void b2MotorJoint_SetMaxVelocityTorque(b2JointId jointId, float maxTorque)
Set the motor joint maximum torque, usually in newton-meters.
void b2MotorJoint_SetMaxSpringTorque(b2JointId jointId, float maxTorque)
Set the maximum spring torque in newtons * meters.
void b2MotorJoint_SetLinearDampingRatio(b2JointId jointId, float damping)
Set the spring linear damping ratio. Use 1.0 for critical damping.
float b2MotorJoint_GetAngularDampingRatio(b2JointId jointId)
Get the spring angular damping ratio.
float b2MotorJoint_GetAngularHertz(b2JointId jointId)
Get the spring angular hertz stiffness.
void b2MotorJoint_SetAngularDampingRatio(b2JointId jointId, float damping)
Set the spring angular damping ratio. Use 1.0 for critical damping.
void b2MotorJoint_SetMaxSpringForce(b2JointId jointId, float maxForce)
Set the maximum spring force in newtons.
float b2MotorJoint_GetMaxSpringTorque(b2JointId jointId)
Get the maximum spring torque in newtons * meters.
void b2MotorJoint_SetAngularVelocity(b2JointId jointId, float velocity)
Set the desired relative angular velocity in radians per second.
void b2MotorJoint_SetMaxVelocityForce(b2JointId jointId, float maxForce)
Set the motor joint maximum force, usually in newtons.
void b2MotorJoint_SetLinearHertz(b2JointId jointId, float hertz)
Set the spring linear hertz stiffness.
void b2MotorJoint_SetLinearVelocity(b2JointId jointId, b2Vec2 velocity)
Set the desired relative linear velocity in meters per second.
float b2MotorJoint_GetMaxVelocityTorque(b2JointId jointId)
Get the motor joint maximum torque, usually in newton-meters.
b2Vec2 b2MotorJoint_GetLinearVelocity(b2JointId jointId)
Get the desired relative linear velocity in meters per second.
float b2MotorJoint_GetMaxVelocityForce(b2JointId jointId)
Get the motor joint maximum force, usually in newtons.
void b2MotorJoint_SetAngularHertz(b2JointId jointId, float hertz)
Set the spring angular hertz stiffness.
float b2MotorJoint_GetLinearHertz(b2JointId jointId)
Get the spring linear hertz stiffness.
A motor joint is used to control the relative velocity and/or transform between two bodies.
Definition types.h:739
b2Vec2 b2MoverJoint_GetLinearVelocity(b2JointId jointId)
Get the desired relative linear velocity in meters per second.
b2Vec2 b2MoverJoint_GetMaxVelocityForce(b2JointId jointId)
Get the joint maximum force, usually in newtons.
void b2MoverJoint_SetMaxVelocityForce(b2JointId jointId, b2Vec2 maxForce)
Set the joint maximum force, usually in newtons.
void b2MoverJoint_SetLinearVelocity(b2JointId jointId, b2Vec2 velocity)
Set the desired relative linear velocity in meters per second.
b2JointId b2CreateMoverJoint(b2WorldId worldId, const b2MoverJointDef *def)
Create a mover joint.
A mover joint is used to move a dynamic character mover through velocity commands.
Definition types.h:785
float b2PogoJoint_GetSpringHertz(b2JointId jointId)
Get the spring Hertz.
void b2PogoJoint_SetSpringHertz(b2JointId jointId, float hertz)
Set the spring stiffness in Hertz.
void b2PogoJoint_SetRestLength(b2JointId jointId, float length)
Set the rest length of a pogo joint.
float b2PogoJoint_GetImpulse(b2JointId jointId)
Get the internal pogo impulse.
float b2PogoJoint_GetCurrentSpeed(b2JointId jointId)
Get the internal pogo velocity.
b2JointId b2CreatePogoJoint(b2WorldId worldId, const b2PogoJointDef *def)
Create a pogo joint.
float b2PogoJoint_GetSpringDampingRatio(b2JointId jointId)
Get the spring damping ratio.
void b2PogoJoint_SetSpringDampingRatio(b2JointId jointId, float dampingRatio)
Set the spring damping ratio, non-dimensional.
float b2PogoJoint_GetCurrentLength(b2JointId jointId)
Get the current length of the pogo.
float b2PogoJoint_GetRestLength(b2JointId jointId)
Get the rest length of a pogo joint.
Pogo joint definition.
Definition types.h:806
float b2PrismaticJoint_GetSpringHertz(b2JointId jointId)
Get the prismatic joint stiffness in Hertz.
float b2PrismaticJoint_GetCurrentTranslation(b2JointId jointId)
Get the current joint translation, usually in meters.
float b2PrismaticJoint_GetMaxMotorForce(b2JointId jointId)
Get the prismatic joint maximum motor force, usually in newtons.
void b2PrismaticJoint_SetLimits(b2JointId jointId, float lower, float upper)
Set the prismatic joint limits.
float b2PrismaticJoint_GetUpperLimit(b2JointId jointId)
Get the prismatic joint upper limit.
void b2PrismaticJoint_SetMaxMotorForce(b2JointId jointId, float force)
Set the prismatic joint maximum motor force, usually in newtons.
void b2PrismaticJoint_SetSpringHertz(b2JointId jointId, float hertz)
Set the prismatic joint stiffness in Hertz.
b2JointId b2CreatePrismaticJoint(b2WorldId worldId, const b2PrismaticJointDef *def)
Create a prismatic (slider) joint.
void b2PrismaticJoint_EnableSpring(b2JointId jointId, bool enableSpring)
Enable/disable the joint spring.
bool b2PrismaticJoint_IsSpringEnabled(b2JointId jointId)
Is the prismatic joint spring enabled or not?
float b2PrismaticJoint_GetCurrentMotorForce(b2JointId jointId)
Get the prismatic joint current motor force, usually in newtons.
void b2PrismaticJoint_EnableMotor(b2JointId jointId, bool enableMotor)
Enable/disable a prismatic joint motor.
bool b2PrismaticJoint_IsMotorEnabled(b2JointId jointId)
Is the prismatic joint motor enabled?
void b2PrismaticJoint_EnableLimit(b2JointId jointId, bool enableLimit)
Enable/disable a prismatic joint limit.
float b2PrismaticJoint_GetCurrentSpeed(b2JointId jointId)
Get the current joint translation velocity, usually in meters per second.
void b2PrismaticJoint_SetTargetMotorSpeed(b2JointId jointId, float motorSpeed)
Set the prismatic joint motor speed, usually in meters per second.
float b2PrismaticJoint_GetTargetMotorSpeed(b2JointId jointId)
Get the prismatic joint motor speed, usually in meters per second.
float b2PrismaticJoint_GetTargetTranslation(b2JointId jointId)
Get the prismatic joint spring target translation, usually in meters.
void b2PrismaticJoint_SetSpringDampingRatio(b2JointId jointId, float dampingRatio)
Set the prismatic joint damping ratio (non-dimensional).
void b2PrismaticJoint_SetTargetTranslation(b2JointId jointId, float translation)
Set the prismatic joint spring target translation, usually in meters.
bool b2PrismaticJoint_IsLimitEnabled(b2JointId jointId)
Is the prismatic joint limit enabled?
float b2PrismaticJoint_GetLowerLimit(b2JointId jointId)
Get the prismatic joint lower limit.
float b2PrismaticJoint_GetSpringDampingRatio(b2JointId jointId)
Get the prismatic spring damping ratio (non-dimensional).
Prismatic joint definition Body B may slide along the x-axis in local frame A.
Definition types.h:849
const uint8_t * b2Recording_GetData(const b2Recording *recording)
Get a pointer to the recorded bytes, for saving to a file or transmitting.
void b2World_StopRecording(b2WorldId worldId)
Stop recording.
bool b2Recording_SaveToFile(const b2Recording *recording, const char *path)
Save a recording buffer to a file.
void b2DestroyRecording(b2Recording *recording)
Destroy a recording buffer and free its memory.
void b2World_StartRecording(b2WorldId worldId, b2Recording *recording)
Begin recording the world into recording.
struct b2Recording b2Recording
Opaque handle for a recording buffer.
Definition box2d.h:283
b2Recording * b2CreateRecording(int byteCapacity)
Create a recording buffer.
b2Recording * b2CreateRecordingFromFile(const char *path)
Load a recording from a file into a new recording buffer.
int b2Recording_GetSize(const b2Recording *recording)
Get the number of recorded bytes.
b2ReplayQueryInfo b2Replay_GetFrameQuery(const b2Replay *player, int index)
Get a recorded query from the most recently replayed frame by index.
bool b2Replay_IsAtEnd(const b2Replay *player)
Returns true once the end of the recording has been reached.
bool b2ValidateRecording(const void *data, int size, int workerCount)
Replay a recording by re-running the engine and asserting recorded ids and state match.
int b2Replay_GetKeyframeMinInterval(const b2Replay *player)
Get the finest keyframe spacing in frames.
int b2Replay_GetFrameQueryCount(const b2Replay *player)
Get the number of spatial queries recorded for the most recently replayed frame.
struct b2Replay b2Replay
Opaque handle for incremental playback of a recording.
Definition types.h:1608
b2WorldId b2Replay_GetWorldId(const b2Replay *player)
Get the id of the replayed world.
void b2Replay_SetKeyframePolicy(b2Replay *player, size_t budgetBytes, int minIntervalFrames)
Tune the keyframe ring used to speed up backward seeking.
b2BodyId b2Replay_GetBodyId(const b2Replay *player, int index)
Get a tracked body by creation ordinal.
bool b2Replay_HasDiverged(const b2Replay *player)
Returns true if a recorded state hash failed to reproduce, meaning replay diverged.
int b2Replay_GetDivergeFrame(const b2Replay *player)
Get the first step at which replay diverged, or -1 if it has not diverged.
void b2Replay_SeekFrame(b2Replay *player, int targetFrame)
Seek to a recorded step.
size_t b2Replay_GetKeyframeBytes(const b2Replay *player)
Get the memory currently held by keyframe snapshots, in bytes.
b2ReplayQueryHit b2Replay_GetFrameQueryHit(const b2Replay *player, int queryIndex, int hitIndex)
Get one result of a recorded query from the most recently replayed frame.
b2ReplayInfo b2Replay_GetInfo(const b2Replay *player)
Get static metadata for the recording (frame count, recorded tuning, time).
size_t b2Replay_GetKeyframeBudget(const b2Replay *player)
Get the keyframe memory budget in bytes.
int b2Replay_GetBodyCount(const b2Replay *player)
Get the number of body slots tracked for the outliner.
void b2DestroyReplay(b2Replay *player)
Close a player and free its replay world and file buffer.
b2Replay * b2CreateReplay(const void *data, int size, int workerCount)
Open a recording for incremental playback and replay up to the first step.
bool b2Replay_StepFrame(b2Replay *player)
Advance the replay by one recorded step.
void b2Replay_DrawFrameQueries(b2Replay *player, b2DebugDraw *draw, int queryIndex)
Draw spatial queries recorded during the most recently replayed frame.
int b2Replay_GetFrame(const b2Replay *player)
Get the number of steps replayed so far.
void b2Replay_Restart(b2Replay *player)
Rewind the player to the first step, recreating the replay world from the file.
int b2Replay_GetKeyframeInterval(const b2Replay *player)
Get the current keyframe spacing in frames.
Static metadata describing a recording, resolved once when the player opens the file.
Definition types.h:1613
One result of a recorded spatial query.
Definition types.h:1650
A spatial query recorded during a replayed frame, exposed for inspection.
Definition types.h:1638
void b2RevoluteJoint_SetTargetAngle(b2JointId jointId, float angle)
Set the revolute joint spring target angle, radians.
float b2RevoluteJoint_GetCurrentMotorTorque(b2JointId jointId)
Get the revolute joint current motor torque, usually in newton-meters.
void b2RevoluteJoint_SetMaxMotorTorque(b2JointId jointId, float torque)
Set the revolute joint maximum motor torque, usually in newton-meters.
void b2RevoluteJoint_SetLimits(b2JointId jointId, float lower, float upper)
Set the revolute joint limits in radians.
float b2RevoluteJoint_GetSpringDampingRatio(b2JointId jointId)
Get the revolute joint spring damping ratio, non-dimensional.
float b2RevoluteJoint_GetTargetMotorSpeed(b2JointId jointId)
Get the revolute joint motor speed in radians per second.
float b2RevoluteJoint_GetMaxMotorTorque(b2JointId jointId)
Get the revolute joint maximum motor torque, usually in newton-meters.
bool b2RevoluteJoint_IsMotorEnabled(b2JointId jointId)
Is the revolute joint motor enabled?
bool b2RevoluteJoint_IsLimitEnabled(b2JointId jointId)
Is the revolute joint limit enabled?
float b2RevoluteJoint_GetLowerLimit(b2JointId jointId)
Get the revolute joint lower limit in radians.
float b2RevoluteJoint_GetTargetAngle(b2JointId jointId)
Get the revolute joint spring target angle, radians.
float b2RevoluteJoint_GetCurrentAngle(b2JointId jointId)
Get the revolute joint current angle in radians.
b2JointId b2CreateRevoluteJoint(b2WorldId worldId, const b2RevoluteJointDef *def)
Create a revolute joint.
void b2RevoluteJoint_SetSpringDampingRatio(b2JointId jointId, float dampingRatio)
Set the revolute joint spring damping ratio, non-dimensional.
bool b2RevoluteJoint_IsSpringEnabled(b2JointId jointId)
Is the revolute angular spring enabled?
float b2RevoluteJoint_GetSpringHertz(b2JointId jointId)
Get the revolute joint spring stiffness in Hertz.
void b2RevoluteJoint_SetSpringHertz(b2JointId jointId, float hertz)
Set the revolute joint spring stiffness in Hertz.
void b2RevoluteJoint_EnableMotor(b2JointId jointId, bool enableMotor)
Enable/disable a revolute joint motor.
void b2RevoluteJoint_EnableLimit(b2JointId jointId, bool enableLimit)
Enable/disable the revolute joint limit.
float b2RevoluteJoint_GetCurrentSpeed(b2JointId jointId)
Get the current revolute joint motor speed in radians per second.
float b2RevoluteJoint_GetUpperLimit(b2JointId jointId)
Get the revolute joint upper limit in radians.
void b2RevoluteJoint_SetTargetMotorSpeed(b2JointId jointId, float motorSpeed)
Set the revolute joint motor speed in radians per second.
void b2RevoluteJoint_EnableSpring(b2JointId jointId, bool enableSpring)
Enable/disable the revolute joint spring.
Revolute joint definition A point on body B is fixed to a point on body A.
Definition types.h:896
uint64_t b2Shape_GetUserMaterial(b2ShapeId shapeId)
Get the user material identifier.
b2ChainSegment b2Shape_GetChainSegment(b2ShapeId shapeId)
Get a copy of the shape's chain segment.
b2BodyId b2Shape_GetBody(b2ShapeId shapeId)
Get the id of the body that a shape is attached to.
bool b2Shape_TestPoint(b2ShapeId shapeId, b2Pos point)
Test a world point for overlap with a shape.
void b2Shape_SetFriction(b2ShapeId shapeId, float friction)
Set the friction on a shape.
b2Capsule b2Shape_GetCapsule(b2ShapeId shapeId)
Get a copy of the shape's capsule. Asserts the type is correct.
void b2Shape_SetFilter(b2ShapeId shapeId, b2Filter filter)
Set the current filter.
void b2Shape_SetUserMaterial(b2ShapeId shapeId, uint64_t material)
Set the user material identifier.
b2ShapeId b2CreateChainSegmentShape(b2BodyId bodyId, const b2ShapeDef *def, const b2ChainSegment *chainSegment)
Create a chain segment shape and attach it to a body.
b2ShapeId b2CreateCircleShape(b2BodyId bodyId, const b2ShapeDef *def, const b2Circle *circle)
Create a circle shape and attach it to a body.
bool b2Shape_ArePreSolveEventsEnabled(b2ShapeId shapeId)
Returns true if pre-solve events are enabled.
b2MassData b2Shape_ComputeMassData(b2ShapeId shapeId)
Compute the mass data for a shape.
float b2Shape_GetDensity(b2ShapeId shapeId)
Get the density of a shape, usually in kg/m^2.
void b2Shape_SetSegment(b2ShapeId shapeId, const b2Segment *segment)
Allows you to change a shape to be a segment or update the current segment.
b2ShapeType b2Shape_GetType(b2ShapeId shapeId)
Get the type of a shape.
void b2Shape_SetUserData(b2ShapeId shapeId, void *userData)
Set the user data for a shape.
b2WorldCastOutput b2Shape_CastRay(b2ShapeId shapeId, b2Pos origin, b2Vec2 translation)
Ray cast a single shape.
b2ChainId b2Shape_GetParentChain(b2ShapeId shapeId)
Get the parent chain id if the shape type is a chain segment, otherwise returns b2_nullChainId.
b2AABB b2Shape_GetBounds(b2ShapeId shapeId)
Get the current world AABB.
void b2Shape_SetChainSegment(b2ShapeId shapeId, const b2ChainSegment *chainSegment)
Allows you to change a shape to be a loose chain segment or update the current chain segment.
void b2Shape_EnableHitEvents(b2ShapeId shapeId, bool flag)
Enable contact hit events for this shape.
void b2Shape_SetDensity(b2ShapeId shapeId, float density, bool updateBodyMass)
Set the mass density of a shape, usually in kg/m^2.
void b2Shape_ApplyWind(b2ShapeId shapeId, b2Vec2 wind, float drag, float lift, bool wake)
Apply a wind force to the body for this shape using the density of air.
b2Circle b2Shape_GetCircle(b2ShapeId shapeId)
Get a copy of the shape's circle. Asserts the type is correct.
bool b2Shape_IsSensor(b2ShapeId shapeId)
Returns true if the shape is a sensor.
b2ShapeType
Shape type.
Definition types.h:378
b2ShapeId b2CreateCapsuleShape(b2BodyId bodyId, const b2ShapeDef *def, const b2Capsule *capsule)
Create a capsule shape and attach it to a body.
void b2Shape_EnableSensorEvents(b2ShapeId shapeId, bool flag)
Enable sensor events for this shape.
void b2DestroyShape(b2ShapeId shapeId, bool updateBodyMass)
Destroy a shape.
int b2Shape_GetSensorData(b2ShapeId shapeId, b2ShapeId *visitorIds, int capacity)
Get the overlap data for a sensor shape computed during the previous world step.
int b2Shape_GetContactCapacity(b2ShapeId shapeId)
Get the maximum capacity required for retrieving all the touching contacts on a shape.
void b2Shape_SetCircle(b2ShapeId shapeId, const b2Circle *circle)
Allows you to change a shape to be a circle or update the current circle.
void b2Shape_SetCapsule(b2ShapeId shapeId, const b2Capsule *capsule)
Allows you to change a shape to be a capsule or update the current capsule.
bool b2Shape_AreContactEventsEnabled(b2ShapeId shapeId)
Returns true if contact events are enabled.
void * b2Shape_GetUserData(b2ShapeId shapeId)
Get the user data for a shape. This is useful when you get a shape id from an event or query.
void b2Shape_SetPolygon(b2ShapeId shapeId, const b2Polygon *polygon)
Allows you to change a shape to be a polygon or update the current polygon.
b2ShapeId b2CreatePolygonShape(b2BodyId bodyId, const b2ShapeDef *def, const b2Polygon *polygon)
Create a polygon shape and attach it to a body.
b2Polygon b2Shape_GetPolygon(b2ShapeId shapeId)
Get a copy of the shape's convex polygon. Asserts the type is correct.
float b2Shape_GetFriction(b2ShapeId shapeId)
Get the friction of a shape.
int b2Shape_GetSensorCapacity(b2ShapeId shapeId)
Get the maximum capacity required for retrieving all the overlapped shapes on a sensor shape.
float b2Shape_GetRestitution(b2ShapeId shapeId)
Get the shape restitution.
bool b2Shape_AreSensorEventsEnabled(b2ShapeId shapeId)
Returns true if sensor events are enabled.
void b2Shape_SetSurfaceMaterial(b2ShapeId shapeId, const b2SurfaceMaterial *surfaceMaterial)
Set the shape surface material.
int b2Shape_GetContactData(b2ShapeId shapeId, b2ContactData *contactData, int capacity)
Get the touching contact data for a shape.
bool b2Shape_AreHitEventsEnabled(b2ShapeId shapeId)
Returns true if hit events are enabled.
void b2Shape_EnableContactEvents(b2ShapeId shapeId, bool flag)
Enable contact events for this shape.
b2SurfaceMaterial b2Shape_GetSurfaceMaterial(b2ShapeId shapeId)
Get the shape surface material.
b2Filter b2Shape_GetFilter(b2ShapeId shapeId)
Get the shape filter.
b2ShapeId b2CreateSegmentShape(b2BodyId bodyId, const b2ShapeDef *def, const b2Segment *segment)
Create a line segment shape and attach it to a body.
b2Pos b2Shape_GetClosestPoint(b2ShapeId shapeId, b2Pos target)
Get the closest point on a shape to a target point. Target and result are world positions.
b2Segment b2Shape_GetSegment(b2ShapeId shapeId)
Get a copy of the shape's line segment. Asserts the type is correct.
bool b2Shape_IsValid(b2ShapeId id)
Shape identifier validation. Provides validation for up to 64K allocations.
b2WorldId b2Shape_GetWorld(b2ShapeId shapeId)
Get the world that owns this shape.
void b2Shape_SetRestitution(b2ShapeId shapeId, float restitution)
Set the shape restitution (bounciness).
void b2Shape_EnablePreSolveEvents(b2ShapeId shapeId, bool flag)
Enable pre-solve contact events for this shape.
This is used to filter collision on shapes.
Definition types.h:322
The query filter is used to filter collisions between queries and shapes.
Definition types.h:362
Used to create a shape.
Definition types.h:433
The surface material groups together parameters related to the shape surface, which is the 2D boundar...
Definition types.h:402
bool b2World_RestoreFromSnapshot(b2WorldId worldId, const uint8_t *image, int size)
Restore a world's simulation state from a snapshot image.
b2WorldId b2CreateWorldFromSnapshot(const uint8_t *image, int size, int workerCount)
Create a new world from a snapshot image.
int b2World_GetSnapshot(b2WorldId worldId, uint8_t *image, int capacity)
Write a snapshot of the world's simulation state into a caller-owned buffer.
These are performance results returned by dynamic tree queries.
Definition collision.h:694
void b2WeldJoint_SetLinearDampingRatio(b2JointId jointId, float dampingRatio)
Set the weld joint linear damping ratio (non-dimensional).
void b2WeldJoint_SetAngularDampingRatio(b2JointId jointId, float dampingRatio)
Set weld joint angular damping ratio, non-dimensional.
float b2WeldJoint_GetLinearHertz(b2JointId jointId)
Get the weld joint linear stiffness in Hertz.
b2JointId b2CreateWeldJoint(b2WorldId worldId, const b2WeldJointDef *def)
Create a weld joint.
float b2WeldJoint_GetLinearDampingRatio(b2JointId jointId)
Get the weld joint linear damping ratio (non-dimensional).
float b2WeldJoint_GetAngularHertz(b2JointId jointId)
Get the weld joint angular stiffness in Hertz.
float b2WeldJoint_GetAngularDampingRatio(b2JointId jointId)
Get the weld joint angular damping ratio, non-dimensional.
void b2WeldJoint_SetAngularHertz(b2JointId jointId, float hertz)
Set the weld joint angular stiffness in Hertz. 0 is rigid.
void b2WeldJoint_SetLinearHertz(b2JointId jointId, float hertz)
Set the weld joint linear stiffness in Hertz. 0 is rigid.
Weld joint definition Connects two bodies together rigidly.
Definition types.h:943
void b2WheelJoint_SetMaxMotorTorque(b2JointId jointId, float torque)
Set the wheel joint maximum motor torque, usually in newton-meters.
float b2WheelJoint_GetTargetMotorSpeed(b2JointId jointId)
Get the wheel joint motor speed in radians per second.
bool b2WheelJoint_IsSpringEnabled(b2JointId jointId)
Is the wheel joint spring enabled?
float b2WheelJoint_GetUpperLimit(b2JointId jointId)
Get the wheel joint upper limit.
void b2WheelJoint_SetLimits(b2JointId jointId, float lower, float upper)
Set the wheel joint limits.
bool b2WheelJoint_IsMotorEnabled(b2JointId jointId)
Is the wheel joint motor enabled?
bool b2WheelJoint_IsLimitEnabled(b2JointId jointId)
Is the wheel joint limit enabled?
void b2WheelJoint_SetTargetMotorSpeed(b2JointId jointId, float motorSpeed)
Set the wheel joint motor speed in radians per second.
void b2WheelJoint_SetSpringHertz(b2JointId jointId, float hertz)
Set the wheel joint stiffness in Hertz.
float b2WheelJoint_GetSpringHertz(b2JointId jointId)
Get the wheel joint stiffness in Hertz.
void b2WheelJoint_EnableLimit(b2JointId jointId, bool enableLimit)
Enable/disable the wheel joint limit.
void b2WheelJoint_EnableSpring(b2JointId jointId, bool enableSpring)
Enable/disable the wheel joint spring.
float b2WheelJoint_GetSpringDampingRatio(b2JointId jointId)
Get the wheel joint damping ratio, non-dimensional.
float b2WheelJoint_GetLowerLimit(b2JointId jointId)
Get the wheel joint lower limit.
void b2WheelJoint_EnableMotor(b2JointId jointId, bool enableMotor)
Enable/disable the wheel joint motor.
float b2WheelJoint_GetCurrentMotorTorque(b2JointId jointId)
Get the wheel joint current motor torque, usually in newton-meters.
b2JointId b2CreateWheelJoint(b2WorldId worldId, const b2WheelJointDef *def)
Create a wheel joint.
void b2WheelJoint_SetSpringDampingRatio(b2JointId jointId, float dampingRatio)
Set the wheel joint damping ratio, non-dimensional.
float b2WheelJoint_GetMaxMotorTorque(b2JointId jointId)
Get the wheel joint maximum motor torque, usually in newton-meters.
Wheel joint definition Body B is a wheel that may rotate freely and slide along the local x-axis in f...
Definition types.h:971
void b2World_Step(b2WorldId worldId, float timeStep, int subStepCount)
Simulate a world for one time step.
void b2World_SetUserData(b2WorldId worldId, void *userData)
Set the user data pointer.
void b2World_Draw(b2WorldId worldId, b2DebugDraw *draw)
Call this to draw shapes and other debug draw data.
b2TreeStats b2World_OverlapShape(b2WorldId worldId, b2Pos origin, const b2ShapeProxy *proxy, b2QueryFilter filter, b2OverlapResultCallbackFcn *fcn, void *context)
Overlap test for all shapes that overlap the provided shape proxy.
float b2FrictionCallbackFcn(float frictionA, uint64_t userMaterialIdA, float frictionB, uint64_t userMaterialIdB)
Optional friction mixing callback.
Definition types.h:43
float b2World_GetHitEventThreshold(b2WorldId worldId)
Get the hit event speed threshold. Usually in meters per second.
void b2World_EnableSSE2Fallback(b2WorldId worldId, bool flag)
Force SSE2 to be used even when AVX2 is available. This is for testing.
void b2World_EnableRestitutionPropagation(b2WorldId worldId, bool flag)
Enable/disable restitution propagation.
void b2World_SetPreSolveCallback(b2WorldId worldId, b2PreSolveCallbackFcn *preSolveFcn, b2PreContinuousCallbackFcn *preContinuousFcn, void *context)
Register the pre-solve and pre-continuous callbacks. This is optional.
void b2World_EnableSleeping(b2WorldId worldId, bool flag)
Enable/disable sleep.
void b2World_DumpMemoryStats(b2WorldId worldId)
Dump memory stats to box2d_memory.txt.
bool b2OverlapResultCallbackFcn(b2ShapeId shapeId, void *context)
Prototype callback for overlap queries.
Definition types.h:1310
void b2World_EnableContinuous(b2WorldId worldId, bool flag)
Enable/disable continuous collision between dynamic and static bodies.
void b2World_SetRestitutionIterations(b2WorldId worldId, int iterations)
Set the number of iterations used by the restitution solver.
bool b2World_IsRestitutionPropagationEnabled(b2WorldId worldId)
Is restitution propagation enabled?
void b2World_SetFrictionCallback(b2WorldId worldId, b2FrictionCallbackFcn *callback)
Set the friction callback. Passing NULL resets to default.
b2WorldId b2CreateWorld(const b2WorldDef *def)
Create a world for rigid body simulation.
void b2World_CollideMover(b2WorldId worldId, b2Pos origin, const b2Capsule *mover, b2QueryFilter filter, b2PlaneResultCallbackFcn *fcn, void *context)
Collide a capsule mover with the world, gathering collision planes that can be fed to b2SolvePlanes.
void b2World_GetContactTuning(b2WorldId worldId, float *hertz, float *dampingRatio, float *pushSpeed)
Get the contact tuning.
b2Profile b2World_GetProfile(b2WorldId worldId)
Get the current world performance profile.
bool b2World_IsSleepingEnabled(b2WorldId worldId)
Is body sleeping enabled?
void b2PreSolveCallbackFcn(b2ShapeId shapeIdA, b2ShapeId shapeIdB, b2Manifold *manifold, void *context)
Prototype for a pre-solve callback.
Definition types.h:1290
bool b2PreContinuousCallbackFcn(b2ShapeId shapeIdA, b2ShapeId shapeIdB, b2Pos point, b2Vec2 normal, void *context)
Prototype for a pre-continuous callback.
Definition types.h:1303
b2ContactEvents b2World_GetContactEvents(b2WorldId worldId)
Get contact events for the current time step.
b2JointEvents b2World_GetJointEvents(b2WorldId worldId)
Get the joint events for the current time step.
void b2World_EnableWarmStarting(b2WorldId worldId, bool flag)
Enable/disable constraint warm starting.
float b2World_GetMaxLinearSpeed(b2WorldId worldId)
Get the maximum linear speed. Usually in m/s.
void b2World_SetGravity(b2WorldId worldId, b2Vec2 gravity)
Set the gravity vector for the entire world.
bool b2World_IsContinuousEnabled(b2WorldId worldId)
Is continuous collision enabled?
bool b2World_IsValid(b2WorldId id)
World id validation. Provides validation for up to 64K allocations.
b2AABB b2World_GetBounds(b2WorldId worldId)
Call this to get the world bounds based on the union of all shape bounds.
float b2World_CastMover(b2WorldId worldId, b2Pos origin, const b2Capsule *mover, b2Vec2 translation, b2QueryFilter filter)
Cast a capsule mover through the world.
void b2World_SetRestitutionCallback(b2WorldId worldId, b2RestitutionCallbackFcn *callback)
Set the restitution callback. Passing NULL resets to default.
float b2RestitutionCallbackFcn(float restitutionA, uint64_t userMaterialIdA, float restitutionB, uint64_t userMaterialIdB)
Optional restitution mixing callback.
Definition types.h:50
b2SensorEvents b2World_GetSensorEvents(b2WorldId worldId)
Get sensor events for the current time step.
b2TreeStats b2World_OverlapAABB(b2WorldId worldId, b2Pos origin, b2AABB aabb, b2QueryFilter filter, b2OverlapResultCallbackFcn *fcn, void *context)
Overlap test for all shapes that potentially overlap the provided AABB.
void b2World_SetContactTuning(b2WorldId worldId, float hertz, float dampingRatio, float pushSpeed)
Adjust contact tuning parameters.
void b2World_SetWorkerCount(b2WorldId worldId, int count)
Set the worker count. Must be in the range [1, B2_MAX_WORKERS].
b2RayResult b2World_CastRayClosest(b2WorldId worldId, b2Pos origin, b2Vec2 translation, b2QueryFilter filter)
Cast a ray into the world to collect the closest hit.
void * b2World_GetUserData(b2WorldId worldId)
Get the user data pointer.
float b2CastResultCallbackFcn(b2ShapeId shapeId, b2Pos point, b2Vec2 normal, float fraction, void *context)
Prototype callback for ray and shape casts.
Definition types.h:1329
int b2World_GetWorkerCount(b2WorldId worldId)
Get the worker count.
void b2World_SetContactRecycleDistance(b2WorldId worldId, float recycleDistance)
Set the contact point recycling distance.
int b2World_GetRestitutionIterations(b2WorldId worldId)
Get the number of iterations used by the restitution solver.
void b2World_SetMaxLinearSpeed(b2WorldId worldId, float maximumLinearSpeed)
Set the maximum linear speed. Usually in m/s.
void b2DestroyWorld(b2WorldId worldId)
Destroy a world.
void b2World_SetHitEventThreshold(b2WorldId worldId, float value)
Adjust the hit event threshold.
void b2World_Explode(b2WorldId worldId, const b2ExplosionDef *explosionDef)
Apply a radial explosion.
void b2World_RebuildStaticTree(b2WorldId worldId)
This is for internal testing.
b2TreeStats b2World_CastRay(b2WorldId worldId, b2Pos origin, b2Vec2 translation, b2QueryFilter filter, b2CastResultCallbackFcn *fcn, void *context)
Cast a ray into the world to collect shapes in the path of the ray.
void b2World_SetRestitutionThreshold(b2WorldId worldId, float value)
Adjust the restitution threshold.
void b2World_SetCustomFilterCallback(b2WorldId worldId, b2CustomFilterCallbackFcn *fcn, void *context)
Register the custom filter callback. This is optional.
b2TreeStats b2World_CastShape(b2WorldId worldId, b2Pos origin, const b2ShapeProxy *proxy, b2Vec2 translation, b2QueryFilter filter, b2CastResultCallbackFcn *fcn, void *context)
Cast a shape through the world.
b2Counters b2World_GetCounters(b2WorldId worldId)
Get world counters and sizes.
float b2World_GetRestitutionThreshold(b2WorldId worldId)
Get the restitution speed threshold. Usually in meters per second.
b2BodyEvents b2World_GetBodyEvents(b2WorldId worldId)
Get the body events for the current time step.
bool b2CustomFilterCallbackFcn(b2ShapeId shapeIdA, b2ShapeId shapeIdB, void *context)
Prototype for a contact filter callback.
Definition types.h:1277
bool b2World_IsWarmStartingEnabled(b2WorldId worldId)
Is constraint warm starting enabled?
float b2World_GetContactRecycleDistance(b2WorldId worldId)
Get the contact point recycling distance. Usually in meters.
int b2World_GetAwakeBodyCount(b2WorldId worldId)
Get the number of awake bodies.
uint64_t b2World_GetStateHash(b2WorldId worldId)
Compute a hash of the simulation state.
b2Vec2 b2World_GetGravity(b2WorldId worldId)
Get the gravity vector.
b2Capacity b2World_GetMaxCapacity(b2WorldId worldId)
Get max capacity. This can be used with b2WorldDef to avoid run-time allocations and copies.
Optional world capacities that can be used to avoid run-time allocations.
Definition types.h:84
Counters that give details of the simulation size.
Definition types.h:585
The explosion definition is used to configure options for explosions.
Definition types.h:1014
Profiling data.
Definition types.h:556
Result from b2World_CastRayClosest If there is initial overlap the fraction and normal will be zero w...
Definition types.h:57
World definition used to create a simulation world.
Definition types.h:108
This struct holds callbacks you can implement to draw a Box2D world.
Definition types.h:1507