parin.bindings.box2d
The box2d module provides access to the Box2D v3 C API. By default these bindings match the Box2D v3.1.1 release. To use latest Box2D instead, compile with -version=Box2D_Main. The versions have different ABIs, so the flag must match the library you link.
alias b2BodyType b2CastResultFcn b2FinishTaskCallback b2FrictionCallback b2JointType b2OverlapResultFcn b2Pos b2RestitutionCallback b2ShapeType b2Vec2 b2WorldTransform
struct b2AABB b2BodyDef b2BodyEvents b2BodyId b2BodyMoveEvent b2Capsule b2ChainDef b2ChainId b2ChainSegment b2Circle b2ContactBeginTouchEvent b2ContactData b2ContactEndTouchEvent b2ContactEvents b2ContactHitEvent b2Filter b2Hull b2JointId b2Manifold b2ManifoldPoint b2Mat22 b2Polygon b2QueryFilter b2RayResult b2Rot b2Segment b2SensorBeginTouchEvent b2SensorEndTouchEvent b2SensorEvents b2ShapeDef b2ShapeId b2ShapeProxy b2SurfaceMaterial b2Transform b2TreeStats b2WorldDef b2WorldId
fn b2Body_ApplyAngularImpulse b2Body_ApplyForce b2Body_ApplyForceToCenter b2Body_ApplyLinearImpulse b2Body_ApplyLinearImpulseToCenter b2Body_ApplyTorque b2Body_Disable b2Body_Enable b2Body_GetAngularDamping b2Body_GetAngularVelocity b2Body_GetGravityScale b2Body_GetLinearDamping b2Body_GetLinearVelocity b2Body_GetLocalPoint b2Body_GetLocalVector b2Body_GetMass b2Body_GetName b2Body_GetPosition b2Body_GetRotation b2Body_GetRotationalInertia b2Body_GetShapeCount b2Body_GetShapes b2Body_GetTransform b2Body_GetType b2Body_GetUserData b2Body_GetWorldPoint b2Body_GetWorldVector b2Body_IsAwake b2Body_IsBullet b2Body_IsEnabled b2Body_IsValid b2Body_SetAngularDamping b2Body_SetAngularVelocity b2Body_SetAwake b2Body_SetBullet b2Body_SetGravityScale b2Body_SetLinearDamping b2Body_SetLinearVelocity b2Body_SetName b2Body_SetTransform b2Body_SetType b2Body_SetUserData b2Chain_GetSegmentCount b2Chain_GetSegments b2Chain_IsValid b2ComputeHull b2CreateBody b2CreateCapsuleShape b2CreateChain b2CreateCircleShape b2CreateDistanceJoint b2CreateFilterJoint b2CreateMotorJoint b2CreatePolygonShape b2CreatePrismaticJoint b2CreateRevoluteJoint b2CreateSegmentShape b2CreateWeldJoint b2CreateWheelJoint b2CreateWorld b2DefaultBodyDef b2DefaultChainDef b2DefaultDistanceJointDef b2DefaultFilterJointDef b2DefaultMotorJointDef b2DefaultPrismaticJointDef b2DefaultRevoluteJointDef b2DefaultShapeDef b2DefaultWeldJointDef b2DefaultWheelJointDef b2DefaultWorldDef b2DestroyBody b2DestroyChain b2DestroyJoint b2DestroyShape b2DestroyWorld b2Joint_GetBodyA b2Joint_GetBodyB b2Joint_GetType b2Joint_GetUserData b2Joint_IsValid b2Joint_SetUserData b2MakeBox b2MakeOffsetBox b2MakeOffsetPolygon b2MakeOffsetProxy b2MakeOffsetRoundedBox b2MakeOffsetRoundedPolygon b2MakePolygon b2MakeProxy b2MakeRoundedBox b2MakeSquare b2Shape_GetAABB b2Shape_GetBody b2Shape_GetDensity b2Shape_GetFilter b2Shape_GetFriction b2Shape_GetRestitution b2Shape_GetType b2Shape_GetUserData b2Shape_IsValid b2Shape_SetDensity b2Shape_SetFilter b2Shape_SetFriction b2Shape_SetRestitution b2Shape_SetUserData b2Shape_TestPoint b2TransformPolygon b2World_CastRay b2World_CastRayClosest b2World_EnableContinuous b2World_EnableSleeping b2World_GetBodyEvents b2World_GetContactEvents b2World_GetGravity b2World_GetSensorEvents b2World_GetUserData b2World_IsContinuousEnabled b2World_IsSleepingEnabled b2World_IsValid b2World_SetGravity b2World_SetUserData b2World_Step
Types 48
aliasb2Vec2 = joka.Vec2
aliasb2Pos = b2Vec2
aliasb2WorldTransform = b2Transform
aliasb2OverlapResultFcn = bool function(b2ShapeId shapeId, void * context)
aliasb2CastResultFcn = float function(b2ShapeId shapeId, b2Vec2 point, b2Vec2 normal, float fraction, void * context)
aliasb2FinishTaskCallback = void function(void * userTask, void * userContext)
aliasb2FrictionCallback = float function(float frictionA, b2UserMaterialId userMaterialIdA, float frictionB, b2UserMaterialId userMaterialIdB)
aliasb2RestitutionCallback = float function(float restitutionA, b2UserMaterialId userMaterialIdA, float restitutionB, b2UserMaterialId userMaterialIdB)
aliasb2BodyType = int
aliasb2ShapeType = int
aliasb2JointType = int
structb2WorldId
Fields
ushort index1ushort generationstructb2BodyId
Fields
int index1ushort world0ushort generationstructb2ShapeId
Fields
int index1ushort world0ushort generationstructb2ChainId
Fields
int index1ushort world0ushort generationstructb2JointId
Fields
int index1ushort world0ushort generationstructb2Rot
Fields
float cfloat sstructb2Transform
Fields
b2Vec2 pb2Rot qstructb2AABB
Fields
b2Vec2 lowerBoundb2Vec2 upperBoundstructb2Mat22
Fields
b2Vec2 cxb2Vec2 cystructb2Filter
Fields
ulong categoryBitsulong maskBitsint groupIndexstructb2QueryFilter
Fields
ulong categoryBitsulong maskBitsstructb2SurfaceMaterial
Fields
float frictionfloat restitutionfloat rollingResistancefloat tangentSpeedb2UserMaterialId userMaterialIduint customColorstructb2WorldDef
Fields
b2Vec2 gravityfloat restitutionThresholdfloat hitEventThresholdfloat contactHertzfloat contactDampingRatiofloat maximumLinearSpeedb2FrictionCallback frictionCallbackb2RestitutionCallback restitutionCallbackbool enableSleepbool enableContinuousint workerCountb2EnqueueTaskCallback enqueueTaskb2FinishTaskCallback finishTaskvoid * userTaskContextvoid * userDataint internalValuestructb2BodyDef
Fields
b2BodyType typeb2Pos positionb2Rot rotationb2Vec2 linearVelocityfloat angularVelocityfloat linearDampingfloat angularDampingfloat gravityScalefloat sleepThresholdconst(char) * namevoid * userDatabool enableSleepbool isAwakebool isBulletbool isEnabledbool allowFastRotationint internalValuestructb2ShapeDef
Fields
void * userDatab2SurfaceMaterial materialfloat densityb2Filter filterbool isSensorbool enableSensorEventsbool enableContactEventsbool enableHitEventsbool enablePreSolveEventsbool invokeContactCreationbool updateBodyMassint internalValuestructb2Circle
Fields
b2Vec2 centerfloat radiusstructb2Capsule
Fields
b2Vec2 center1b2Vec2 center2float radiusstructb2Segment
Fields
b2Vec2 point1b2Vec2 point2structb2Polygon
Fields
joka.StaticArray!(b2Vec2, 8) verticesjoka.StaticArray!(b2Vec2, 8) normalsb2Vec2 centroidfloat radiusint countstructb2ManifoldPoint
Fields
b2Vec2 anchorAb2Vec2 anchorBfloat separationfloat normalImpulsefloat tangentImpulsefloat totalNormalImpulsefloat normalVelocityushort idbool persistedstructb2Manifold
structb2SensorBeginTouchEvent
Fields
b2ShapeId sensorShapeIdb2ShapeId visitorShapeIdstructb2SensorEndTouchEvent
Fields
b2ShapeId sensorShapeIdb2ShapeId visitorShapeIdstructb2SensorEvents
Fields
b2SensorBeginTouchEvent * beginEventsb2SensorEndTouchEvent * endEventsint beginCountint endCountstructb2ContactBeginTouchEvent
Fields
b2ShapeId shapeIdAb2ShapeId shapeIdBstructb2ContactEndTouchEvent
Fields
b2ShapeId shapeIdAb2ShapeId shapeIdBstructb2ContactHitEvent
Fields
b2ShapeId shapeIdAb2ShapeId shapeIdBb2Pos pointb2Vec2 normalfloat approachSpeedstructb2ContactEvents
Fields
b2ContactBeginTouchEvent * beginEventsb2ContactEndTouchEvent * endEventsb2ContactHitEvent * hitEventsint beginCountint endCountint hitCountstructb2BodyMoveEvent
Fields
bool fellAsleepstructb2BodyEvents
Fields
b2BodyMoveEvent * moveEventsint moveCountstructb2TreeStats
Fields
int nodeVisitsint leafVisitsstructb2Hull
structb2ShapeProxy
structb2RayResult
Fields
b2ShapeId shapeIdb2Pos pointb2Vec2 normalfloat fractionint nodeVisitsint leafVisitsbool hitstructb2ChainSegment
Fields
b2Vec2 ghost1b2Segment segmentb2Vec2 ghost2int chainIdstructb2ChainDef
Fields
void * userDataconst(b2Vec2) * pointsconst(b2SurfaceMaterial) * materialsint materialCountb2Filter filterbool isLoopbool enableSensorEventsint internalValuestructb2ContactData
Fields
b2ShapeId shapeIdAb2ShapeId shapeIdBb2Manifold manifoldFunctions 123
fn
void b2World_Step(b2WorldId worldId, float timeStep, int subStepCount) extern(C) @system nothrow @nogcfn
void b2Body_SetTransform(b2BodyId bodyId, b2Pos position, b2Rot rotation) extern(C) @system nothrow @nogcfn
void b2Body_SetLinearVelocity(b2BodyId bodyId, b2Vec2 linearVelocity) extern(C) @system nothrow @nogcfn
void b2Body_SetAngularVelocity(b2BodyId bodyId, float angularVelocity) extern(C) @system nothrow @nogcfn
void b2Body_ApplyForce(b2BodyId bodyId, b2Vec2 force, b2Pos point, bool wake) extern(C) @system nothrow @nogcfn
void b2Body_ApplyForceToCenter(b2BodyId bodyId, b2Vec2 force, bool wake) extern(C) @system nothrow @nogcfn
void b2Body_ApplyLinearImpulse(b2BodyId bodyId, b2Vec2 impulse, b2Pos point, bool wake) extern(C) @system nothrow @nogcfn
void b2Body_ApplyLinearImpulseToCenter(b2BodyId bodyId, b2Vec2 impulse, bool wake) extern(C) @system nothrow @nogcfn
void b2Body_ApplyAngularImpulse(b2BodyId bodyId, float impulse, bool wake) extern(C) @system nothrow @nogcfn
int b2Body_GetShapes(b2BodyId bodyId, b2ShapeId * shapeArray, int capacity) extern(C) @system nothrow @nogcfn
b2ShapeId b2CreateCircleShape(b2BodyId bodyId, const(b2ShapeDef) * def, const(b2Circle) * circle) extern(C) @system nothrow @nogcfn
b2ShapeId b2CreateCapsuleShape(b2BodyId bodyId, const(b2ShapeDef) * def, const(b2Capsule) * capsule) extern(C) @system nothrow @nogcfn
b2ShapeId b2CreateSegmentShape(b2BodyId bodyId, const(b2ShapeDef) * def, const(b2Segment) * segment) extern(C) @system nothrow @nogcfn
b2ShapeId b2CreatePolygonShape(b2BodyId bodyId, const(b2ShapeDef) * def, const(b2Polygon) * polygon) extern(C) @system nothrow @nogcfn
void b2Shape_SetDensity(b2ShapeId shapeId, float density, bool updateBodyMass) extern(C) @system nothrow @nogcfn
b2JointId b2CreateDistanceJoint(b2WorldId worldId, const(b2DistanceJointDef) * def) extern(C) @system nothrow @nogcfn
b2JointId b2CreateRevoluteJoint(b2WorldId worldId, const(b2RevoluteJointDef) * def) extern(C) @system nothrow @nogcfn
b2JointId b2CreatePrismaticJoint(b2WorldId worldId, const(b2PrismaticJointDef) * def) extern(C) @system nothrow @nogcfn
b2JointId b2CreateWeldJoint(b2WorldId worldId, const(b2WeldJointDef) * def) extern(C) @system nothrow @nogcfn
b2JointId b2CreateWheelJoint(b2WorldId worldId, const(b2WheelJointDef) * def) extern(C) @system nothrow @nogcfn
b2TreeStats b2World_CastRay(b2WorldId worldId, b2Pos origin, b2Vec2 translation, b2QueryFilter filter, b2CastResultFcn fcn, void * context) extern(C) @system nothrow @nogcfn
b2Polygon b2MakeOffsetPolygon(const(b2Hull) * hull, b2Vec2 position, b2Rot rotation) extern(C) @system nothrow @nogcfn
b2Polygon b2MakeOffsetRoundedPolygon(const(b2Hull) * hull, b2Vec2 position, b2Rot rotation, float radius) extern(C) @system nothrow @nogcfn
b2Polygon b2MakeRoundedBox(float halfWidth, float halfHeight, float radius) extern(C) @system nothrow @nogcfn
b2Polygon b2MakeOffsetBox(float halfWidth, float halfHeight, b2Vec2 center, b2Rot rotation) extern(C) @system nothrow @nogcfn
b2Polygon b2MakeOffsetRoundedBox(float halfWidth, float halfHeight, b2Vec2 center, b2Rot rotation, float radius) extern(C) @system nothrow @nogcfn
b2Polygon b2TransformPolygon(b2Transform transform, const(b2Polygon) * polygon) extern(C) @system nothrow @nogcfn
b2ShapeProxy b2MakeProxy(const(b2Vec2) * points, int count, float radius) extern(C) @system nothrow @nogcfn
b2ShapeProxy b2MakeOffsetProxy(const(b2Vec2) * points, int count, float radius, b2Vec2 position, b2Rot rotation) extern(C) @system nothrow @nogcfn
int b2Chain_GetSegments(b2ChainId chainId, b2ShapeId * segmentArray, int capacity) extern(C) @system nothrow @nogcfn
b2RayResult b2World_CastRayClosest(b2WorldId worldId, b2Pos origin, b2Vec2 translation, b2QueryFilter filter) extern(C) @system nothrow @nogcfn
b2JointId b2CreateFilterJoint(b2WorldId worldId, const(b2FilterJointDef) * def) extern(C) @system nothrow @nogcfn
b2JointId b2CreateMotorJoint(b2WorldId worldId, const(b2MotorJointDef) * def) extern(C) @system nothrow @nogcfn
void b2Body_SetLinearDamping(b2BodyId bodyId, float linearDamping) extern(C) @system nothrow @nogcfn
void b2Body_SetAngularDamping(b2BodyId bodyId, float angularDamping) extern(C) @system nothrow @nogc