package vendor:box3d
Overview
Bindings for Box3D
Index
Types (150)
- AABB
- AllocFcn
- AssertFcn
- BodyCastResult
- BodyDef
- BodyEvents
- BodyId
- BodyMoveEvent
- BodyPlaneResult
- BodyType
- BoxCastInput
- BoxHull
- Capacity
- Capsule
- CastOutput
- CastResultFcn
- ChildShape
- CollisionPlane
- CompoundCapsule
- CompoundCapsuleDef
- CompoundData
- CompoundDef
- CompoundHull
- CompoundHullDef
- CompoundMesh
- CompoundMeshDef
- CompoundQueryFcn
- CompoundSphere
- CompoundSphereDef
- ContactBeginTouchEvent
- ContactData
- ContactEndTouchEvent
- ContactEvents
- ContactHitEvent
- ContactId
- CosSin
- Counters
- CreateDebugShapeCallback
- CustomFilterFcn
- DebugDraw
- DebugMaterial
- DebugShape
- DestroyDebugShapeCallback
- DistanceInput
- DistanceJointDef
- DistanceOutput
- DynamicTree
- EnqueueTaskCallback
- ExplosionDef
- FeaturePair
- Filter
- FilterJointDef
- FinishTaskCallback
- FreeFcn
- FrictionCallback
- HeightFieldData
- HeightFieldDef
- HexColor
- HullData
- HullFace
- HullHalfEdge
- HullVertex
- JointDef
- JointEvent
- JointEvents
- JointId
- JointType
- LocalManifold
- LocalManifoldPoint
- LogFcn
- Manifold
- ManifoldPoint
- MassData
- Matrix3
- Mesh
- MeshData
- MeshDef
- MeshEdgeFlag
- MeshEdgeFlags
- MeshNode
- MeshQueryFcn
- MeshTriangle
- MotionLocks
- MotorJointDef
- MoverFilterFcn
- OverlapResultFcn
- ParallelJointDef
- Plane
- PlaneResult
- PlaneResultFcn
- PlaneSolverResult
- Pos
- PreSolveFcn
- PrismaticJointDef
- Profile
- Quat
- QueryFilter
- RayCastInput
- RayResult
- RecPlayer
- RecPlayerInfo
- RecQueryHit
- RecQueryInfo
- RecQueryType
- Recording
- RestitutionCallback
- RevoluteJointDef
- SATCache
- SegmentDistanceResult
- SensorBeginTouchEvent
- SensorEndTouchEvent
- SensorEvents
- SeparatingFeature
- ShapeCastInput
- ShapeCastPairInput
- ShapeDef
- ShapeId
- ShapeProxy
- ShapeType
- Simplex
- SimplexCache
- SimplexVertex
- Sphere
- SphericalJointDef
- SurfaceMaterial
- Sweep
- TOIInput
- TOIOutput
- TOIState
- TaskCallback
- Transform
- TreeBoxCastCallbackFcn
- TreeNode
- TreeNodeChildren
- TreeNodeFlag
- TreeNodeFlags
- TreeQueryCallbackFcn
- TreeQueryClosestCallbackFcn
- TreeRayCastCallbackFcn
- TreeStats
- TriangleFeature
- Vec2
- Vec3
- Version
- WeldJointDef
- WheelJointDef
- WorldCastOutput
- WorldDef
- WorldId
- WorldTransform
Constants (63)
- AABB_MARGIN_FRACTION
- BODY_NAME_LENGTH
- CHILD_POWER
- COMPOUND_VERSION
- CONTACT_MANIFOLD_COUNT_BUCKETS
- CONTACT_RECYCLE_ANGULAR_DISTANCE
- DEFAULT_CATEGORY_BITS
- DEFAULT_MASK_BITS
- DEG_TO_RAD
- DOUBLE_PRECISION
- DYNAMIC_TREE_VERSION
- ENABLE_VALIDATION
- FLT_EPSILON
- GRAPH_COLOR_COUNT
- HASH_INIT
- HEIGHT_FIELD_HOLE
- HEIGHT_FIELD_VERSION
- HULL_VERSION
- MAX_CHILD_SHAPES
- MAX_COMPOUND_MESH_MATERIALS
- MAX_MANIFOLD_POINTS
- MAX_ROTATION
- MAX_SHAPES
- MAX_SHAPE_CAST_POINTS
- MAX_TASKS
- MAX_WORKERS
- MAX_WORLDS
- MESH_VERSION
- MIN_SCALE
- Mat3_identity
- Mat3_zero
- NULL_INDEX
- PI
- Pos_zero
- Quat_identity
- RAD_TO_DEG
- SHAPE_NAME_LENGTH
- SHAPE_POWER
- TIME_TO_SLEEP
- Transform_identity
- Vec3_axisX
- Vec3_axisY
- Vec3_axisZ
- Vec3_one
- Vec3_zero
- WorldTransform_identity
- allConcaveEdges
- allFlatEdges
- concaveEdge1
- concaveEdge2
- concaveEdge3
- emptyDistanceCache
- flatEdge1
- flatEdge2
- flatEdge3
- inverseConcaveEdge1
- inverseConcaveEdge2
- inverseConcaveEdge3
- nullBodyId
- nullContactId
- nullJointId
- nullShapeId
- nullWorldId
Variables (0)
This section is empty.
Procedures (681)
- AABB_Area
- AABB_Center
- AABB_Contains
- AABB_Extents
- AABB_Inflate
- AABB_Overlaps
- AABB_Transform
- AABB_Union
- ASSERT
- AbsFloat
- AbsMatrix3
- Atan2
- BREAKPOINT
- Blend2
- Body_ApplyAngularImpulse
- Body_ApplyForce
- Body_ApplyForceToCenter
- Body_ApplyLinearImpulse
- Body_ApplyLinearImpulseToCenter
- Body_ApplyMassFromShapes
- Body_ApplyTorque
- Body_CastRay
- Body_CastShape
- Body_CollideMover
- Body_ComputeAABB
- Body_Disable
- Body_Enable
- Body_EnableContactRecycling
- Body_EnableHitEvents
- Body_EnableSleep
- Body_GetAngularDamping
- Body_GetAngularVelocity
- Body_GetClosestPoint
- Body_GetContactCapacity
- Body_GetContactData
- Body_GetGravityScale
- Body_GetInverseMass
- Body_GetJointCount
- Body_GetJoints
- Body_GetLinearDamping
- Body_GetLinearVelocity
- Body_GetLocalCenterOfMass
- Body_GetLocalPoint
- Body_GetLocalPointVelocity
- Body_GetLocalRotationalInertia
- Body_GetLocalVector
- Body_GetMass
- Body_GetMassData
- Body_GetMotionLocks
- Body_GetName
- Body_GetPosition
- Body_GetRotation
- Body_GetShapeCount
- Body_GetShapes
- Body_GetSleepThreshold
- Body_GetTransform
- Body_GetType
- Body_GetUserData
- Body_GetWorld
- Body_GetWorldCenterOfMass
- Body_GetWorldInverseRotationalInertia
- Body_GetWorldPoint
- Body_GetWorldPointVelocity
- Body_GetWorldVector
- Body_IsAwake
- Body_IsBullet
- Body_IsContactRecyclingEnabled
- Body_IsEnabled
- Body_IsSleepEnabled
- Body_IsValid
- Body_OverlapShape
- Body_SetAngularDamping
- Body_SetAngularVelocity
- Body_SetAwake
- Body_SetBullet
- Body_SetGravityScale
- Body_SetLinearDamping
- Body_SetLinearVelocity
- Body_SetMassData
- Body_SetMotionLocks
- Body_SetName
- Body_SetSleepThreshold
- Body_SetTargetTransform
- Body_SetTransform
- Body_SetType
- Body_SetUserData
- CONTACT_RECYCLE_DISTANCE
- ClampFloat
- ClampInt
- ClipVector
- CloneAndTransformHull
- CloneHull
- ClosestPointToAABB
- CollideCapsuleAndSphere
- CollideCapsuleAndTriangle
- CollideCapsules
- CollideHullAndCapsule
- CollideHullAndSphere
- CollideHullAndTriangle
- CollideHulls
- CollideSphereAndTriangle
- CollideSpheres
- ComputeCapsuleAABB
- ComputeCapsuleMass
- ComputeCompoundAABB
- ComputeCosSin
- ComputeHeightFieldAABB
- ComputeHullAABB
- ComputeHullMass
- ComputeMeshAABB
- ComputeQuatBetweenUnitVectors
- ComputeSphereAABB
- ComputeSphereMass
- Conjugate
- Contact_GetData
- Contact_IsValid
- ConvertBytesToCompound
- ConvertCompoundToBytes
- CreateBody
- CreateBoxMesh
- CreateCapsuleShape
- CreateCompound
- CreateCompoundShape
- CreateCone
- CreateCylinder
- CreateDistanceJoint
- CreateFilterJoint
- CreateGrid
- CreateGridMesh
- CreateHeightField
- CreateHeightFieldShape
- CreateHollowBoxMesh
- CreateHull
- CreateHullShape
- CreateMesh
- CreateMeshShape
- CreateMotorJoint
- CreateParallelJoint
- CreatePlatformMesh
- CreatePrismaticJoint
- CreateRecording
- CreateRevoluteJoint
- CreateRock
- CreateSphereShape
- CreateSphericalJoint
- CreateTorusMesh
- CreateTransformedHullShape
- CreateWave
- CreateWaveMesh
- CreateWeldJoint
- CreateWheelJoint
- CreateWorld
- DefaultBodyDef
- DefaultDebugDraw
- DefaultDistanceJointDef
- DefaultExplosionDef
- DefaultFilter
- DefaultFilterJointDef
- DefaultMotorJointDef
- DefaultParallelJointDef
- DefaultPrismaticJointDef
- DefaultQueryFilter
- DefaultRevoluteJointDef
- DefaultShapeDef
- DefaultSphericalJointDef
- DefaultSurfaceMaterial
- DefaultWeldJointDef
- DefaultWheelJointDef
- DefaultWorldDef
- DestroyBody
- DestroyCompound
- DestroyHeightField
- DestroyHull
- DestroyJoint
- DestroyMesh
- DestroyRecording
- DestroyShape
- DestroyWorld
- Distance
- DistanceJoint_EnableLimit
- DistanceJoint_EnableMotor
- DistanceJoint_EnableSpring
- DistanceJoint_GetCurrentLength
- DistanceJoint_GetLength
- DistanceJoint_GetMaxLength
- DistanceJoint_GetMaxMotorForce
- DistanceJoint_GetMinLength
- DistanceJoint_GetMotorForce
- DistanceJoint_GetMotorSpeed
- DistanceJoint_GetSpringDampingRatio
- DistanceJoint_GetSpringForceRange
- DistanceJoint_GetSpringHertz
- DistanceJoint_IsLimitEnabled
- DistanceJoint_IsMotorEnabled
- DistanceJoint_IsSpringEnabled
- DistanceJoint_SetLength
- DistanceJoint_SetLengthRange
- DistanceJoint_SetMaxMotorForce
- DistanceJoint_SetMotorSpeed
- DistanceJoint_SetSpringDampingRatio
- DistanceJoint_SetSpringForceRange
- DistanceJoint_SetSpringHertz
- DistanceSquared
- DumpHeightData
- DynamicTree_BoxCast
- DynamicTree_Create
- DynamicTree_CreateProxy
- DynamicTree_Destroy
- DynamicTree_DestroyProxy
- DynamicTree_EnlargeProxy
- DynamicTree_GetAABB
- DynamicTree_GetAreaRatio
- DynamicTree_GetByteCount
- DynamicTree_GetCategoryBits
- DynamicTree_GetHeight
- DynamicTree_GetProxyCount
- DynamicTree_GetRootBounds
- DynamicTree_GetUserData
- DynamicTree_Load
- DynamicTree_MoveProxy
- DynamicTree_Query
- DynamicTree_QueryClosest
- DynamicTree_RayCast
- DynamicTree_Rebuild
- DynamicTree_Save
- DynamicTree_SetCategoryBits
- DynamicTree_Validate
- DynamicTree_ValidateNoEnlarged
- GetAxisAngle
- GetByteCount
- GetCompoundCapsule
- GetCompoundChild
- GetCompoundHull
- GetCompoundMaterials
- GetCompoundMesh
- GetCompoundSphere
- GetGraphColor
- GetHeight
- GetHeightFieldCompressedHeights
- GetHeightFieldFlags
- GetHeightFieldMaterialIndices
- GetHullEdges
- GetHullFaces
- GetHullPlanes
- GetHullPoints
- GetHullVertices
- GetLengthAndNormalize
- GetLengthUnitsPerMeter
- GetMaxWorldCount
- GetMeshFlags
- GetMeshMaterialIndices
- GetMeshNodes
- GetMeshTriangles
- GetMeshVertices
- GetMilliseconds
- GetMillisecondsAndReset
- GetQuatAngle
- GetStallThreshold
- GetSweepTransform
- GetSwingAngle
- GetTicks
- GetTwistAngle
- GetVersion
- GetWorldCount
- HUGE
- Hash
- ID_EQUALS
- IS_NON_NULL
- IS_NULL
- InternalAssert
- InvMulQuat
- InvMulTransforms
- InvMulWorldTransforms
- InvRotateVector
- InvTransformPoint
- InvTransformWorldPoint
- InvertMatrix
- InvertT
- InvertTransform
- IsBoundedAABB
- IsDoublePrecision
- IsNormalized
- IsNormalizedQuat
- IsSaneAABB
- IsValidAABB
- IsValidFloat
- IsValidMatrix3
- IsValidPlane
- IsValidPosition
- IsValidQuat
- IsValidRay
- IsValidTransform
- IsValidVec3
- IsValidWorldTransform
- Joint_GetAngularSeparation
- Joint_GetBodyA
- Joint_GetBodyB
- Joint_GetCollideConnected
- Joint_GetConstraintForce
- Joint_GetConstraintTorque
- Joint_GetConstraintTuning
- Joint_GetForceThreshold
- Joint_GetLinearSeparation
- Joint_GetLocalFrameA
- Joint_GetLocalFrameB
- Joint_GetTorqueThreshold
- Joint_GetType
- Joint_GetUserData
- Joint_GetWorld
- Joint_IsValid
- Joint_SetCollideConnected
- Joint_SetConstraintTuning
- Joint_SetForceThreshold
- Joint_SetLocalFrameA
- Joint_SetLocalFrameB
- Joint_SetTorqueThreshold
- Joint_SetUserData
- Joint_WakeBodies
- LINEAR_SLOP
- LineDistance
- LoadBodyId
- LoadContactId
- LoadHeightField
- LoadJointId
- LoadRecordingFromFile
- LoadShapeId
- LoadWorldId
- MAX_AABB_MARGIN
- MESH_REST_OFFSET
- MIN_CAPSULE_LENGTH
- MakeAABB
- MakeBoxHull
- MakeCubeHull
- MakeDebugColor
- MakeMatrixFromQuat
- MakeOffsetBoxHull
- MakeQuatFromAxisAngle
- MakeQuatFromMatrix
- MakeScaledBoxHull
- MakeTransformedBoxHull
- MakeWorldTransform
- MaxFloat
- MaxInt
- MinFloat
- MinInt
- MotorJoint_GetAngularDampingRatio
- MotorJoint_GetAngularHertz
- MotorJoint_GetAngularVelocity
- MotorJoint_GetLinearDampingRatio
- MotorJoint_GetLinearHertz
- MotorJoint_GetLinearVelocity
- MotorJoint_GetMaxSpringForce
- MotorJoint_GetMaxSpringTorque
- MotorJoint_GetMaxVelocityForce
- MotorJoint_GetMaxVelocityTorque
- MotorJoint_SetAngularDampingRatio
- MotorJoint_SetAngularHertz
- MotorJoint_SetAngularVelocity
- MotorJoint_SetLinearDampingRatio
- MotorJoint_SetLinearHertz
- MotorJoint_SetLinearVelocity
- MotorJoint_SetMaxSpringForce
- MotorJoint_SetMaxSpringTorque
- MotorJoint_SetMaxVelocityForce
- MotorJoint_SetMaxVelocityTorque
- MulQuat
- MulTransforms
- MulWorldTransforms
- NLerp
- NegateQuat
- Normalize
- NormalizeQuat
- OVERLAP_SLOP
- OffsetAABB
- OffsetPos
- OverlapCapsule
- OverlapCompound
- OverlapHeightField
- OverlapHull
- OverlapMesh
- OverlapSphere
- ParallelJoint_GetMaxTorque
- ParallelJoint_GetSpringDampingRatio
- ParallelJoint_GetSpringHertz
- ParallelJoint_SetMaxTorque
- ParallelJoint_SetSpringDampingRatio
- ParallelJoint_SetSpringHertz
- Perp
- PointToSegmentDistance
- PrismaticJoint_EnableLimit
- PrismaticJoint_EnableMotor
- PrismaticJoint_EnableSpring
- PrismaticJoint_GetLowerLimit
- PrismaticJoint_GetMaxMotorForce
- PrismaticJoint_GetMotorForce
- PrismaticJoint_GetMotorSpeed
- PrismaticJoint_GetSpeed
- PrismaticJoint_GetSpringDampingRatio
- PrismaticJoint_GetSpringHertz
- PrismaticJoint_GetTargetTranslation
- PrismaticJoint_GetTranslation
- PrismaticJoint_GetUpperLimit
- PrismaticJoint_IsLimitEnabled
- PrismaticJoint_IsMotorEnabled
- PrismaticJoint_IsSpringEnabled
- PrismaticJoint_SetLimits
- PrismaticJoint_SetMaxMotorForce
- PrismaticJoint_SetMotorSpeed
- PrismaticJoint_SetSpringDampingRatio
- PrismaticJoint_SetSpringHertz
- PrismaticJoint_SetTargetTranslation
- QueryCompound
- QueryHeightField
- QueryMesh
- RayCastCapsule
- RayCastCompound
- RayCastHeightField
- RayCastHollowSphere
- RayCastHull
- RayCastMesh
- RayCastSphere
- ReadBinaryFile
- RecPlayer_Create
- RecPlayer_Destroy
- RecPlayer_DrawFrameQueries
- RecPlayer_GetBodyCount
- RecPlayer_GetBodyId
- RecPlayer_GetDivergeFrame
- RecPlayer_GetFrame
- RecPlayer_GetFrameCount
- RecPlayer_GetFrameQuery
- RecPlayer_GetFrameQueryCount
- RecPlayer_GetFrameQueryHit
- RecPlayer_GetInfo
- RecPlayer_GetKeyframeBudget
- RecPlayer_GetKeyframeBytes
- RecPlayer_GetKeyframeInterval
- RecPlayer_GetKeyframeMinInterval
- RecPlayer_GetWorldId
- RecPlayer_HasDiverged
- RecPlayer_IsAtEnd
- RecPlayer_Restart
- RecPlayer_SeekFrame
- RecPlayer_SetDebugShapeCallbacks
- RecPlayer_SetKeyframePolicy
- RecPlayer_SetWorkerCount
- RecPlayer_StepFrame
- Recording_GetData
- Recording_GetSize
- RevoluteJoint_EnableLimit
- RevoluteJoint_EnableMotor
- RevoluteJoint_EnableSpring
- RevoluteJoint_GetAngle
- RevoluteJoint_GetLowerLimit
- RevoluteJoint_GetMaxMotorTorque
- RevoluteJoint_GetMotorSpeed
- RevoluteJoint_GetMotorTorque
- RevoluteJoint_GetSpringDampingRatio
- RevoluteJoint_GetSpringHertz
- RevoluteJoint_GetTargetAngle
- RevoluteJoint_GetUpperLimit
- RevoluteJoint_IsLimitEnabled
- RevoluteJoint_IsMotorEnabled
- RevoluteJoint_IsSpringEnabled
- RevoluteJoint_SetLimits
- RevoluteJoint_SetMaxMotorTorque
- RevoluteJoint_SetMotorSpeed
- RevoluteJoint_SetSpringDampingRatio
- RevoluteJoint_SetSpringHertz
- RevoluteJoint_SetTargetAngle
- RotateVector
- RoundDownFloat
- RoundUpFloat
- SPECULATIVE_DISTANCE
- SafeScale
- SaveRecordingToFile
- ScaleBox
- SegmentDistance
- SetAllocator
- SetAssertFcn
- SetLengthUnitsPerMeter
- SetLogFcn
- SetStallThreshold
- ShapeCast
- ShapeCastCapsule
- ShapeCastCompound
- ShapeCastHeightField
- ShapeCastHull
- ShapeCastMesh
- ShapeCastSphere
- ShapeDistance
- Shape_ApplyWind
- Shape_AreContactEventsEnabled
- Shape_AreHitEventsEnabled
- Shape_ArePreSolveEventsEnabled
- Shape_AreSensorEventsEnabled
- Shape_ComputeMassData
- Shape_EnableContactEvents
- Shape_EnableHitEvents
- Shape_EnablePreSolveEvents
- Shape_EnableSensorEvents
- Shape_GetAABB
- Shape_GetBody
- Shape_GetCapsule
- Shape_GetClosestPoint
- Shape_GetContactCapacity
- Shape_GetContactData
- Shape_GetDensity
- Shape_GetFilter
- Shape_GetFriction
- Shape_GetHeightField
- Shape_GetHull
- Shape_GetMesh
- Shape_GetMeshMaterialCount
- Shape_GetMeshSurfaceMaterial
- Shape_GetRestitution
- Shape_GetSensorCapacity
- Shape_GetSensorData
- Shape_GetSphere
- Shape_GetSurfaceMaterial
- Shape_GetType
- Shape_GetUserData
- Shape_GetWorld
- Shape_IsSensor
- Shape_IsValid
- Shape_RayCast
- Shape_SetCapsule
- Shape_SetDensity
- Shape_SetFilter
- Shape_SetFriction
- Shape_SetHull
- Shape_SetMesh
- Shape_SetMeshMaterial
- Shape_SetRestitution
- Shape_SetSphere
- Shape_SetSurfaceMaterial
- Shape_SetUserData
- Sleep
- Solve3
- SolvePlanes
- SphericalJoint_EnableConeLimit
- SphericalJoint_EnableMotor
- SphericalJoint_EnableSpring
- SphericalJoint_EnableTwistLimit
- SphericalJoint_GetConeAngle
- SphericalJoint_GetConeLimit
- SphericalJoint_GetLowerTwistLimit
- SphericalJoint_GetMaxMotorTorque
- SphericalJoint_GetMotorTorque
- SphericalJoint_GetMotorVelocity
- SphericalJoint_GetSpringDampingRatio
- SphericalJoint_GetSpringHertz
- SphericalJoint_GetTargetRotation
- SphericalJoint_GetTwistAngle
- SphericalJoint_GetUpperTwistLimit
- SphericalJoint_IsConeLimitEnabled
- SphericalJoint_IsMotorEnabled
- SphericalJoint_IsSpringEnabled
- SphericalJoint_IsTwistLimitEnabled
- SphericalJoint_SetConeLimit
- SphericalJoint_SetMaxMotorTorque
- SphericalJoint_SetMotorVelocity
- SphericalJoint_SetSpringDampingRatio
- SphericalJoint_SetSpringHertz
- SphericalJoint_SetTargetRotation
- SphericalJoint_SetTwistLimits
- Steiner
- StoreBodyId
- StoreContactId
- StoreJointId
- StoreShapeId
- StoreWorldId
- TimeOfImpact
- ToPos
- ToRelativeTransform
- ToVec3
- TransformPoint
- TransformWorldPoint
- Transpose
- UnwindAngle
- VALIDATE
- ValidateReplay
- WeldJoint_GetAngularDampingRatio
- WeldJoint_GetAngularHertz
- WeldJoint_GetLinearDampingRatio
- WeldJoint_GetLinearHertz
- WeldJoint_SetAngularDampingRatio
- WeldJoint_SetAngularHertz
- WeldJoint_SetLinearDampingRatio
- WeldJoint_SetLinearHertz
- WheelJoint_EnableSpinMotor
- WheelJoint_EnableSteering
- WheelJoint_EnableSteeringLimit
- WheelJoint_EnableSuspension
- WheelJoint_EnableSuspensionLimit
- WheelJoint_GetLowerSteeringLimit
- WheelJoint_GetLowerSuspensionLimit
- WheelJoint_GetMaxSpinTorque
- WheelJoint_GetMaxSteeringTorque
- WheelJoint_GetSpinMotorSpeed
- WheelJoint_GetSpinSpeed
- WheelJoint_GetSpinTorque
- WheelJoint_GetSteeringAngle
- WheelJoint_GetSteeringDampingRatio
- WheelJoint_GetSteeringHertz
- WheelJoint_GetSteeringTorque
- WheelJoint_GetSuspensionDampingRatio
- WheelJoint_GetSuspensionHertz
- WheelJoint_GetTargetSteeringAngle
- WheelJoint_GetUpperSteeringLimit
- WheelJoint_GetUpperSuspensionLimit
- WheelJoint_IsSpinMotorEnabled
- WheelJoint_IsSteeringEnabled
- WheelJoint_IsSteeringLimitEnabled
- WheelJoint_IsSuspensionEnabled
- WheelJoint_IsSuspensionLimitEnabled
- WheelJoint_SetMaxSpinTorque
- WheelJoint_SetMaxSteeringTorque
- WheelJoint_SetSpinMotorSpeed
- WheelJoint_SetSteeringDampingRatio
- WheelJoint_SetSteeringHertz
- WheelJoint_SetSteeringLimits
- WheelJoint_SetSuspensionDampingRatio
- WheelJoint_SetSuspensionHertz
- WheelJoint_SetSuspensionLimits
- WheelJoint_SetTargetSteeringAngle
- World_CastMover
- World_CastRay
- World_CastRayClosest
- World_CastShape
- World_CollideMover
- World_Draw
- World_Dump
- World_DumpAwake
- World_DumpMemoryStats
- World_DumpShapeBounds
- World_EnableContinuous
- World_EnableSleeping
- World_EnableSpeculative
- World_EnableWarmStarting
- World_Explode
- World_GetAwakeBodyCount
- World_GetBodyEvents
- World_GetBounds
- World_GetContactEvents
- World_GetContactRecycleDistance
- World_GetCounters
- World_GetGravity
- World_GetHitEventThreshold
- World_GetJointEvents
- World_GetMaxCapacity
- World_GetMaximumLinearSpeed
- World_GetProfile
- World_GetRestitutionThreshold
- World_GetSensorEvents
- World_GetUserData
- World_GetWorkerCount
- World_IsContinuousEnabled
- World_IsSleepingEnabled
- World_IsValid
- World_IsWarmStartingEnabled
- World_OverlapAABB
- World_OverlapShape
- World_RebuildStaticTree
- World_SetContactRecycleDistance
- World_SetContactTuning
- World_SetCustomFilterCallback
- World_SetFrictionCallback
- World_SetGravity
- World_SetHitEventThreshold
- World_SetMaximumLinearSpeed
- World_SetPreSolveCallback
- World_SetRestitutionCallback
- World_SetRestitutionThreshold
- World_SetUserData
- World_SetWorkerCount
- World_StartRecording
- World_Step
- World_StopRecording
- WriteBinaryFile
- Yield
Types
AABB ¶
Axis aligned bounding box.
Related Procedures With Parameters
- AABB_Area
- AABB_Center
- AABB_Contains
- AABB_Extents
- AABB_Inflate
- AABB_Overlaps
- AABB_Transform
- AABB_Union
- ClosestPointToAABB
- DynamicTree_CreateProxy
- DynamicTree_EnlargeProxy
- DynamicTree_MoveProxy
- DynamicTree_Query
- IsBoundedAABB
- IsSaneAABB
- IsValidAABB
- OffsetAABB
- QueryCompound
- QueryHeightField
- QueryMesh
- World_OverlapAABB
AllocFcn ¶
Prototype for user allocation function.
@param size the allocation size in bytes @param alignment the required alignment, guaranteed to be a power of 2
Related Procedures With Parameters
AssertFcn ¶
Prototype for the user assert callback. Return 0 to skip the debugger break.
Related Procedures With Parameters
BodyCastResult ¶
BodyCastResult :: struct { // The shape hit. shapeId: ShapeId, // The world point on the shape surface. point: [3]f32, // The world normal vector on the shape surface. normal: [3]f32, // The fraction along the ray hit. // hit point = origin + fraction * translation fraction: f32, // The triangle index if the shape is a mesh or height-field. triangleIndex: i32, // The user material id at the hit point. This can be per triangle // if the shape is a mesh, height-field, or compound with child mesh. userMaterialId: u64, // The number of iterations used. Diagnostic. iterations: i32, // Did the cast hit? If false, all other fields are invalid. hit: bool, }
Body cast result for ray and shape casts.
Related Procedures With Returns
BodyDef ¶
BodyDef :: struct { // The body type: static, kinematic, or dynamic. type: BodyType, // The initial world position of the body. Bodies should be created with the desired position. // @note Creating bodies at the origin and then moving them nearly doubles the cost of body creation, especially // if the body is moved after shapes have been added. position: [3]f32, // The initial world rotation of the body. rotation: quaternion128, // The initial linear velocity of the body's origin. Usually in meters per second. linearVelocity: [3]f32, // The initial angular velocity of the body. Radians per second. angularVelocity: [3]f32, // Linear damping is used to reduce the linear velocity. The damping parameter // can be larger than 1 but the damping effect becomes sensitive to the // time step when the damping parameter is large. // Generally linear damping is undesirable because it makes objects move slowly // as if they are floating. linearDamping: f32, // Angular damping is used to reduce the angular velocity. The damping parameter // can be larger than 1.0f but the damping effect becomes sensitive to the // time step when the damping parameter is large. // Angular damping can be used to slow down rotating bodies. angularDamping: f32, // Scale the gravity applied to this body. Non-dimensional. gravityScale: f32, // Sleep speed threshold, default is 0.05 meters per second sleepThreshold: f32, // Optional body name for debugging. Up to B3_BODY_NAME_LENGTH characters (including null termination) name: cstring, // Use this to store application specific body data. userData: rawptr, // Motions locks to restrict linear and angular movement motionLocks: MotionLocks, // Set this flag to false if this body should never fall asleep. enableSleep: bool, // Is this body initially awake or sleeping? isAwake: bool, // Treat this body as a high speed object that performs continuous collision detection // against dynamic and kinematic bodies, but not other bullet bodies. // @warning Bullets should be used sparingly. They are not a solution for general dynamic-versus-dynamic // continuous collision. They do not guarantee accurate collision if both bodies are fast moving because // the bullet does a continuous check after all non-bullet bodies have moved. You could get unlucky and have // the bullet body end a time step very close to a non-bullet body and the non-bullet body then moves over // the bullet body. In continuous collision, initial overlap is ignored to avoid freezing bodies in place. // I do not recommend using them for game projectiles if precise collision timing is needed. Instead consider // using a ray or shape cast. You can use a marching ray or shape cast for projectile that moves over time. // If you want a fast moving projectile to collide with a fast moving target, you need to consider the relative // movement in your ray or shape cast. This is out of the scope of Box3D. // So what are good use cases for bullets? Pinball games or games with dynamic containers that hold other objects. // It should be a use case where it doesn't break the game if there is a collision missed, but having them // captured improves the quality of the game. isBullet: bool, // Used to disable a body. A disabled body does not move or collide. isEnabled: bool, // This allows this body to bypass rotational speed limits. Should only be used // for circular objects, like wheels. allowFastRotation: bool, // Enable contact recycling. True by default. Leaving this enabled improves performance // but may lead to ghost collision that should be avoided on characters. enableContactRecycling: bool, // Used internally to detect a valid definition. DO NOT SET. internalValue: i32, }
A body definition holds all the data needed to construct a rigid body. You can safely re-use body definitions. Shapes are added to a body after construction. Body definitions are temporary objects used to bundle creation parameters. Must be initialized using b3DefaultBodyDef(). @ingroup body
Related Procedures With Parameters
Related Procedures With Returns
BodyEvents ¶
BodyEvents :: struct { // Array of move events moveEvents: [^]BodyMoveEvent `fmt:"v,moveCount"`, // Number of move events moveCount: i32, }
Body events are buffered in the world and are available
as event arrays after the time step is complete. Note: this data becomes invalid if bodies are destroyed
Related Procedures With Returns
BodyId ¶
/ Body id references a body instance. This should be treated as an opaque handle.
Related Procedures With Parameters
- Body_ApplyAngularImpulse
- Body_ApplyForce
- Body_ApplyForceToCenter
- Body_ApplyLinearImpulse
- Body_ApplyLinearImpulseToCenter
- Body_ApplyMassFromShapes
- Body_ApplyTorque
- Body_CastRay
- Body_CastShape
- Body_CollideMover
- Body_ComputeAABB
- Body_Disable
- Body_Enable
- Body_EnableContactRecycling
- Body_EnableHitEvents
- Body_EnableSleep
- Body_GetAngularDamping
- Body_GetAngularVelocity
- Body_GetClosestPoint
- Body_GetContactCapacity
- Body_GetContactData
- Body_GetGravityScale
- Body_GetInverseMass
- Body_GetJointCount
- Body_GetJoints
- Body_GetLinearDamping
- Body_GetLinearVelocity
- Body_GetLocalCenterOfMass
- Body_GetLocalPoint
- Body_GetLocalPointVelocity
- Body_GetLocalRotationalInertia
- Body_GetLocalVector
- Body_GetMass
- Body_GetMassData
- Body_GetMotionLocks
- Body_GetName
- Body_GetPosition
- Body_GetRotation
- Body_GetShapeCount
- Body_GetShapes
- Body_GetSleepThreshold
- Body_GetTransform
- Body_GetType
- Body_GetUserData
- Body_GetWorld
- Body_GetWorldCenterOfMass
- Body_GetWorldInverseRotationalInertia
- Body_GetWorldPoint
- Body_GetWorldPointVelocity
- Body_GetWorldVector
- Body_IsAwake
- Body_IsBullet
- Body_IsContactRecyclingEnabled
- Body_IsEnabled
- Body_IsSleepEnabled
- Body_IsValid
- Body_OverlapShape
- Body_SetAngularDamping
- Body_SetAngularVelocity
- Body_SetAwake
- Body_SetBullet
- Body_SetGravityScale
- Body_SetLinearDamping
- Body_SetLinearVelocity
- Body_SetMassData
- Body_SetMotionLocks
- Body_SetName
- Body_SetSleepThreshold
- Body_SetTargetTransform
- Body_SetTransform
- Body_SetType
- Body_SetUserData
- CreateCapsuleShape
- CreateCompoundShape
- CreateHeightFieldShape
- CreateHullShape
- CreateMeshShape
- CreateSphereShape
- CreateTransformedHullShape
- DestroyBody
- StoreBodyId
Related Procedures With Returns
Related Constants
BodyMoveEvent ¶
BodyMoveEvent :: struct { // The body user data. userData: rawptr, // The body transform. transform: WorldTransform, // The body id. bodyId: BodyId, // Did the body fall asleep this time step? fellAsleep: bool, }
Body move events triggered when a body moves. Triggered when a body moves due to simulation. Not reported for bodies moved by the user. This also has a flag to indicate that the body went to sleep so the application can also sleep that actor/entity/object associated with the body. On the other hand if the flag does not indicate the body went to sleep then the application can treat the actor/entity/object associated with the body as awake. This is an efficient way for an application to update game object transforms rather than calling functions such as b3Body_GetTransform() because this data is delivered as a contiguous array and it is only populated with bodies that have moved. @note If sleeping is disabled all dynamic and kinematic bodies will trigger move events.
BodyPlaneResult ¶
BodyPlaneResult :: struct { // The shape id on the body. shapeId: ShapeId, // The plane result. result: PlaneResult, }
Body plane result for movers.
Related Procedures With Parameters
BodyType ¶
BodyType :: enum i32 { // zero mass, zero velocity, may be manually moved staticBody = 0, // zero mass, velocity set by user, moved by solver kinematicBody = 1, // positive mass, velocity determined by forces, moved by solver dynamicBody = 2, }
The body simulation type. Each body is one of these three types. The type determines how the body behaves in the simulation. @ingroup body
Related Procedures With Parameters
Related Procedures With Returns
BoxCastInput ¶
BoxCastInput :: struct { // The AABB to cast, in the tree's frame. box: AABB, // The sweep translation. translation: [3]f32, // The maximum fraction of the translation to consider, typically 1. maxFraction: f32, }
Input for sweeping an AABB through a dynamic tree. The box is in the tree's world float frame. The caller folds the cast shape radius and any world origin into the box, so the tree traversal stays a conservative box sweep and the precise narrow phase happens per shape in the callback.
Related Procedures With Parameters
BoxHull ¶
BoxHull :: struct { // The embedded hull. So the offsets index into the arrays that follow. base: HullData, boxVertices: [8]HullVertex, // < Box vertices. boxPoints: [8][3]f32, // < Box points. boxEdges: [24]HullHalfEdge, // < Box half-edges. boxFaces: [6]HullFace, // < Box faces. padding: [2]u8, // < Explicit padding, see b3HullData::padding. boxPlanes: [6]Plane, }
Efficient box hull
Related Procedures With Returns
Capacity ¶
Capacity :: struct { // Number of expected static shapes. staticShapeCount: i32, // Number of expected dynamic and kinematic shapes. dynamicShapeCount: i32, // Number of expected static bodies. staticBodyCount: i32, // Number of expected dynamic and kinematic bodies. dynamicBodyCount: i32, // Number of expected contacts. contactCount: i32, }
Optional world capacities that can be use to avoid run-time allocations @ingroup world
Related Procedures With Returns
Capsule ¶
Capsule :: struct { // Local center of the first hemisphere center1: [3]f32, // Local center of the second hemisphere center2: [3]f32, // The radius of the hemispheres radius: f32, }
A solid capsule can be viewed as two hemispheres connected by a rectangle.
Related Procedures With Parameters
Related Procedures With Returns
CastOutput ¶
CastOutput :: struct { // The surface normal at the hit point. normal: [3]f32, // The surface hit point in world space. point: [3]f32, // The fraction of the input translation at collision. fraction: f32, // The number of iterations used. iterations: i32, // The index of the mesh or height field triangle hit. triangleIndex: i32, // The index of the compound child shape. childIndex: i32, // The material index. May be -1 for null. materialIndex: i32, // Did the cast hit? hit: bool, }
Low level ray cast or shape-cast output data.
CastResultFcn ¶
CastResultFcn :: proc "c" (shapeId: ShapeId, point: [3]f32, normal: [3]f32, fraction: f32, userMateriald: u64, triangleIndex: i32, childIndex: i32, ctx: rawptr) -> f32
Prototype callback for ray casts. Called for each shape found in the query. You control how the ray cast proceeds by returning a float: return -1: ignore this shape and continue return 0: terminate the ray cast return fraction: clip the ray to this point return 1: don't clip the ray and continue @param shapeId the shape hit by the ray @param point the point of initial intersection @param normal the normal vector at the point of intersection @param fraction the fraction along the ray at the point of intersection @param userMaterialId the shape or triangle surface type @param triangleIndex the triangle index for mesh or height field shapes or -1 for other shape types @param childIndex the child shape index for compound shapes @param context the user context @return -1 to filter, 0 to terminate, fraction to clip the ray for closest hit, 1 to continue @see b3World_CastRay @ingroup world
Related Procedures With Parameters
ChildShape ¶
ChildShape :: struct { // Tagged union. using _: struct #raw_union { capsule: Capsule, // < Capsule. hull: ^HullData, // < Hull. mesh: Mesh, // < Mesh. sphere: Sphere, }, // Transform of the shape into compound local space. transform: Transform, // Material indices. Index 0 is used for convex shapes. // todo limit to 64K? materialIndices: [4]i32, // The shape type (union tag). type: ShapeType, }
Child shape of a compound
Related Procedures With Returns
CollisionPlane ¶
CollisionPlane :: struct { // The collision plane between the mover and some shape. plane: Plane, // Setting this to FLT_MAX makes the plane as rigid as possible. Lower values can // make the plane collision soft. Usually in meters. pushLimit: f32, // The push on the mover determined by b3SolvePlanes. Usually in meters. push: f32, // Indicates if b3ClipVector should clip against this plane. Should be false for soft collision. clipVelocity: bool, }
These are collision planes that can be fed to b3SolvePlanes. Normally this is assembled by the user from plane results in b3PlaneResult.
Related Procedures With Parameters
CompoundCapsule ¶
CompoundCapsule :: struct { // Local capsule. capsule: Capsule, // Index to a shared material. materialIndex: i32, }
A capsule that lives in a compound.
Related Procedures With Returns
CompoundCapsuleDef ¶
CompoundCapsuleDef :: struct { // Local capsule. capsule: Capsule, // Material properties. material: SurfaceMaterial, }
Definition for a capsule in a compound shape.
CompoundData ¶
CompoundData :: struct { // The compound version is always first. version: u64, // The total number of bytes for this compound. byteCount: i32, // Offset of the tree node array in bytes from the struct address. nodeOffset: i32, // Immutable dynamic tree. The tree node pointer must be fixed up using the node offset tree: DynamicTree, // Offset of the material array in bytes from the struct address. materialOffset: i32, // The number of materials. materialCount: i32, // Offset of the capsule array in bytes from the struct address. capsuleOffset: i32, // The number of capsules. capsuleCount: i32, // Offset of the hull instance array in bytes from the struct address. hullOffset: i32, // The number of hull instances. hullCount: i32, // The number of unique hulls. Diagnostic. sharedHullCount: i32, // Offset of the mesh instance array in bytes from the struct address. meshOffset: i32, // The number of mesh instances. meshCount: i32, // The number of unique meshes. Diagnostic. sharedMeshCount: i32, // Offset of the sphere array in bytes from the struct address. sphereOffset: i32, // The number of spheres. sphereCount: i32, }
The runtime data for a compound shape. This is a potentially large yet highly optimized data structure. It can contain thousands of child shapes, yet at runtime it populates into the world as a single shape in the runtime broad-phase. This data structure has data living off the end and must be accessed using offsets. Accessors are provided for user relevant data.
Related Procedures With Parameters
Related Procedures With Returns
CompoundDef ¶
CompoundDef :: struct { // Capsule instances. capsules: [^]CompoundCapsuleDef `fmt:"v,capsuleCount"`, // Number of capsules. capsuleCount: int, // Hulls instances. hulls: [^]CompoundHullDef `fmt:"v,hullCount"`, // Number of hull instances. hullCount: int, // Mesh instances. meshes: [^]CompoundMeshDef `fmt:"v,meshCount"`, // Number of mesh instances. meshCount: int, // Sphere instances. spheres: [^]CompoundSphereDef `fmt:"v,sphereCount"`, // Number of spheres. sphereCount: int, }
Definition for creating a compound shape. All this data is fully cloned into the run-time compound shape.
Related Procedures With Parameters
CompoundHull ¶
CompoundHull :: struct { // Pointer to the unique shared hull. hull: ^HullData, // The transform of this hull instance. transform: Transform, // Index to a shared material. materialIndex: i32, }
A hull that lives in a compound.
Related Procedures With Returns
CompoundHullDef ¶
CompoundHullDef :: struct { // Shared hull. hull: ^HullData, // Transform of the shared hull into compound local space. transform: Transform, // Material properties. material: SurfaceMaterial, }
Definition for a convex hull in a compound shape.
CompoundMesh ¶
CompoundMesh :: struct { // Pointer to the unique shared mesh. meshData: [^]MeshData, // The transform of this mesh instance. transform: Transform, // Non-uniform scale of this mesh instance. scale: [3]f32, // This is used to access the surface material from b3GetCompoundMaterials. // Requires an extra level of indirection. The triangle material index // is clamped to B3_MAX_COMPOUND_MESH_MATERIALS. // materialIndex = materialIndices[triangle->materialIndex] materialIndices: [4]i32, }
A mesh with non-uniform scale that lives in a compound.
Related Procedures With Returns
CompoundMeshDef ¶
CompoundMeshDef :: struct { // Shared mesh. meshData: ^MeshData, // Transform of the shared mesh into compound local space. transform: Transform, // Local space non-uniform mesh scale. May have negative components. scale: [3]f32, // Material properties. // This array must line up with the material indices on the triangles. materials: [^]SurfaceMaterial `fmt:"v,materialCount"`, // Number of materials. materialCount: i32, }
Definition for a triangle mesh in a compound shape.
CompoundQueryFcn ¶
CompoundQueryFcn :: proc "c" (#by_ptr compound: CompoundData, childIndex: i32, ctx: rawptr) -> bool
Callback for compound overlap queries.
Related Procedures With Parameters
CompoundSphere ¶
CompoundSphere :: struct { // Local sphere. sphere: Sphere, // Index to a shared material. materialIndex: i32, }
A sphere that lives in a compound.
Related Procedures With Returns
CompoundSphereDef ¶
CompoundSphereDef :: struct { // Local sphere. sphere: Sphere, // Material properties. material: SurfaceMaterial, }
Definition for a sphere in a compound shape.
ContactBeginTouchEvent ¶
ContactBeginTouchEvent :: struct { // Id of the first shape // @warning this shape may have been destroyed // @see b3Shape_IsValid shapeIdA: ShapeId, // Id of the first shape // @warning this shape may have been destroyed // @see b3Shape_IsValid shapeIdB: ShapeId, // Id of the contact. // @warning this contact may have been destroyed // @see b3Contact_IsValid contactId: ContactId, }
A begin-touch event is generated when two shapes begin touching.
ContactData ¶
ContactData :: struct { // The contact id. You may hold onto this to track a contact across time steps. // This id may become orphaned. Use b3Contact_IsValid before using it for other functions. contactId: ContactId, // The first shape id. shapeIdA: ShapeId, // The second shape id. shapeIdB: ShapeId, // The contact manifold. This points to internal data and may become invalid. Do not store // this pointer. manifolds: [^]Manifold `fmt:"v,manifoldCount"`, // The number of contact manifolds. For mesh and height-field collision there can be multiple manifolds. manifoldCount: i32, }
The contact data for two shapes. By convention the manifold normal points from shape A to shape B. @see b3Shape_GetContactData() and b3Body_GetContactData()
Related Procedures With Parameters
Related Procedures With Returns
ContactEndTouchEvent ¶
ContactEndTouchEvent :: struct { // Id of the first shape // @warning this shape may have been destroyed // @see b3Shape_IsValid shapeIdA: ShapeId, // Id of the first shape // @warning this shape may have been destroyed // @see b3Shape_IsValid shapeIdB: ShapeId, // Id of the contact. // @warning this contact may have been destroyed // @see b3Contact_IsValid contactId: ContactId, }
An end touch event is generated when two shapes stop touching.
You will get an end event if you do anything that destroys contacts previous to the last world step. These include things like setting the transform, destroying a body or shape, or changing a filter or body type.
ContactEvents ¶
ContactEvents :: struct { // Array of begin touch events beginEvents: [^]ContactBeginTouchEvent `fmt:"v,beginCount"`, // Array of end touch events endEvents: [^]ContactEndTouchEvent `fmt:"v,endCount"`, // Array of hit events hitEvents: [^]ContactHitEvent `fmt:"v,hitCount"`, // Number of begin touch events beginCount: i32, // Number of end touch events endCount: i32, // Number of hit events hitCount: i32, }
Contact events are buffered in the world and are available
as event arrays after the time step is complete. Note: these may become invalid if bodies and/or shapes are destroyed
Related Procedures With Returns
ContactHitEvent ¶
ContactHitEvent :: struct { // Id of the first shape shapeIdA: ShapeId, // Id of the second shape shapeIdB: ShapeId, // Id of the contact. // @warning this contact may have been destroyed // @see b3Contact_IsValid contactId: ContactId, // Point where the shapes hit at the beginning of the time step. // This is a mid-point between the two surfaces. It could be at speculative // point where the two shapes were not touching at the beginning of the time step. point: [3]f32, // Normal vector pointing from shape A to shape B normal: [3]f32, // The speed the shapes are approaching. Always positive. Typically in meters per second. approachSpeed: f32, // User material on shape A userMaterialIdA: u64, // User material on shape B userMaterialIdB: u64, }
A hit touch event is generated when two shapes collide with a speed faster than the hit speed threshold. This may be reported for speculative contacts that have a confirmed impulse.
ContactId ¶
/ Contact id references a contact instance. This should be treated as an opaque handle.
Related Procedures With Parameters
Related Procedures With Returns
Related Constants
CosSin ¶
Cosine and sine pair. This uses a custom implementation designed for cross-platform determinism.
Related Procedures With Returns
Counters ¶
Counters :: struct { bodyCount: i32, shapeCount: i32, contactCount: i32, jointCount: i32, islandCount: i32, stackUsed: i32, arenaCapacity: i32, staticTreeHeight: i32, treeHeight: i32, satCallCount: i32, satCacheHitCount: i32, byteCount: i32, taskCount: i32, colorCounts: [24]i32, manifoldCounts: [8]i32, // Number of contacts touched by the collide pass // graph contacts + awake-set non-touching awakeContactCount: i32, // Number of contacts recycled in the most recent step. recycledContactCount: i32, // Maximum number of time of impact iterations distanceIterations: i32, pushBackIterations: i32, rootIterations: i32, }
Counters that give details of the simulation size. @ingroup world
Related Procedures With Returns
CreateDebugShapeCallback ¶
CreateDebugShapeCallback :: proc "c" (debugShape: ^DebugShape, userContext: rawptr) -> rawptr
The user needs to be able to create debug draw shapes for multi-pass rendering to work efficiently. These user shapes are created and destroyed via callback so they can be bound to shape lifetime and scaling updates. @ingroup debug_draw
Related Procedures With Parameters
CustomFilterFcn ¶
Prototype for a contact filter callback. This is called when a contact pair is considered for collision. This allows you to perform custom logic to prevent collision between shapes. This is only called if one of the two shapes has custom filtering enabled. @see b3ShapeDef. Notes: this function must be thread-safe this is only called if one of the two shapes has enabled custom filtering this is called only for awake dynamic bodies Return false if you want to disable the collision @warning Do not attempt to modify the world inside this callback @ingroup world
Related Procedures With Parameters
DebugDraw ¶
DebugDraw :: struct { // Draws a shape and returns true if drawing should continue DrawShapeFcn: proc "c" (userShape: rawptr, transform: WorldTransform, color: HexColor, ctx: rawptr) -> bool, // Draw a line segment. DrawSegmentFcn: proc "c" (p1, p2: [3]f32, color: HexColor, ctx: rawptr), // Draw a transform. Choose your own length scale. DrawTransformFcn: proc "c" (transform: WorldTransform, ctx: rawptr), // Draw a point. DrawPointFcn: proc "c" (p: [3]f32, size: f32, color: HexColor, ctx: rawptr), // Draw a sphere. DrawSphereFcn: proc "c" (p: [3]f32, radius: f32, color: HexColor, alpha: f32, ctx: rawptr), // Draw a capsule. DrawCapsuleFcn: proc "c" (p1, p2: [3]f32, radius: f32, color: HexColor, alpha: f32, ctx: rawptr), // Draw a bounding box. DrawBoundsFcn: proc "c" (aabb: AABB, color: HexColor, ctx: rawptr), // Draw an oriented box. DrawBoxFcn: proc "c" (extents: [3]f32, transform: WorldTransform, color: HexColor, ctx: rawptr), // Draw a string in world space DrawStringFcn: proc "c" (p: [3]f32, s: cstring, color: HexColor, ctx: rawptr), // World bounds to use for debug draw drawingBounds: AABB, // Scale to use when drawing forces forceScale: f32, // Global scaling for joint drawing jointScale: f32, // Option to draw shapes drawShapes: bool, // Option to draw joints drawJoints: bool, // Option to draw additional information for joints drawJointExtras: bool, // Option to draw the bounding boxes for shapes drawBounds: bool, // Option to draw the mass and center of mass of dynamic bodies drawMass: bool, // Option to draw body names drawBodyNames: bool, // Option to draw contact points drawContacts: bool, // Draw contact anchor A or B drawAnchorA: i32, // Option to visualize the graph coloring used for contacts and joints drawGraphColors: bool, // Option to draw contact features drawContactFeatures: bool, // Option to draw contact normals drawContactNormals: bool, // Option to draw contact normal forces drawContactForces: bool, // Option to draw contact friction forces drawFrictionForces: bool, // Option to draw islands as bounding boxes drawIslands: bool, // User context that is passed as an argument to drawing callback functions ctx: rawptr, }
This struct is passed to b3World_Draw to draw a debug view of the simulation world. Callbacks receive world coordinates. In large world mode the translation is double precision so it stays accurate far from the origin. Shift into your own camera frame inside the callbacks.
Related Procedures With Parameters
Related Procedures With Returns
DebugMaterial ¶
DebugMaterial :: enum u32 { Default = 0, Matte, Soft, Dead, Glossy, Metallic, }
Debug draw material preset. Optionally packed into the unused high byte of a b3HexColor (or b3SurfaceMaterial::customColor) to drive the renderer's PBR roughness and metalness. The low 24 bits stay RGB, so a plain 0xRRGGBB color reads as b3_debugMaterialDefault and keeps the renderer's per-body-type look.
Related Procedures With Parameters
DebugShape ¶
DebugShape :: struct { // Shape id. shapeId: ShapeId, // Shape type. type: ShapeType, // Tagged union. using _: struct #raw_union { capsule: ^Capsule `raw_union_tag:"type=.capsuleShape"`, // < Capsule shape. compound: ^CompoundData `raw_union_tag:"type=.compoundShape"`, // < Compound shape. heightField: ^HeightFieldData `raw_union_tag:"type=.heightShape"`, // < Height-field shape. hull: ^HullData `raw_union_tag:"type=.hullShape"`, // < Convex hull shape. mesh: ^Mesh `raw_union_tag:"type=.meshShape"`, // < Mesh shape with scale. sphere: ^Sphere `raw_union_tag:"type=.sphereShape"`, }, }
This is sent to the user for debug shape creation. The user should know the type in case they have custom sphere or capsule rendering.
DestroyDebugShapeCallback ¶
Related Procedures With Parameters
DistanceInput ¶
DistanceInput :: struct { // The proxy for shape A proxyA: ShapeProxy, // The proxy for shape B proxyB: ShapeProxy, // Transform of shape B in shape A's frame, the relative pose B in A // (b3InvMulWorldTransforms( worldA, worldB )). The query is origin independent and runs in frame A. transform: Transform, // Should the proxy radius be considered? useRadii: bool, }
Input for ShapeDistance
Related Procedures With Parameters
DistanceJointDef ¶
DistanceJointDef :: struct { // Base joint definition using base: JointDef, // The rest length of this joint. Clamped to a stable minimum value. length: f32, // Enable the distance constraint to behave like a spring. If false // then the distance joint will be rigid, overriding the limit and motor. enableSpring: bool, // The lower spring force controls how much tension it can sustain lowerSpringForce: f32, // The upper spring force controls how much compression it can sustain upperSpringForce: f32, // The spring linear stiffness Hertz, cycles per second hertz: f32, // The spring linear damping ratio, non-dimensional dampingRatio: f32, // Enable/disable the joint limit enableLimit: bool, // Minimum length. Clamped to a stable minimum value. minLength: f32, // Maximum length. Must be greater than or equal to the minimum length. maxLength: f32, // Enable/disable the joint motor enableMotor: bool, // The maximum motor force, usually in newtons maxMotorForce: f32, // The desired motor speed, usually in meters per second motorSpeed: f32, }
Distance joint definition. Connects a point on body A with a point on body B by a segment. Useful for ropes and springs. @ingroup distance_joint
Related Procedures With Parameters
Related Procedures With Returns
DistanceOutput ¶
DistanceOutput :: struct { pointA: [3]f32, // < Closest point on shapeA, in shape A's frame pointB: [3]f32, // < Closest point on shapeB, in shape A's frame normal: [3]f32, // < A to B normal in shape A's frame. Invalid if distance is zero. distance: f32, // < The final distance, zero if overlapped iterations: i32, // < Number of GJK iterations used simplexCount: i32, }
Output for b3ShapeDistance
Related Procedures With Returns
DynamicTree ¶
DynamicTree :: struct { // The dynamic tree version. Always the first field. Useful // if the tree is serialized. version: u64, // The tree nodes nodes: [^]TreeNode `fmt:"v,nodeCapacity"`, // The root index root: i32, // The number of nodes nodeCount: i32, // The allocated node space nodeCapacity: i32, // Number of proxies created proxyCount: i32, // Node free list freeList: i32, // Leaf indices for rebuild leafIndices: [^]int, // Leaf bounding boxes for rebuild leafBoxes: [^]AABB, // Leaf bounding box centers for rebuild leafCenters: [^][3]f32, // Bins for sorting during rebuild binIndices: [^]i32, // Allocated space for rebuilding rebuildCapacity: i32, }
The dynamic tree structure. This should be considered private data. It is placed here for performance reasons.
Related Procedures With Parameters
- DynamicTree_BoxCast
- DynamicTree_CreateProxy
- DynamicTree_Destroy
- DynamicTree_DestroyProxy
- DynamicTree_EnlargeProxy
- DynamicTree_GetAABB
- DynamicTree_GetAreaRatio
- DynamicTree_GetByteCount
- DynamicTree_GetCategoryBits
- DynamicTree_GetHeight
- DynamicTree_GetProxyCount
- DynamicTree_GetRootBounds
- DynamicTree_GetUserData
- DynamicTree_MoveProxy
- DynamicTree_Query
- DynamicTree_QueryClosest
- DynamicTree_RayCast
- DynamicTree_Rebuild
- DynamicTree_Save
- DynamicTree_SetCategoryBits
- DynamicTree_Validate
- DynamicTree_ValidateNoEnlarged
Related Procedures With Returns
EnqueueTaskCallback ¶
EnqueueTaskCallback :: proc "c" (task: rawptr, taskContext: rawptr, userContext: rawptr, taskName: cstring) -> rawptr
These functions can be provided to Box3D to invoke a task system. Returns a pointer to the user's task object. May be nullptr. A nullptr indicates to Box3D that the work was executed serially within the callback and there is no need to call b3FinishTaskCallback. Otherwise the returned value must be non-null will be passed to b3FinishTaskCallback as the userTask. @param task the Box3D task to be called by the scheduler @param taskContext the Box3D context object that the scheduler must pass to the task @param userContext the scheduler context object that is opaque to Box3D @param taskName the Box3D task name that the scheduler can use for diagnostics @ingroup world
ExplosionDef ¶
ExplosionDef :: struct { // Mask bits to filter shapes maskBits: u64, // The center of the explosion in world space position: [3]f32, // The radius of the explosion radius: f32, // The falloff distance beyond the radius. Impulse is reduced to zero at this distance. falloff: f32, // Impulse per unit area. This applies an impulse according to the shape area that // is facing the explosion. Explosions only apply to spheres, capsules, and hulls. This // may be negative for implosions. impulsePerArea: f32, }
The explosion definition is used to configure options for explosions. Explosions consider shape geometry when computing the impulse. @ingroup world
Related Procedures With Parameters
Related Procedures With Returns
FeaturePair ¶
FeaturePair :: struct { // Incoming type (either edge on shape A or shape B) owner1: u8, // Incoming edge index (into associated shape array) index1: u8, // Outgoing type (either edge on shape A or shape B) owner2: u8, // Outgoing edge index (into associated shape array) index2: u8, }
Contact points are always the result of two edges intersecting. It can be two edges of the same shape, which is just a shape vertex. Or a contact point can be the result of two edges crossing from different shapes. This is designed to support hull versus hull, but it is adapted to work with all shape types. The feature pair is used to identify contact points for temporal coherence and warm starting.
Filter ¶
Filter :: struct { // The collision category bits. Normally you would just set one bit. The category bits should // represent your application object types. For example: // @code{.odin} // My_Categories :: enum u64 { // Static = 0x00000001, // Dynamic = 0x00000002, // Debris = 0x00000004, // Player = 0x00000008, // // etc // }; // @endcode // Or use a bit_set. categoryBits: u64, // The collision mask bits. This states the categories that this // shape would accept for collision. // For example, you may want your player to only collide with static objects // and other players. // @code{.odin} // maskBits = u64(My_Categories.Static | My_Categories.Player); // @endcode maskBits: u64, // Collision groups allow a certain group of objects to never collide (negative) // or always collide (positive). A group index of zero has no effect. Non-zero group filtering // always wins against the mask bits. // For example, you may want ragdolls to collide with other ragdolls but you don't want // ragdoll self-collision. In this case you would give each ragdoll a unique negative group index // and apply that group index to all shapes on the ragdoll. groupIndex: i32, }
This is used to filter collision on shapes. It affects shape-vs-shape collision and shape-versus-query collision (such as b3World_CastRay). @ingroup shape
Related Procedures With Parameters
Related Procedures With Returns
FilterJointDef ¶
FilterJointDef :: struct { // Base joint definition using base: JointDef, }
A filter joint is used to disable collision between two specific bodies. @ingroup filter_joint
Related Procedures With Parameters
Related Procedures With Returns
FinishTaskCallback ¶
Finishes a user task object that wraps a Box3D task. This must block until the task has completed. The step blocks here on the tasks it spawned, so b3World_Step holds its stack across every fork/join. Drive it from a thread you can dedicate to the step, or from a fiber this callback can park to free the underlying thread. In a job system that cannot park a job's stack, do not call b3World_Step from inside a job: a job that blocks on its own sub-jobs without yielding its thread can deadlock. The in-tree scheduler instead runs other pending tasks on the waiting thread. @ingroup world
FreeFcn ¶
FreeFcn :: proc "c" (mem: rawptr)
Prototype for user free function.
@param mem the memory previously allocated through `AllocFcn`
Related Procedures With Parameters
FrictionCallback ¶
FrictionCallback :: proc "c" (frictionA: f32, userMaterialIdA: u64, frictionB: f32, userMaterialIdB: u64) -> f32
Optional friction mixing callback. This intentionally provides no context objects because this is called from a worker thread. @warning This function should not attempt to modify Box3D state or user application state. @ingroup world
Related Procedures With Parameters
HeightFieldData ¶
HeightFieldData :: struct { // Version must be first and match B3_HEIGHT_FIELD_VERSION version: i64, // The total number of bytes for this height field. byteCount: i32, // Hash of this height field (this field is zero when the hash is computed). hash: u32, // The local axis-aligned bounding box. aabb: AABB, // The minimum y value. minHeight: f32, // The maximum y value maxHeight: f32, // The quantization scale. heightScale: f32, // The overall scale. scale: [3]f32, // The number of grid columns along the local x-axis. columnCount: i32, // The number of grid rows along the local z-axis. rowCount: i32, // Offset of the compressed height array in bytes from the struct address. // uint16_t, one per grid point. heightsOffset: i32, // Offset of the material index array in bytes from the struct address. // uint8_t, one per cell. materialOffset: i32, // Offset of the flag array in bytes from the struct address. // uint8_t, one per triangle. flagsOffset: i32, // Triangle winding. clockwise: bool, // Explicit padding. Identity is a content hash over raw bytes, so there must // be no unnamed padding for struct copies to scramble. padding: [3]u8, }
A height field with compressed storage. @note This data structure has data hanging off the end and cannot be directly copied.
Related Procedures With Parameters
Related Procedures With Returns
HeightFieldDef ¶
HeightFieldDef :: struct { // Grid point heights // count = countX * countZ heights: [^]f32, // Grid cell material // A value of 0xFF is reserved for holes // count = (countX - 1) * (countZ - 1) materialIndices: [^]u8, // The height field scale. All components must be positive values. scale: [3]f32, // The number of grid lines along the x-axis. countX: i32, // The number of grid lines along the z-axis. countZ: i32, // Global minimum and maximum heights used for quantization. This is important // if you want height fields to be placed next to each other and line up exactly. // In that case, both height fields should use the same minimum and maximum heights. // All height values are clamped to this range. // These values are in unscaled space. globalMinimumHeight: f32, // The maximum. globalMaximumHeight: f32, // Use clock-wise winding. This effectively inverts the height-field along the y-axis. clockwiseWinding: bool, }
Data used to create a height field
Related Procedures With Parameters
HexColor ¶
HexColor :: enum u32 { AliceBlue = 15792383, AntiqueWhite = 16444375, Aqua = 65535, Aquamarine = 8388564, Azure = 15794175, Beige = 16119260, Bisque = 16770244, Black = 0, BlanchedAlmond = 16772045, Blue = 255, BlueViolet = 9055202, Brown = 10824234, Burlywood = 14596231, CadetBlue = 6266528, Chartreuse = 8388352, Chocolate = 13789470, Coral = 16744272, CornflowerBlue = 6591981, Cornsilk = 16775388, Crimson = 14423100, Cyan = 65535, DarkBlue = 139, DarkCyan = 35723, DarkGoldenRod = 12092939, DarkGray = 11119017, DarkGreen = 25600, DarkKhaki = 12433259, DarkMagenta = 9109643, DarkOliveGreen = 5597999, DarkOrange = 16747520, DarkOrchid = 10040012, DarkRed = 9109504, DarkSalmon = 15308410, DarkSeaGreen = 9419919, DarkSlateBlue = 4734347, DarkSlateGray = 3100495, DarkTurquoise = 52945, DarkViolet = 9699539, DeepPink = 16716947, DeepSkyBlue = 49151, DimGray = 6908265, DodgerBlue = 2003199, FireBrick = 11674146, FloralWhite = 16775920, ForestGreen = 2263842, Fuchsia = 16711935, Gainsboro = 14474460, GhostWhite = 16316671, Gold = 16766720, GoldenRod = 14329120, Gray = 8421504, Green = 32768, GreenYellow = 11403055, HoneyDew = 15794160, HotPink = 16738740, IndianRed = 13458524, Indigo = 4915330, Ivory = 16777200, Khaki = 15787660, Lavender = 15132410, LavenderBlush = 16773365, LawnGreen = 8190976, LemonChiffon = 16775885, LightBlue = 11393254, LightCoral = 15761536, LightCyan = 14745599, LightGoldenRodYellow = 16448210, LightGray = 13882323, LightGreen = 9498256, LightPink = 16758465, LightSalmon = 16752762, LightSeaGreen = 2142890, LightSkyBlue = 8900346, LightSlateGray = 7833753, LightSteelBlue = 11584734, LightYellow = 16777184, Lime = 65280, LimeGreen = 3329330, Linen = 16445670, Magenta = 16711935, Maroon = 8388608, MediumAquaMarine = 6737322, MediumBlue = 205, MediumOrchid = 12211667, MediumPurple = 9662683, MediumSeaGreen = 3978097, MediumSlateBlue = 8087790, MediumSpringGreen = 64154, MediumTurquoise = 4772300, MediumVioletRed = 13047173, MidnightBlue = 1644912, MintCream = 16121850, MistyRose = 16770273, Moccasin = 16770229, NavajoWhite = 16768685, Navy = 128, OldLace = 16643558, Olive = 8421376, OliveDrab = 7048739, Orange = 16753920, OrangeRed = 16729344, Orchid = 14315734, PaleGoldenRod = 15657130, PaleGreen = 10025880, PaleTurquoise = 11529966, PaleVioletRed = 14381203, PapayaWhip = 16773077, PeachPuff = 16767673, Peru = 13468991, Pink = 16761035, Plum = 14524637, PowderBlue = 11591910, Purple = 8388736, RebeccaPurple = 6697881, Red = 16711680, RosyBrown = 12357519, RoyalBlue = 4286945, SaddleBrown = 9127187, Salmon = 16416882, SandyBrown = 16032864, SeaGreen = 3050327, SeaShell = 16774638, Sienna = 10506797, Silver = 12632256, SkyBlue = 8900331, SlateBlue = 6970061, SlateGray = 7372944, Snow = 16775930, SpringGreen = 65407, SteelBlue = 4620980, Tan = 13808780, Teal = 32896, Thistle = 14204888, Tomato = 16737095, Turquoise = 4251856, Violet = 15631086, Wheat = 16113331, White = 16777215, WhiteSmoke = 16119285, Yellow = 16776960, YellowGreen = 10145074, Box2DRed = 14430514, Box2DBlue = 3190463, Box2DGreen = 9226532, Box2DYellow = 16772748, }
These colors are used for debug draw and mostly match the named SVG colors. See https://www.rapidtables.com/web/color/index.html https://johndecember.com/html/spec/colorsvg.html https://upload.wikimedia.org/wikipedia/commons/2/2b/SVG_Recognized_color_keyword_names.svg
Related Procedures With Parameters
Related Procedures With Returns
HullData ¶
HullData :: struct { // Version must be first and match B3_HULL_VERSION version: u64, // The total number of bytes for this hull. byteCount: i32, // Hash of this hull (this field is zero when the hash is computed). hash: u32, // Axis-aligned box in local space. aabb: AABB, // Surface area, typically in squared meters. surfaceArea: f32, // Volume, typically in m^3. volume: f32, // The radius of the largest sphere at the center. innerRadius: f32, // The local centroid center: [3]f32, // The inertia tensor about the centroid. centralInertia: matrix[3, 3]f32, // The vertex count. vertexCount: i32, // Offset of the vertex array in bytes from the struct address. vertexOffset: i32, // Offset of the point array in bytes from the struct address. pointOffset: i32, // This is the half-edge count (double the edge count) edgeCount: i32, // Offset of the edge array in bytes from the struct address. edgeOffset: i32, // The face count. Hulls faces are convex polygons. faceCount: i32, // Offset of the face array in bytes from the struct address. faceOffset: i32, // Offset of the face plane array in bytes from the struct address. planeOffset: i32, // Explicit padding. Hull identity is a content hash and memcmp over raw bytes, // so there must be no unnamed padding for struct copies to scramble. padding: i32, }
A convex hull. @note This data structure has data hanging off the end and cannot be directly copied.
Related Procedures With Parameters
- CloneAndTransformHull
- CloneHull
- CollideHullAndCapsule
- CollideHullAndSphere
- CollideHullAndTriangle
- CollideHulls
- ComputeHullAABB
- ComputeHullMass
- CreateHullShape
- CreateTransformedHullShape
- DestroyHull
- GetHullEdges
- GetHullFaces
- GetHullPlanes
- GetHullPoints
- GetHullVertices
- OverlapHull
- RayCastHull
- ShapeCastHull
- Shape_SetHull
Related Procedures With Returns
HullFace ¶
HullFace :: struct { // A half-edge that has this vertex as the origin // Can be used along with edge twins and winding order // to traverse all the edges connected to this vertex. edge: u8, }
A hull face. Hulls use a half-edge data structure, so a face can be determined from a single half-edge index.
HullHalfEdge ¶
HullHalfEdge :: struct { // Next edge index CCW next: u8, // Twin edge index twin: u8, // index of origin vertex and point origin: u8, // Face to the left of this edge face: u8, }
Half-edge for hull data structure
HullVertex ¶
HullVertex :: struct { // A half-edge that has this vertex as the origin // Can be used along with edge twins and winding order // to traverse all the edges connected to this vertex. edge: u8, }
A hull vertex. Identified by a half-edge with this vertex as its tail.
JointDef ¶
JointDef :: struct { // User data pointer userData: rawptr, // The first attached body bodyIdA: BodyId, // The second attached body bodyIdB: BodyId, // The first local joint frame localFrameA: Transform, // The second local joint frame localFrameB: Transform, // Force threshold for joint events forceThreshold: f32, // Torque threshold for joint events torqueThreshold: f32, // Constraint hertz (advanced feature) constraintHertz: f32, // Constraint damping ratio (advanced feature) constraintDampingRatio: f32, // Debug draw scale drawScale: f32, // Set this flag to true if the attached bodies should collide collideConnected: bool, // Used internally to detect a valid definition. DO NOT SET. internalValue: i32, }
Base joint definition used by all joint types. The local frames are measured from the body's origin rather than the center of mass because: 1. You might not know where the center of mass will be. 2. If you add/remove shapes from a body and recompute the mass, the joints will be broken. @ingroup joint
JointEvent ¶
JointEvent :: struct { // The joint id jointId: JointId, // The user data from the joint for convenience userData: rawptr, }
Joint events report joints that are awake and have a force and/or torque exceeding the threshold The observed forces and torques are not returned for efficiency reasons.
JointEvents ¶
JointEvents :: struct { // Array of events jointEvents: [^]JointEvent `fmt:"v,count"`, // Number of events count: i32, }
Joint events are buffered in the world and are available as event arrays after the time step is complete. Note: this data becomes invalid if joints are destroyed
Related Procedures With Returns
JointId ¶
/ Joint id references a joint instance. This should be treated as an opaque handle.
Related Procedures With Parameters
- Body_GetJoints
- DestroyJoint
- DistanceJoint_EnableLimit
- DistanceJoint_EnableMotor
- DistanceJoint_EnableSpring
- DistanceJoint_GetCurrentLength
- DistanceJoint_GetLength
- DistanceJoint_GetMaxLength
- DistanceJoint_GetMaxMotorForce
- DistanceJoint_GetMinLength
- DistanceJoint_GetMotorForce
- DistanceJoint_GetMotorSpeed
- DistanceJoint_GetSpringDampingRatio
- DistanceJoint_GetSpringForceRange
- DistanceJoint_GetSpringHertz
- DistanceJoint_IsLimitEnabled
- DistanceJoint_IsMotorEnabled
- DistanceJoint_IsSpringEnabled
- DistanceJoint_SetLength
- DistanceJoint_SetLengthRange
- DistanceJoint_SetMaxMotorForce
- DistanceJoint_SetMotorSpeed
- DistanceJoint_SetSpringDampingRatio
- DistanceJoint_SetSpringForceRange
- DistanceJoint_SetSpringHertz
- Joint_GetAngularSeparation
- Joint_GetBodyA
- Joint_GetBodyB
- Joint_GetCollideConnected
- Joint_GetConstraintForce
- Joint_GetConstraintTorque
- Joint_GetConstraintTuning
- Joint_GetForceThreshold
- Joint_GetLinearSeparation
- Joint_GetLocalFrameA
- Joint_GetLocalFrameB
- Joint_GetTorqueThreshold
- Joint_GetType
- Joint_GetUserData
- Joint_GetWorld
- Joint_IsValid
- Joint_SetCollideConnected
- Joint_SetConstraintTuning
- Joint_SetForceThreshold
- Joint_SetLocalFrameA
- Joint_SetLocalFrameB
- Joint_SetTorqueThreshold
- Joint_SetUserData
- Joint_WakeBodies
- MotorJoint_GetAngularDampingRatio
- MotorJoint_GetAngularHertz
- MotorJoint_GetAngularVelocity
- MotorJoint_GetLinearDampingRatio
- MotorJoint_GetLinearHertz
- MotorJoint_GetLinearVelocity
- MotorJoint_GetMaxSpringForce
- MotorJoint_GetMaxSpringTorque
- MotorJoint_GetMaxVelocityForce
- MotorJoint_GetMaxVelocityTorque
- MotorJoint_SetAngularDampingRatio
- MotorJoint_SetAngularHertz
- MotorJoint_SetAngularVelocity
- MotorJoint_SetLinearDampingRatio
- MotorJoint_SetLinearHertz
- MotorJoint_SetLinearVelocity
- MotorJoint_SetMaxSpringForce
- MotorJoint_SetMaxSpringTorque
- MotorJoint_SetMaxVelocityForce
- MotorJoint_SetMaxVelocityTorque
- ParallelJoint_GetMaxTorque
- ParallelJoint_GetSpringDampingRatio
- ParallelJoint_GetSpringHertz
- ParallelJoint_SetMaxTorque
- ParallelJoint_SetSpringDampingRatio
- ParallelJoint_SetSpringHertz
- PrismaticJoint_EnableLimit
- PrismaticJoint_EnableMotor
- PrismaticJoint_EnableSpring
- PrismaticJoint_GetLowerLimit
- PrismaticJoint_GetMaxMotorForce
- PrismaticJoint_GetMotorForce
- PrismaticJoint_GetMotorSpeed
- PrismaticJoint_GetSpeed
- PrismaticJoint_GetSpringDampingRatio
- PrismaticJoint_GetSpringHertz
- PrismaticJoint_GetTargetTranslation
- PrismaticJoint_GetTranslation
- PrismaticJoint_GetUpperLimit
- PrismaticJoint_IsLimitEnabled
- PrismaticJoint_IsMotorEnabled
- PrismaticJoint_IsSpringEnabled
- PrismaticJoint_SetLimits
- PrismaticJoint_SetMaxMotorForce
- PrismaticJoint_SetMotorSpeed
- PrismaticJoint_SetSpringDampingRatio
- PrismaticJoint_SetSpringHertz
- PrismaticJoint_SetTargetTranslation
- RevoluteJoint_EnableLimit
- RevoluteJoint_EnableMotor
- RevoluteJoint_EnableSpring
- RevoluteJoint_GetAngle
- RevoluteJoint_GetLowerLimit
- RevoluteJoint_GetMaxMotorTorque
- RevoluteJoint_GetMotorSpeed
- RevoluteJoint_GetMotorTorque
- RevoluteJoint_GetSpringDampingRatio
- RevoluteJoint_GetSpringHertz
- RevoluteJoint_GetTargetAngle
- RevoluteJoint_GetUpperLimit
- RevoluteJoint_IsLimitEnabled
- RevoluteJoint_IsMotorEnabled
- RevoluteJoint_IsSpringEnabled
- RevoluteJoint_SetLimits
- RevoluteJoint_SetMaxMotorTorque
- RevoluteJoint_SetMotorSpeed
- RevoluteJoint_SetSpringDampingRatio
- RevoluteJoint_SetSpringHertz
- RevoluteJoint_SetTargetAngle
- SphericalJoint_EnableConeLimit
- SphericalJoint_EnableMotor
- SphericalJoint_EnableSpring
- SphericalJoint_EnableTwistLimit
- SphericalJoint_GetConeAngle
- SphericalJoint_GetConeLimit
- SphericalJoint_GetLowerTwistLimit
- SphericalJoint_GetMaxMotorTorque
- SphericalJoint_GetMotorTorque
- SphericalJoint_GetMotorVelocity
- SphericalJoint_GetSpringDampingRatio
- SphericalJoint_GetSpringHertz
- SphericalJoint_GetTargetRotation
- SphericalJoint_GetTwistAngle
- SphericalJoint_GetUpperTwistLimit
- SphericalJoint_IsConeLimitEnabled
- SphericalJoint_IsMotorEnabled
- SphericalJoint_IsSpringEnabled
- SphericalJoint_IsTwistLimitEnabled
- SphericalJoint_SetConeLimit
- SphericalJoint_SetMaxMotorTorque
- SphericalJoint_SetMotorVelocity
- SphericalJoint_SetSpringDampingRatio
- SphericalJoint_SetSpringHertz
- SphericalJoint_SetTargetRotation
- SphericalJoint_SetTwistLimits
- StoreJointId
- WeldJoint_GetAngularDampingRatio
- WeldJoint_GetAngularHertz
- WeldJoint_GetLinearDampingRatio
- WeldJoint_GetLinearHertz
- WeldJoint_SetAngularDampingRatio
- WeldJoint_SetAngularHertz
- WeldJoint_SetLinearDampingRatio
- WeldJoint_SetLinearHertz
- WheelJoint_EnableSpinMotor
- WheelJoint_EnableSteering
- WheelJoint_EnableSteeringLimit
- WheelJoint_EnableSuspension
- WheelJoint_EnableSuspensionLimit
- WheelJoint_GetLowerSteeringLimit
- WheelJoint_GetLowerSuspensionLimit
- WheelJoint_GetMaxSpinTorque
- WheelJoint_GetMaxSteeringTorque
- WheelJoint_GetSpinMotorSpeed
- WheelJoint_GetSpinSpeed
- WheelJoint_GetSpinTorque
- WheelJoint_GetSteeringAngle
- WheelJoint_GetSteeringDampingRatio
- WheelJoint_GetSteeringHertz
- WheelJoint_GetSteeringTorque
- WheelJoint_GetSuspensionDampingRatio
- WheelJoint_GetSuspensionHertz
- WheelJoint_GetTargetSteeringAngle
- WheelJoint_GetUpperSteeringLimit
- WheelJoint_GetUpperSuspensionLimit
- WheelJoint_IsSpinMotorEnabled
- WheelJoint_IsSteeringEnabled
- WheelJoint_IsSteeringLimitEnabled
- WheelJoint_IsSuspensionEnabled
- WheelJoint_IsSuspensionLimitEnabled
- WheelJoint_SetMaxSpinTorque
- WheelJoint_SetMaxSteeringTorque
- WheelJoint_SetSpinMotorSpeed
- WheelJoint_SetSteeringDampingRatio
- WheelJoint_SetSteeringHertz
- WheelJoint_SetSteeringLimits
- WheelJoint_SetSuspensionDampingRatio
- WheelJoint_SetSuspensionHertz
- WheelJoint_SetSuspensionLimits
- WheelJoint_SetTargetSteeringAngle
Related Procedures With Returns
Related Constants
JointType ¶
JointType :: enum i32 { parallelJoint, distanceJoint, filterJoint, motorJoint, prismaticJoint, revoluteJoint, sphericalJoint, weldJoint, wheelJoint, }
Joint type enumeration. This is useful because all joint types use b3JointId and sometimes you want to get the type of a joint. @ingroup joint
Related Procedures With Returns
LocalManifold ¶
LocalManifold :: struct { // Local normal in frame A. normal: [3]f32, // The triangle normal. triangleNormal: [3]f32, // The manifold points. From a point buffer. points: LocalManifoldPoint, // The number of manifold points. Only bounded by the buffer capacity. pointCount: i32, // The index of the triangle. triangleIndex: i32, i1: i32, // < Vertex 1 index. i2: i32, // < Vertex 2 index. i3: i32, // The squared distance of a sphere from a triangle. For ghost collision reduction. squaredDistance: f32, // The triangle feature involved. feature: TriangleFeature, // MeshEdgeFlags. triangleFlags: MeshEdgeFlags, }
A local manifold with no dynamic information. Used by b3Collide functions.
LocalManifoldPoint ¶
LocalManifoldPoint :: struct { // Local point in frame A. point: [3]f32, // The contact point separation. Negative for overlap. separation: f32, // The feature pair for this point. pair: FeaturePair, // The triangle index when collide with a mesh or height-field. triangleIndex: i32, }
A local manifold point and normal in frame A.
LogFcn ¶
LogFcn :: proc "c" (message: rawptr)
Prototype for user log callback. Used to log warnings.
Related Procedures With Parameters
Manifold ¶
Manifold :: struct { // The manifold points. There may be 1 to 4 valid points. points: [4]ManifoldPoint, // The unit normal vector in world space, points from shape A to shape B normal: [3]f32, // Central friction angular impulse (applied about the normal) twistImpulse: f32, // Central friction linear impulse frictionImpulse: [3]f32, // Rolling resistance angular impulse rollingImpulse: [3]f32, // The number of contact points, will be 0 to 4 pointCount: i32, }
A contact manifold describes the contact points between colliding shapes. @note Box3D uses speculative collision so some contact points may be separated.
ManifoldPoint ¶
ManifoldPoint :: struct { // Location of the contact point relative to the bodyA center of mass in world space. anchorA: [3]f32, // Location of the contact point relative to the bodyB center of mass in world space. anchorB: [3]f32, // The separation of the contact point, negative if penetrating separation: f32, // Cached separation used for contact recycling baseSeparation: f32, // The impulse along the manifold normal vector. Since Box3D uses sub-stepping, this is // result from the final sub-step. normalImpulse: f32, // The total normal impulse applied during sub-stepping. This is important // to identify speculative contact points that had an interaction in the time step. totalNormalImpulse: f32, // Relative normal velocity pre-solve. Used for hit events. If the normal impulse is // zero then there was no hit. Negative means shapes are approaching. normalVelocity: f32, // Local point for matching // Uniquely identifies a contact point between two shapes featureId: u32, // Triangle index if one of the shapes is a mesh or height field triangleIndex: i32, // Did this contact point exist in the previous step? persisted: bool, }
A manifold point is a contact point belonging to a contact manifold. It holds details related to the geometry and dynamics of the contact points. Box3D uses speculative collision so some contact points may be separated. You may use the maxNormalImpulse to determine if there was an interaction during the time step.
MassData ¶
MassData :: struct { // The shape mass mass: f32, // The local center of mass position. center: [3]f32, // The inertia tensor about the shape center of mass. inertia: matrix[3, 3]f32, }
This holds the mass data computed for a shape.
Related Procedures With Parameters
Related Procedures With Returns
Matrix3 ¶
Matrix3 :: matrix[3, 3]f32
Related Procedures With Parameters
Related Procedures With Returns
Related Constants
Mesh ¶
Mesh :: struct { // Immutable pointer to the mesh data. data: ^MeshData, // This scale may be non-uniform and have negative components. However, // no component may be very small in magnitude. scale: [3]f32, }
This allows mesh data to be re-used with different scales.
Related Procedures With Parameters
Related Procedures With Returns
MeshData ¶
MeshData :: struct { // Version must be first. version: u64, // The total number of bytes for this mesh. byteCount: i32, // Hash of this mesh (this field is zero when the hash is computed) hash: u32, // Local axis-aligned box. bounds: AABB, // Combined surface area of all triangles. Single-sided. surfaceArea: f32, // The height of the bounding volume hierarchy. treeHeight: i32, // The number of degenerate triangles. Diagnostic. degenerateCount: i32, // Offset of the node array in bytes from the struct address. nodeOffset: i32, // The number of BVH nodes. nodeCount: i32, // Offset of the vertex array in bytes from the struct address. vertexOffset: i32, // The number of vertices. vertexCount: i32, // Offset of the triangle array in bytes from the struct address. triangleOffset: i32, // The number of triangles. triangleCount: i32, // Offset of the material array in bytes from the struct address. materialOffset: i32, // The number of materials. materialCount: i32, // Offset of the triangle flag array in bytes from the struct address. flagsOffset: i32, }
This is a sorted triangle collision bounding volume hierarchy. @note This struct has data hanging off the end and cannot be directly copied.
Related Procedures With Parameters
Related Procedures With Returns
MeshDef ¶
MeshDef :: struct { // Triangle vertices vertices: [^][3]f32 `fmt:"v,vertexCount"`, // Triangle vertex indices. 3 for each triangle. indices: [^]i32, // Triangle material index. 1 per triangle. Indexes into b3ShapeDef::materials. // This allows different run-time material data to be associated with different // instances of this mesh. materialIndices: [^]u8, // Tolerance for vertex welding in length units. weldTolerance: f32, // The vertex count. Must be 3 or more. vertexCount: i32, // The triangle count. Must be 1 or more. triangleCount: i32, // Optionally weld nearby vertices. weldVertices: bool, // Use the median split instead of SAH to speed up mesh creation. Good // for meshes that are structured like a grid. useMedianSplit: bool, // Compute triangle adjacency information using shared edges identifyEdges: bool, }
This is used to create a re-usable collision mesh
Related Procedures With Parameters
MeshEdgeFlag ¶
MeshEdgeFlag :: enum u32 { concaveEdge1 = 0, concaveEdge2 = 1, concaveEdge3 = 2, inverseConcaveEdge1 = 4, inverseConcaveEdge2 = 5, inverseConcaveEdge3 = 6, }
MeshNode ¶
MeshNode :: struct { // The lower bound of the node AABB. Strategic placement for SIMD. lowerBound: [3]f32, // Anonymous union. data: struct #raw_union { // Internal node asNode: bit_field u32 { axis: u32 | 2, childOffset: u32 | 30, }, // Leaf node asLeaf: bit_field u32 { type: u32 | 2, triangleCount: u32 | 30, }, }, // The upper bound of the node AABB. Strategic placement for SIMD. upperBound: [3]f32, // The index of the leaf triangles. triangleOffset: u32, }
A mesh BVH node.
MeshTriangle ¶
MeshTriangle :: struct { index1: i32, // < Index of vertex 1. index2: i32, // < Index of vertex 2. index3: i32, }
A mesh triangle.
MotionLocks ¶
MotionLocks :: struct { // Prevent translation along the x-axis linearX: bool, // Prevent translation along the y-axis linearY: bool, // Prevent translation along the z-axis linearZ: bool, // Prevent rotation around the x-axis angularX: bool, // Prevent rotation around the y-axis angularY: bool, // Prevent rotation around the z-axis angularZ: bool, }
Motion locks to restrict the body movement @ingroup body
Related Procedures With Parameters
Related Procedures With Returns
MotorJointDef ¶
MotorJointDef :: struct { // Base joint definition using base: JointDef, // The desired linear velocity linearVelocity: [3]f32, // The maximum motor force in newtons maxVelocityForce: f32, // The desired angular velocity angularVelocity: [3]f32, // The maximum motor torque in newton-meters maxVelocityTorque: f32, // Linear spring hertz for position control linearHertz: f32, // Linear spring damping ratio linearDampingRatio: f32, // Maximum spring force in newtons maxSpringForce: f32, // Angular spring hertz for position control angularHertz: f32, // Angular spring damping ratio angularDampingRatio: f32, // Maximum spring torque in newton-meters maxSpringTorque: f32, }
A motor joint is used to control the relative position and velocity between two bodies. @ingroup motor_joint
Related Procedures With Parameters
Related Procedures With Returns
MoverFilterFcn ¶
Used to filter shapes for shape casting character movers. Return true to accept the collision
Related Procedures With Parameters
OverlapResultFcn ¶
Prototype callback for overlap queries. Called for each shape found in the query. @see b3World_OverlapAABB @return false to terminate the query. @ingroup world
Related Procedures With Parameters
ParallelJointDef ¶
ParallelJointDef :: struct { // Base joint definition using base: JointDef, // The spring stiffness Hertz, cycles per second hertz: f32, // The spring damping ratio, non-dimensional dampingRatio: f32, // The maximum spring torque, typically in newton-meters. maxTorque: f32, }
Parallel joint definition. Constrains the angle between axis z in body A and axis z in body B using a spring. Useful to keep a body upright. @ingroup parallel_joint
Related Procedures With Parameters
Related Procedures With Returns
PlaneResult ¶
PlaneResult :: struct { // Outward pointing plane. plane: Plane, // Closest point on the shape. May not be unique. point: [3]f32, }
The plane between a character mover and a shape
PlaneResultFcn ¶
PlaneResultFcn :: proc "c" (shapeId: ShapeId, plane: [^]PlaneResult, planeCount: i32, ctx: rawptr) -> bool
Used to collect collision planes for character movers. Return true to continue gathering planes.
Related Procedures With Parameters
PlaneSolverResult ¶
PlaneSolverResult :: struct { // The final relative translation. delta: [3]f32, // The number of iterations used by the plane solver. For diagnostics. iterationCount: i32, }
Result returned by b3SolvePlanes.
Related Procedures With Returns
Pos ¶
Pos :: [3]f32
Related Procedures With Parameters
- Blend2
- Body_ApplyAngularImpulse
- Body_ApplyForce
- Body_ApplyForceToCenter
- Body_ApplyLinearImpulse
- Body_ApplyLinearImpulseToCenter
- Body_ApplyTorque
- Body_CastRay
- Body_CastShape
- Body_CollideMover
- Body_GetClosestPoint
- Body_GetLocalPoint
- Body_GetLocalPointVelocity
- Body_GetLocalVector
- Body_GetWorldPoint
- Body_GetWorldPointVelocity
- Body_GetWorldVector
- Body_OverlapShape
- Body_SetAngularVelocity
- Body_SetLinearVelocity
- Body_SetTransform
- ClipVector
- CloneAndTransformHull
- ClosestPointToAABB
- CollideHullAndTriangle
- ComputeMeshAABB
- ComputeQuatBetweenUnitVectors
- CreateBoxMesh
- CreateGrid
- CreateHollowBoxMesh
- CreateHull
- CreateMeshShape
- CreatePlatformMesh
- CreateTransformedHullShape
- CreateWave
- Distance
- DistanceSquared
- DynamicTree_QueryClosest
- GetLengthAndNormalize
- InvRotateVector
- InvTransformPoint
- InvTransformWorldPoint
- IsNormalized
- IsValidPosition
- IsValidVec3
- LineDistance
- MakeOffsetBoxHull
- MakeQuatFromAxisAngle
- MakeScaledBoxHull
- MotorJoint_SetAngularVelocity
- MotorJoint_SetLinearVelocity
- Normalize
- OffsetAABB
- OffsetPos
- Perp
- PointToSegmentDistance
- RotateVector
- SafeScale
- ScaleBox
- SegmentDistance
- Shape_ApplyWind
- Shape_GetClosestPoint
- Shape_RayCast
- Shape_SetMesh
- Solve3
- SolvePlanes
- SphericalJoint_SetMotorVelocity
- Steiner
- ToPos
- ToRelativeTransform
- ToVec3
- TransformPoint
- TransformWorldPoint
- World_CastMover
- World_CastRay
- World_CastRayClosest
- World_CastShape
- World_CollideMover
- World_OverlapShape
- World_SetGravity
Related Procedures With Returns
- AABB_Center
- AABB_Extents
- Body_GetAngularVelocity
- Body_GetLinearVelocity
- Body_GetLocalCenterOfMass
- Body_GetPosition
- Body_GetWorldCenterOfMass
- GetAxisAngle
- Joint_GetConstraintForce
- Joint_GetConstraintTorque
- MotorJoint_GetAngularVelocity
- MotorJoint_GetLinearVelocity
- SphericalJoint_GetMotorTorque
- SphericalJoint_GetMotorVelocity
- World_GetGravity
Related Constants
PreSolveFcn ¶
PreSolveFcn :: proc "c" (shapeIdA: ShapeId, shapeIdB: ShapeId, point: [3]f32, normal: [3]f32, ctx: rawptr) -> bool
Prototype for a pre-solve callback. This is called after a contact is updated. This allows you to inspect a collision before it goes to the solver. Notes: this function must be thread-safe this is only called if the shape has enabled pre-solve events this may be called for awake dynamic bodies and sensors this is not called for sensors Return false if you want to disable the contact this step This has limited information because it is used during CCD which does not have the full contact manifold. @warning Do not attempt to modify the world inside this callback @ingroup world
Related Procedures With Parameters
PrismaticJointDef ¶
PrismaticJointDef :: struct { // Base joint definition using base: JointDef, // Enable a linear spring along the prismatic joint axis enableSpring: bool, // The spring stiffness Hertz, cycles per second hertz: f32, // The spring damping ratio, non-dimensional dampingRatio: f32, // The target translation for the joint in meters. The spring-damper will drive // to this translation. targetTranslation: f32, // Enable/disable the joint limit enableLimit: bool, // The lower translation limit lowerTranslation: f32, // The upper translation limit upperTranslation: f32, // Enable/disable the joint motor enableMotor: bool, // The maximum motor force, typically in newtons maxMotorForce: f32, // The desired motor speed, typically in meters per second motorSpeed: f32, }
Prismatic joint definition. Body B may slide along the x-axis in local frame A. Body B cannot rotate relative to body A. The joint translation is zero when the local frame origins coincide in world space. @ingroup prismatic_joint
Related Procedures With Parameters
Related Procedures With Returns
Profile ¶
Profile :: struct { step: f32, pairs: f32, collide: f32, solve: f32, solverSetup: f32, constraints: f32, prepareConstraints: f32, integrateVelocities: f32, warmStart: f32, solveImpulses: f32, integratePositions: f32, relaxImpulses: f32, applyRestitution: f32, storeImpulses: f32, splitIslands: f32, transforms: f32, sensorHits: f32, jointEvents: f32, hitEvents: f32, refit: f32, bullets: f32, sleepIslands: f32, sensors: f32, }
! @cond Profiling data. Times are in milliseconds. @ingroup world
Related Procedures With Returns
QueryFilter ¶
QueryFilter :: struct { // The collision category bits of this query. Normally you would just set one bit. categoryBits: u64, // The collision mask bits. This states the shape categories that this // query would accept for collision. maskBits: u64, // Optional id combined with @ref name to identify this query in a recording, e.g. an entity id. // Need not be unique on its own. 0 with a null name means untagged. Ignored when not recording. id: u64, // Optional label combined with @ref id to identify this query, e.g. "bullet". Need not be unique // on its own. The recorder hashes (id, name) into one stable key the viewer tracks the query by, // so the same id and name pair identifies the same query across frames. NULL means none. Ignored // when not recording. name: cstring, }
The query filter is used to filter collisions between queries and shapes. For example, you may want a ray-cast representing a projectile to hit players and the static environment but not debris.
Related Procedures With Parameters
Related Procedures With Returns
RayCastInput ¶
RayCastInput :: struct { // Start point of the ray cast. origin: [3]f32, // Translation of the ray cast. // end = start + translation. translation: [3]f32, // The maximum fraction of the translation to consider, typically 1 maxFraction: f32, }
Low level ray cast input data.
Related Procedures With Parameters
RayResult ¶
RayResult :: struct { // The shape hit. shapeId: ShapeId, // The world point of the hit. point: [3]f32, // The world normal of the shape surface at the hit point. normal: [3]f32, // The user material id at the hit point. This can be per triangle // if the shape is a mesh, height-field, or compound with child mesh. userMaterialId: u64, // The fraction of the input ray. fraction: f32, // The triangle index if the shape is a mesh, height-field, or compound with // child mesh. triangleIndex: i32, // The child index if the shape is a compound. childIndex: i32, // The number of BVH nodes visited. Diagnostic. nodeVisits: i32, // The number of BVH leaves visited. Diagnostic. leafVisits: i32, // Did the ray hit? If false, all other data is invalid. hit: bool, }
Result from b3World_RayCastClosest.
Related Procedures With Returns
RecPlayer ¶
RecPlayer :: struct {}
Opaque incremental replay player with a keyframe ring for O(interval) backward seek.
Related Procedures With Parameters
- RecPlayer_Destroy
- RecPlayer_DrawFrameQueries
- RecPlayer_GetBodyCount
- RecPlayer_GetBodyId
- RecPlayer_GetDivergeFrame
- RecPlayer_GetFrame
- RecPlayer_GetFrameCount
- RecPlayer_GetFrameQuery
- RecPlayer_GetFrameQueryCount
- RecPlayer_GetFrameQueryHit
- RecPlayer_GetInfo
- RecPlayer_GetKeyframeBudget
- RecPlayer_GetKeyframeBytes
- RecPlayer_GetKeyframeInterval
- RecPlayer_GetKeyframeMinInterval
- RecPlayer_GetWorldId
- RecPlayer_HasDiverged
- RecPlayer_IsAtEnd
- RecPlayer_Restart
- RecPlayer_SeekFrame
- RecPlayer_SetDebugShapeCallbacks
- RecPlayer_SetKeyframePolicy
- RecPlayer_SetWorkerCount
- RecPlayer_StepFrame
Related Procedures With Returns
RecPlayerInfo ¶
RecPlayerInfo :: struct { frameCount: i32, // total recorded steps workerCount: i32, // worker count requested for the replay world timeStep: f32, // dt of the recorded steps subStepCount: i32, // recorded sub-steps lengthScale: f32, // length units per meter in effect when recorded bounds: AABB, }
Summary of a recording, read once at open so a viewer can frame and label it.
Related Procedures With Returns
RecQueryInfo ¶
RecQueryInfo :: struct { type: RecQueryType, filter: QueryFilter, aabb: AABB, // world-space bounds of the query, swept for casts origin: [3]f32, // query origin (zero for overlap AABB) translation: [3]f32, // ray and cast translation hitCount: i32, // number of recorded results key: u64, // identity key, the hash of (id, name), 0 if untagged id: u64, // query id, 0 if none name: cstring, }
A spatial query recorded during a replayed frame, exposed for inspection.
Related Procedures With Returns
RecQueryType ¶
RecQueryType :: enum i32 { OverlapAABB, OverlapShape, CastRay, CastShape, CastRayClosest, CastMover, CollideMover, }
The kind of a recorded spatial query, matching the public query and cast functions.
Recording ¶
Recording :: struct {}
Opaque recording handle. Create with CreateRecording, destroy with DestroyRecording.
Related Procedures With Parameters
Related Procedures With Returns
RestitutionCallback ¶
RestitutionCallback :: proc "c" (restitutionA: f32, userMaterialIdA: u64, restitutionB: f32, userMaterialIdB: u64) -> f32
Optional restitution mixing callback. This intentionally provides no context objects because this is called from a worker thread. @warning This function should not attempt to modify Box3D state or user application state. @ingroup world
Related Procedures With Parameters
RevoluteJointDef ¶
RevoluteJointDef :: struct { // Base joint definition. using base: JointDef, // The bodyB angle minus bodyA angle in the reference state (radians). // This defines the zero angle for the joint limit. targetAngle: f32, // Enable a rotational spring on the revolute hinge axis. enableSpring: bool, // The spring stiffness Hertz, cycles per second. hertz: f32, // The spring damping ratio, non-dimensional. dampingRatio: f32, // A flag to enable joint limits. enableLimit: bool, // The lower angle for the joint limit in radians. Minimum of -0.99*pi radians. lowerAngle: f32, // The upper angle for the joint limit in radians. Maximum of 0.99*pi radians. upperAngle: f32, // A flag to enable the joint motor. enableMotor: bool, // The maximum motor torque, typically in newton-meters. maxMotorTorque: f32, // The desired motor speed in radians per second. motorSpeed: f32, }
Revolute joint definition. A point on body B is fixed to a point on body A. Allows relative rotation about the z-axis. @ingroup revolute_joint
Related Procedures With Parameters
Related Procedures With Returns
SATCache ¶
SATCache :: struct { // The separation when the cache is populated. Negative for overlap. separation: f32, // b3SeparatingFeature. type: u8, // Index of the feature on shape A. indexA: u8, // Index of the feature on shape B. indexB: u8, // Was the cache re-used? hit: u8, }
Separating axis test cache. Provides temporal acceleration of collision routines.
Related Procedures With Parameters
SegmentDistanceResult ¶
The closest points between to segments or infinite lines.
Related Procedures With Returns
SensorBeginTouchEvent ¶
SensorBeginTouchEvent :: struct { // The id of the sensor shape sensorShapeId: ShapeId, // The id of the shape that began touching the sensor shape visitorShapeId: ShapeId, }
A begin-touch event is generated when a shape starts to overlap a sensor shape.
SensorEndTouchEvent ¶
SensorEndTouchEvent :: struct { // The id of the sensor shape sensorShapeId: ShapeId, // The id of the shape that began touching the sensor shape visitorShapeId: ShapeId, }
An end touch event is generated when a shape stops overlapping a sensor shape.
These include things like setting the transform, destroying a body or shape, or changing a filter. You will also get an end event if the sensor or visitor are destroyed. Therefore you should always confirm the shape id is valid using b3Shape_IsValid.
SensorEvents ¶
SensorEvents :: struct { // Array of sensor begin touch events beginEvents: [^]SensorBeginTouchEvent `fmt:"v,beginCount"`, // Array of sensor end touch events endEvents: [^]SensorEndTouchEvent `fmt:"v,endCount"`, // The number of begin touch events beginCount: i32, // The number of end touch events endCount: i32, }
Sensor events are buffered in the world and are available
as begin/end overlap event arrays after the time step is complete. Note: these may become invalid if bodies and/or shapes are destroyed
Related Procedures With Returns
SeparatingFeature ¶
SeparatingFeature :: enum i32 { invalidAxis = 0, backsideAxis, faceAxisA, faceAxisB, edgePairAxis, closestPointsAxis, // These are for testing manualFaceAxisA, manualFaceAxisB, manualEdgePairAxis, }
Cached separating axis feature.
ShapeCastInput ¶
ShapeCastInput :: struct { // A generic query shape. proxy: ShapeProxy, // The translation of the shape cast. translation: [3]f32, // The maximum fraction of the translation to consider, typically 1. maxFraction: f32, // Allow shape cast to encroach when initially touching. This only works if the radius is greater than zero. canEncroach: bool, }
Low level shape cast input in generic form. This allows casting an arbitrary point cloud wrap with a radius. For example, a sphere is a single point with a non-zero radius. A capsule is two points with a non-zero radius. A box is four points with a zero radius.
Related Procedures With Parameters
ShapeCastPairInput ¶
ShapeCastPairInput :: struct { proxyA: ShapeProxy, // < The proxy for shape A proxyB: ShapeProxy, // < The proxy for shape B transform: Transform, // < Transform of shape B in shape A's frame, the relative pose B in A translationB: [3]f32, // < The translation of shape B, in A's frame maxFraction: f32, // < The fraction of the translation to consider, typically 1 canEncroach: bool, }
Input parameters for b3ShapeCast
Related Procedures With Parameters
ShapeDef ¶
ShapeDef :: struct { // Use this to store application specific shape data. userData: rawptr, // Surface material used on mesh shapes per triangle. Ignored for convex shapes. Ignored for compound shapes. materials: [^]SurfaceMaterial `fmt:"v,materialCount"`, // Surface material count. materialCount: i32, // The base surface material. Ignored for compound shapes. baseMaterial: SurfaceMaterial, // The density, usually in kg/m^3. density: f32, // Explosion scale for b3World_Explode. non-dimensional explosionScale: f32, // Contact filtering data. filter: Filter, // Enable custom filtering. Only one of the two shapes needs to enable custom filtering. See b3WorldDef. enableCustomFiltering: bool, // A sensor shape generates overlap events but never generates a collision response. // Sensors do not have continuous collision. Instead, use a ray or shape cast for those scenarios. // Sensors still contribute to the body mass if they have non-zero density. // @note Sensor events are disabled by default. // @see enableSensorEvents isSensor: bool, // Enable sensor events for this shape. This applies to sensors and non-sensors. False by default, even for sensors. enableSensorEvents: bool, // Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default. enableContactEvents: bool, // Enable hit events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. False by default. enableHitEvents: bool, // Enable pre-solve contact events for this shape. Only applies to dynamic bodies. These are expensive // and must be carefully handled due to multithreading. Ignored for sensors. enablePreSolveEvents: bool, // When shapes are created they will scan the environment for collision the next time step. This can significantly slow down // static body creation when there are many static shapes. // This is flag is ignored for dynamic and kinematic shapes which always invoke contact creation. invokeContactCreation: bool, // Should the body update the mass properties when this shape is created. Default is true. updateBodyMass: bool, // Used internally to detect a valid definition. DO NOT SET. internalValue: i32, }
Used to create a shape @ingroup shape
Related Procedures With Parameters
Related Procedures With Returns
ShapeId ¶
/ Shape id references a shape instance. This should be treated as an opaque handle.
Related Procedures With Parameters
- Body_GetShapes
- DestroyShape
- Shape_ApplyWind
- Shape_AreContactEventsEnabled
- Shape_AreHitEventsEnabled
- Shape_ArePreSolveEventsEnabled
- Shape_AreSensorEventsEnabled
- Shape_ComputeMassData
- Shape_EnableContactEvents
- Shape_EnableHitEvents
- Shape_EnablePreSolveEvents
- Shape_EnableSensorEvents
- Shape_GetAABB
- Shape_GetBody
- Shape_GetCapsule
- Shape_GetClosestPoint
- Shape_GetContactCapacity
- Shape_GetContactData
- Shape_GetDensity
- Shape_GetFilter
- Shape_GetFriction
- Shape_GetHeightField
- Shape_GetHull
- Shape_GetMesh
- Shape_GetMeshMaterialCount
- Shape_GetMeshSurfaceMaterial
- Shape_GetRestitution
- Shape_GetSensorCapacity
- Shape_GetSensorData
- Shape_GetSphere
- Shape_GetSurfaceMaterial
- Shape_GetType
- Shape_GetUserData
- Shape_GetWorld
- Shape_IsSensor
- Shape_IsValid
- Shape_RayCast
- Shape_SetCapsule
- Shape_SetDensity
- Shape_SetFilter
- Shape_SetFriction
- Shape_SetHull
- Shape_SetMesh
- Shape_SetMeshMaterial
- Shape_SetRestitution
- Shape_SetSphere
- Shape_SetSurfaceMaterial
- Shape_SetUserData
- StoreShapeId
Related Procedures With Returns
Related Constants
ShapeProxy ¶
ShapeProxy :: struct { // The point cloud. points: [^][3]f32 `fmt:"v,count"`, // The number of points. Do not exceed B3_MAX_SHAPE_CAST_POINTS. count: i32, // The external radius of the point cloud. radius: f32, }
A shape proxy is used by the GJK algorithm. It can represent a convex shape.
Related Procedures With Parameters
ShapeType ¶
ShapeType :: enum i32 { // A capsule is an extruded sphere capsuleShape, // A compound shape composed of up to 64K spheres, capsules, hulls, and meshes compoundShape, // A height field useful for terrain heightShape, // A convex hull hullShape, // A triangle soup meshShape, // A sphere with an offset sphereShape, }
Shape type @ingroup shape
Related Procedures With Returns
Simplex ¶
Simplex :: struct { vertices: [4]SimplexVertex `fmt:"v,count"`, // < vertices count: i32, }
Simplex from the GJK algorithm
Related Procedures With Parameters
SimplexCache ¶
SimplexCache :: struct { // Value use to compare length, area, volume of two simplexes. metric: f32, // todo use an index of 0xFF as a sentinel and remove the count // The number of stored simplex points count: u16, // The cached simplex indices on shape A indexA: [4]u8, // The cached simplex indices on shape B indexB: [4]u8, }
Used to warm start the GJK simplex. If you call this function multiple times with nearby transforms this might improve performance. Otherwise you can zero initialize this. The distance cache must be initialized to zero on the first call. Users should generally just zero initialize this structure for each call.
Related Procedures With Parameters
Related Constants
SimplexVertex ¶
SimplexVertex :: struct { wA: [3]f32, // < support point in proxyA wB: [3]f32, // < support point in proxyB w: [3]f32, // < wB - wA a: f32, // < barycentric coordinates indexA: i32, // < wA index indexB: i32, }
Simplex vertex for debugging the GJK algorithm
SphericalJointDef ¶
SphericalJointDef :: struct { // Base joint definition using base: JointDef, // Enable a rotational spring that attempts to align the two joint frames. enableSpring: bool, // The spring stiffness Hertz, cycles per second. This may be clamped internally // according to the time step to maintain stability. Non-negative number. hertz: f32, // The spring damping ratio, non-dimensional. Non-negative number. dampingRatio: f32, // Target spring rotation, joint frame B relative to joint frame A. targetRotation: quaternion128, // A flag to enable the cone limit. The cone is centered on the frameA z-axis. enableConeLimit: bool, // The angle for the cone limit in radians. Valid range is [0, pi] coneAngle: f32, // A flag to enable the twist limit. The twist is centered on the frameB z-axis. enableTwistLimit: bool, // The angle for the lower twist limit in radians. Minimum of -0.99*pi radians. lowerTwistAngle: f32, // The angle for the upper twist limit in radians. Maximum of 0.99*pi radians. upperTwistAngle: f32, // A flag to enable the joint motor enableMotor: bool, // The maximum motor torque, typically in newton-meters. Non-negative number. maxMotorTorque: f32, // The desired motor angular velocity in radians per second. motorVelocity: [3]f32, }
Spherical joint definition. A point on body B is fixed to a point on body A. Allows rotation about the shared point. @ingroup spherical_joint
Related Procedures With Parameters
Related Procedures With Returns
SurfaceMaterial ¶
SurfaceMaterial :: struct { // The Coulomb (dry) friction coefficient, usually in the range [0,1]. friction: f32, // The coefficient of restitution (bounce) usually in the range [0,1]. // https://en.wikipedia.org/wiki/Coefficient_of_restitution restitution: f32, // The rolling resistance usually in the range [0,1]. This is only used for spheres and capsules. rollingResistance: f32, // The tangent velocity for conveyor belts. This is local to the shape and will be projected // onto the contact surface. tangentVelocity: [3]f32, // User material identifier. This is passed with query results and to friction and restitution // combining functions. It is not used internally. userMaterialId: u64, // Custom debug draw color. Ignored if 0. The low 24 bits are RGB. The high byte may // carry a b3DebugMaterial preset, see b3MakeDebugColor. // @see b3HexColor customColor: u32, }
Material properties supported per triangle on meshes and height fields @ingroup shape
Related Procedures With Parameters
Related Procedures With Returns
Sweep ¶
Sweep :: struct { localCenter: [3]f32, // < Local center of mass position c1: [3]f32, // < Starting center of mass world position c2: [3]f32, // < Ending center of mass world position q1: quaternion128, // < Starting world rotation q2: quaternion128, }
This describes the motion of a body/shape for TOI computation. Shapes are defined with respect to the body origin, which may not coincide with the center of mass. However, to support dynamics we must interpolate the center of mass position.
Related Procedures With Parameters
TOIInput ¶
TOIInput :: struct { proxyA: ShapeProxy, // < The proxy for shape A proxyB: ShapeProxy, // < The proxy for shape B sweepA: Sweep, // < The movement of shape A sweepB: Sweep, // < The movement of shape B maxFraction: f32, }
Time of impact input
Related Procedures With Parameters
TOIOutput ¶
TOIOutput :: struct { // The type of result state: TOIState, // The hit point point: [3]f32, // The hit normal normal: [3]f32, // The sweep time of the collision fraction: f32, // The final distance distance: f32, // Number of outer iterations distanceIterations: i32, // Total number of push back iterations pushBackIterations: i32, // Total number of root iterations rootIterations: i32, // Indicates that the time of impact detected initial // overlap and used a fallback sphere as a last ditch effort // to prevent tunneling. usedFallback: bool, }
Time of impact output
Related Procedures With Returns
TOIState ¶
TOIState :: enum i32 { Unknown, Failed, Overlapped, Hit, Separated, }
Describes the TOI output
TaskCallback ¶
TaskCallback :: proc "c" (taskContext: rawptr)
Task interface This is the prototype for a Box3D task. Your task system is expected to run this callback on a worker thread, exactly once per enqueue, passing back the same taskContext pointer supplied to EnqueueTaskCallback. @ingroup world
Transform ¶
Transform :: struct { p: [3]f32, q: quaternion128, }
Related Procedures With Parameters
- AABB_Transform
- CloneAndTransformHull
- CollideCapsuleAndSphere
- CollideCapsules
- CollideHullAndCapsule
- CollideHullAndSphere
- CollideHulls
- CollideSpheres
- ComputeCapsuleAABB
- ComputeCompoundAABB
- ComputeHeightFieldAABB
- ComputeHullAABB
- ComputeMeshAABB
- ComputeSphereAABB
- CreateTransformedHullShape
- InvMulTransforms
- InvTransformPoint
- InvertTransform
- IsValidTransform
- Joint_SetLocalFrameA
- Joint_SetLocalFrameB
- MakeScaledBoxHull
- MakeTransformedBoxHull
- MakeWorldTransform
- MulTransforms
- MulWorldTransforms
- OverlapCapsule
- OverlapCompound
- OverlapHeightField
- OverlapHull
- OverlapMesh
- OverlapSphere
- ScaleBox
- TransformPoint
Related Procedures With Returns
Related Constants
TreeBoxCastCallbackFcn ¶
TreeBoxCastCallbackFcn :: proc "c" (#by_ptr input: BoxCastInput, proxyId: i32, userData: u64, ctx: rawptr) -> f32
This function receives clipped AABB cast input for a proxy. The function returns the new cast fraction. return a value of 0 to terminate the cast return a value less than input->maxFraction to clip the cast return a value of input->maxFraction to continue the cast without clipping
Related Procedures With Parameters
TreeNode ¶
TreeNode :: struct { // The node bounding box aabb: AABB, // Category bits for collision filtering categoryBits: u64, // 8 using _: struct #raw_union { // Children (internal node) children: TreeNodeChildren, // User data (leaf node) userData: u64, }, // 8 using _: struct #raw_union { // The node parent index (allocated node) parent: i32, // The node freelist next index (free node) next: i32, }, // Height of the node. Leaves have a height of 0. height: u16, // @see TreeNodeFlags flags: TreeNodeFlags, }
A node in the dynamic tree. This is private data placed here for performance reasons. todo test padding to 64 bytes to avoid straddling cache lines
TreeNodeChildren ¶
Tree node child indices. For internal usage.
TreeNodeFlag ¶
TreeNodeFlag :: enum u16 { allocatedNode = 0, enlargedNode = 1, leafNode = 2, }
TreeNodeFlags ¶
TreeNodeFlags :: distinct bit_set[TreeNodeFlag; u16]
Flags for tree nodes. For internal usage.
TreeQueryCallbackFcn ¶
This function receives proxies found in the AABB query. @return true if the query should continue
Related Procedures With Parameters
TreeQueryClosestCallbackFcn ¶
TreeQueryClosestCallbackFcn :: proc "c" (distanceSqrMin: f32, proxyId: i32, userData: u64, ctx: rawptr) -> f32
This function receives the minimum distance squared so far and proxy to check in the closest query. @return minimum distance squared to user objects in the proxy
Related Procedures With Parameters
TreeRayCastCallbackFcn ¶
TreeRayCastCallbackFcn :: proc "c" (#by_ptr input: RayCastInput, proxyId: i32, userData: u64, ctx: rawptr) -> f32
This function receives clipped ray cast input for a proxy. The function returns the new ray fraction. return a value of 0 to terminate the ray cast return a value less than input->maxFraction to clip the ray return a value of input->maxFraction to continue the ray cast without clipping
Related Procedures With Parameters
TreeStats ¶
TreeStats :: struct { // Number of internal nodes visited during the query nodeVisits: i32, // Number of leaf nodes visited during the query leafVisits: i32, }
These are performance results returned by dynamic tree queries.
Related Procedures With Returns
TriangleFeature ¶
TriangleFeature :: enum i32 { featureNone = 0, featureTriangleFace, featureHullFace, // v1-v2 featureEdge1, // v2-v3 featureEdge2, // v3-v1 featureEdge3, featureVertex1, featureVertex2, featureVertex3, }
Cached triangle feature.
Vec3 ¶
Vec3 :: [3]f32
Related Procedures With Parameters
- Blend2
- Body_ApplyAngularImpulse
- Body_ApplyForce
- Body_ApplyForceToCenter
- Body_ApplyLinearImpulse
- Body_ApplyLinearImpulseToCenter
- Body_ApplyTorque
- Body_CastRay
- Body_CastShape
- Body_CollideMover
- Body_GetClosestPoint
- Body_GetLocalPoint
- Body_GetLocalPointVelocity
- Body_GetLocalVector
- Body_GetWorldPoint
- Body_GetWorldPointVelocity
- Body_GetWorldVector
- Body_OverlapShape
- Body_SetAngularVelocity
- Body_SetLinearVelocity
- Body_SetTransform
- ClipVector
- CloneAndTransformHull
- ClosestPointToAABB
- CollideHullAndTriangle
- ComputeMeshAABB
- ComputeQuatBetweenUnitVectors
- CreateBoxMesh
- CreateGrid
- CreateHollowBoxMesh
- CreateHull
- CreateMeshShape
- CreatePlatformMesh
- CreateTransformedHullShape
- CreateWave
- Distance
- DistanceSquared
- DynamicTree_QueryClosest
- GetLengthAndNormalize
- InvRotateVector
- InvTransformPoint
- InvTransformWorldPoint
- IsNormalized
- IsValidPosition
- IsValidVec3
- LineDistance
- MakeOffsetBoxHull
- MakeQuatFromAxisAngle
- MakeScaledBoxHull
- MotorJoint_SetAngularVelocity
- MotorJoint_SetLinearVelocity
- Normalize
- OffsetAABB
- OffsetPos
- Perp
- PointToSegmentDistance
- RotateVector
- SafeScale
- ScaleBox
- SegmentDistance
- Shape_ApplyWind
- Shape_GetClosestPoint
- Shape_RayCast
- Shape_SetMesh
- Solve3
- SolvePlanes
- SphericalJoint_SetMotorVelocity
- Steiner
- ToPos
- ToRelativeTransform
- ToVec3
- TransformPoint
- TransformWorldPoint
- World_CastMover
- World_CastRay
- World_CastRayClosest
- World_CastShape
- World_CollideMover
- World_OverlapShape
- World_SetGravity
Related Procedures With Returns
- AABB_Center
- AABB_Extents
- Body_GetAngularVelocity
- Body_GetLinearVelocity
- Body_GetLocalCenterOfMass
- Body_GetPosition
- Body_GetWorldCenterOfMass
- GetAxisAngle
- Joint_GetConstraintForce
- Joint_GetConstraintTorque
- MotorJoint_GetAngularVelocity
- MotorJoint_GetLinearVelocity
- SphericalJoint_GetMotorTorque
- SphericalJoint_GetMotorVelocity
- World_GetGravity
Related Constants
Version ¶
Version :: struct { major: i32, // Significant changes minor: i32, // Incremental changes revision: i32, }
Version numbering scheme. See https://semver.org/
Related Procedures With Returns
WeldJointDef ¶
WeldJointDef :: struct { // Base joint definition using base: JointDef, // Linear stiffness expressed as Hertz (cycles per second). Use zero for maximum stiffness. linearHertz: f32, // Angular stiffness as Hertz (cycles per second). Use zero for maximum stiffness. angularHertz: f32, // Linear damping ratio, non-dimensional. Use 1 for critical damping. linearDampingRatio: f32, // Linear damping ratio, non-dimensional. Use 1 for critical damping. angularDampingRatio: f32, }
Weld joint definition Connects two bodies together rigidly. This constraint provides springs to mimic soft-body simulation. @note The approximate solver in Box3D cannot hold many bodies together rigidly @ingroup weld_joint
Related Procedures With Parameters
Related Procedures With Returns
WheelJointDef ¶
WheelJointDef :: struct { // Base joint definition using base: JointDef, // Enable a linear spring along the local axis enableSuspensionSpring: bool, // Spring stiffness in Hertz suspensionHertz: f32, // Spring damping ratio, non-dimensional suspensionDampingRatio: f32, // Enable/disable the joint linear limit enableSuspensionLimit: bool, // The lower suspension translation limit lowerSuspensionLimit: f32, // The upper translation limit upperSuspensionLimit: f32, // Enable/disable the joint rotational motor enableSpinMotor: bool, // The maximum motor torque, typically in newton-meters maxSpinTorque: f32, // The desired motor speed in radians per second spinSpeed: f32, // Enable steering, otherwise the steering is fixed forward enableSteering: bool, // Steering stiffness in Hertz steeringHertz: f32, // Spring damping ratio, non-dimensional steeringDampingRatio: f32, // The target steering angle in radians targetSteeringAngle: f32, // The maximum steering torque in N*m maxSteeringTorque: f32, // Enable/disable the steering angular limit enableSteeringLimit: bool, // The lower steering angle in radians lowerSteeringLimit: f32, // The upper steering angle in radians upperSteeringLimit: f32, }
Wheel joint definition Body A is the chassis and body B is the wheel. The wheel rotates around the local z-axis in frame B. The wheel translates along the local x-axis in frame A. The wheel can optionally steer along the x-axis in frame A. @ingroup wheel_joint
Related Procedures With Parameters
Related Procedures With Returns
WorldCastOutput ¶
WorldCastOutput :: struct { // The surface normal at the hit point. normal: [3]f32, // The surface hit point in world space. point: [3]f32, // The fraction of the input translation at collision. fraction: f32, // The number of iterations used. iterations: i32, // The index of the mesh or height field triangle hit. triangleIndex: i32, // The index of the compound child shape. childIndex: i32, // The material index. May be -1 for null. materialIndex: i32, // Did the cast hit? hit: bool, }
Ray cast or shape-cast output in world space. The hit point is a world position so the result stays precise far from the world origin. Mirrors b3CastOutput with a double precision point.
Related Procedures With Returns
WorldDef ¶
WorldDef :: struct { // Gravity vector. Box3D has no up-vector defined. gravity: [3]f32, // Restitution speed threshold, usually in m/s. Collisions above this // speed have restitution applied (will bounce). restitutionThreshold: f32, // Hit event speed threshold, usually in m/s. Collisions above this // speed can generate hit events if the shape also enables hit events. hitEventThreshold: f32, // Contact stiffness. Cycles per second. Increasing this increases the speed of overlap recovery, but can introduce jitter. contactHertz: f32, // Contact bounciness. Non-dimensional. You can speed up overlap recovery by decreasing this with // the trade-off that overlap resolution becomes more energetic. contactDampingRatio: f32, // This parameter controls how fast overlap is resolved and usually has units of meters per second. This only // puts a cap on the resolution speed. The resolution speed is increased by increasing the hertz and/or // decreasing the damping ratio. contactSpeed: f32, // Maximum linear speed. Usually meters per second. maximumLinearSpeed: f32, // Optional mixing callback for friction. The default uses sqrt(frictionA * frictionB). frictionCallback: FrictionCallback, // Optional mixing callback for restitution. The default uses max(restitutionA, restitutionB). restitutionCallback: RestitutionCallback, // Can bodies go to sleep to improve performance enableSleep: bool, // Enable continuous collision enableContinuous: bool, // Number of workers to use with the provided task system. Box3D performs best when using only // performance cores and accessing a single L2 cache. Efficiency cores and hyper-threading provide // little benefit and may even harm performance. // This is clamped to the range [1, B3_MAX_WORKERS]. Using a value above 1 will turn on multithreading. // If task callbacks are provided then Box3D will use the user provided task system. Otherwise Box3D // will create threads and use an internal scheduler. workerCount: u32, // function to spawn task enqueueTask: EnqueueTaskCallback, // function to finish a task finishTask: FinishTaskCallback, // User context that is provided to enqueueTask and finishTask userTaskContext: rawptr, // User data associated with a world userData: rawptr, // Used to create debug draw shapes. This is called when a shape is // first drawn using b3DebugDraw. createDebugShape: CreateDebugShapeCallback, // Used to destroy debug draw shapes. This is called when a shape is modified or destroyed. destroyDebugShape: DestroyDebugShapeCallback, // This is passed to the debug shape callbacks to provide a user context. userDebugShapeContext: rawptr, // Optional initial capacities capacity: Capacity, // Used internally to detect a valid definition. DO NOT SET. internalValue: i32, }
World definition used to create a simulation world. Must be initialized using b3DefaultWorldDef. @ingroup world
Related Procedures With Parameters
Related Procedures With Returns
WorldId ¶
/ World id references a world instance. This should be treated as an opaque handle.
Related Procedures With Parameters
- CreateBody
- CreateDistanceJoint
- CreateFilterJoint
- CreateMotorJoint
- CreateParallelJoint
- CreatePrismaticJoint
- CreateRevoluteJoint
- CreateSphericalJoint
- CreateWeldJoint
- CreateWheelJoint
- DestroyWorld
- StoreWorldId
- World_CastMover
- World_CastRay
- World_CastRayClosest
- World_CastShape
- World_CollideMover
- World_Draw
- World_Dump
- World_DumpAwake
- World_DumpMemoryStats
- World_DumpShapeBounds
- World_EnableContinuous
- World_EnableSleeping
- World_EnableSpeculative
- World_EnableWarmStarting
- World_Explode
- World_GetAwakeBodyCount
- World_GetBodyEvents
- World_GetBounds
- World_GetContactEvents
- World_GetContactRecycleDistance
- World_GetCounters
- World_GetGravity
- World_GetHitEventThreshold
- World_GetJointEvents
- World_GetMaxCapacity
- World_GetMaximumLinearSpeed
- World_GetProfile
- World_GetRestitutionThreshold
- World_GetSensorEvents
- World_GetUserData
- World_GetWorkerCount
- World_IsContinuousEnabled
- World_IsSleepingEnabled
- World_IsValid
- World_IsWarmStartingEnabled
- World_OverlapAABB
- World_OverlapShape
- World_RebuildStaticTree
- World_SetContactRecycleDistance
- World_SetContactTuning
- World_SetCustomFilterCallback
- World_SetFrictionCallback
- World_SetGravity
- World_SetHitEventThreshold
- World_SetMaximumLinearSpeed
- World_SetPreSolveCallback
- World_SetRestitutionCallback
- World_SetRestitutionThreshold
- World_SetUserData
- World_SetWorkerCount
- World_StartRecording
- World_Step
- World_StopRecording
Related Procedures With Returns
Related Constants
WorldTransform ¶
WorldTransform :: struct { p: [3]f32, q: quaternion128, }
Related Procedures With Parameters
Related Procedures With Returns
Related Constants
Constants
AABB_MARGIN_FRACTION ¶
AABB_MARGIN_FRACTION :: 0.125
Per-shape AABB margin is a fraction of the shape extent (capped by B3_MAX_AABB_MARGIN). Small shapes get small margins; large shapes are clamped to the cap.
BODY_NAME_LENGTH ¶
BODY_NAME_LENGTH :: 18
Maximum length of the body name. Can be 0 if you don't need names. Note: this gates recording capability.
CHILD_POWER ¶
CHILD_POWER :: 64 - 2 * SHAPE_POWER
COMPOUND_VERSION ¶
COMPOUND_VERSION :: 0x830778DB07086EB4 ~ DYNAMIC_TREE_VERSION ~ MESH_VERSION ~ HULL_VERSION
The compound version depends on the tree, mesh, and hull versions.
CONTACT_MANIFOLD_COUNT_BUCKETS ¶
CONTACT_MANIFOLD_COUNT_BUCKETS :: 8
Number of contact point buckets for counting the number of contact points per shape contact pair. This is just for reporting and doesn't affect simulation.
CONTACT_RECYCLE_ANGULAR_DISTANCE ¶
CONTACT_RECYCLE_ANGULAR_DISTANCE :: 0.99240388
The default contact recycling world angle threshold. For performance this value is cos(angle/2)^2. This value corresponds to 10 degrees.
DEFAULT_CATEGORY_BITS ¶
DEFAULT_CATEGORY_BITS: u64 : max(u64)
DEFAULT_MASK_BITS ¶
DEFAULT_MASK_BITS: u64 : max(u64)
DEG_TO_RAD ¶
DEG_TO_RAD :: math.RAD_PER_DEG
Convenience constant to convert from degrees to radians.
DOUBLE_PRECISION ¶
DOUBLE_PRECISION :: false
DYNAMIC_TREE_VERSION ¶
DYNAMIC_TREE_VERSION :: 0x93EDAF889FD30B4A
Dynamic tree version for compatibility testing.
ENABLE_VALIDATION ¶
ENABLE_VALIDATION :: false
GRAPH_COLOR_COUNT ¶
GRAPH_COLOR_COUNT :: 24
Maximum number of colors in the constraint graph. Constraints that cannot find a color are added to the overflow set which are solved single-threaded. The compound barrel benchmark has minor overflow with 24 colors
HASH_INIT ¶
HASH_INIT :: 5381
HEIGHT_FIELD_HOLE ¶
HEIGHT_FIELD_HOLE :: 0xFF
This material index is used to designate holes in a height field.
HEIGHT_FIELD_VERSION ¶
HEIGHT_FIELD_VERSION :: 0x8B18CBD138A6BC84
64-bit height-field version. Useful for validating serialized data.
HULL_VERSION ¶
HULL_VERSION :: 0x9D4716CE3793900E
64-bit hull version. Useful for validating serialized data.
MAX_CHILD_SHAPES ¶
MAX_CHILD_SHAPES :: 1 << CHILD_POWER
MAX_COMPOUND_MESH_MATERIALS ¶
MAX_COMPOUND_MESH_MATERIALS :: 4
Meshes used in compounds have limited space for materials. If you have a mesh with many materials, you can use it outside of the compound.
MAX_MANIFOLD_POINTS ¶
MAX_MANIFOLD_POINTS :: 4
The maximum number of contact points between two touching shapes.
MAX_ROTATION ¶
MAX_ROTATION :: 0.25 * PI
The maximum rotation of a body per time step. This limit is very large and is used to prevent numerical problems. You shouldn't need to adjust this. @warning increasing this to 0.5f * B3_PI or greater will break continuous collision.
MAX_SHAPES ¶
MAX_SHAPES :: 1 << SHAPE_POWER
MAX_SHAPE_CAST_POINTS ¶
MAX_SHAPE_CAST_POINTS :: 64
The maximum number points to use for shape cast proxies (swept point cloud).
MAX_TASKS ¶
MAX_TASKS :: 256
Maximum number of tasks queued per world step. b3EnqueueTaskCallback will never be called more than this per world step. This is related to B3_MAX_WORKERS. With 32 workers, the maximum observed task count is 130. This allows an external task system to use a fixed size array for Box3D task, which may help with creating stable user task pointers.
MESH_VERSION ¶
MESH_VERSION :: 0xABD11AB62A6E886D
64-bit mesh version. Useful for validating serialized data.
Mat3_identity ¶
Mat3_identity: matrix[3, 3]f32 : Matrix3(1)
Mat3_zero ¶
Mat3_zero: matrix[3, 3]f32 : Matrix3(0)
NULL_INDEX ¶
NULL_INDEX :: -1
This is used to indicate null for interfaces that work with indices instead of pointers
Pos_zero ¶
Pos_zero: [3]f32 : Pos{0.0, 0.0, 0.0}
Quat_identity ¶
Quat_identity: quaternion128 : Quat(1)
RAD_TO_DEG ¶
RAD_TO_DEG :: math.DEG_PER_RAD
Convenience constant to convert from radians to degrees.
SHAPE_NAME_LENGTH ¶
SHAPE_NAME_LENGTH :: 18
Maximum length of the shape name. Can be 0 if you don't need names. Note: this gates recording capability. todo waiting on this because it breaks existing recordings
TIME_TO_SLEEP ¶
TIME_TO_SLEEP :: 0.5
The time that a body must be still before it will go to sleep. In seconds.
Transform_identity ¶
Transform_identity :: Transform{p = {0, 0, 0}, q = 1}
Vec3_axisX ¶
Vec3_axisX: [3]f32 : Vec3{1.0, 0.0, 0.0}
Vec3_axisY ¶
Vec3_axisY: [3]f32 : Vec3{0.0, 1.0, 0.0}
Vec3_axisZ ¶
Vec3_axisZ: [3]f32 : Vec3{0.0, 0.0, 1.0}
Vec3_one ¶
Vec3_one: [3]f32 : Vec3{1.0, 1.0, 1.0}
Vec3_zero ¶
Vec3_zero: [3]f32 : Vec3{0.0, 0.0, 0.0}
WorldTransform_identity ¶
WorldTransform_identity :: WorldTransform{p = {0, 0, 0}, q = 1}
allConcaveEdges ¶
allConcaveEdges: MeshEdgeFlags : concaveEdge1 + concaveEdge2 + concaveEdge3
allFlatEdges ¶
allFlatEdges: MeshEdgeFlags : flatEdge1 + flatEdge2 + flatEdge3
concaveEdge1 ¶
concaveEdge1 :: MeshEdgeFlags{.concaveEdge1}
concaveEdge2 ¶
concaveEdge2 :: MeshEdgeFlags{.concaveEdge2}
concaveEdge3 ¶
concaveEdge3 :: MeshEdgeFlags{.concaveEdge3}
emptyDistanceCache ¶
emptyDistanceCache :: SimplexCache{}
flatEdge1 ¶
flatEdge1: MeshEdgeFlags : concaveEdge1 + inverseConcaveEdge1
flatEdge2 ¶
flatEdge2: MeshEdgeFlags : concaveEdge2 + inverseConcaveEdge2
flatEdge3 ¶
flatEdge3: MeshEdgeFlags : concaveEdge3 + inverseConcaveEdge3
inverseConcaveEdge1 ¶
inverseConcaveEdge1 :: MeshEdgeFlags{.inverseConcaveEdge1}
inverseConcaveEdge2 ¶
inverseConcaveEdge2 :: MeshEdgeFlags{.inverseConcaveEdge2}
inverseConcaveEdge3 ¶
inverseConcaveEdge3 :: MeshEdgeFlags{.inverseConcaveEdge3}
nullBodyId ¶
nullBodyId :: BodyId{}
nullContactId ¶
nullContactId :: ContactId{}
nullJointId ¶
nullJointId :: JointId{}
nullShapeId ¶
nullShapeId :: ShapeId{}
nullWorldId ¶
nullWorldId :: WorldId{}
/ Use these to make your identifiers null. / You may also use zero initialization to get null.
Variables
This section is empty.
Procedures
AABB_Area ¶
Get the surface area of an axis-aligned bounding box.
AABB_Center ¶
Get the center of an axis-aligned bounding box.
AABB_Extents ¶
Get the extents (half-widths) of an axis-aligned bounding box.
AABB_Inflate ¶
Add uniform padding to an axis-aligned bounding box.
AABB_Overlaps ¶
Do two axis-aligned boxes overlap?
AABB_Transform ¶
Transform an axis-aligned bounding box. This can create a larger box than if you recomputed the AABB of the original shape with the transform applied.
AABB_Union ¶
Get the union of two axis-aligned bounding boxes.
ASSERT ¶
ASSERT :: proc "c" (condition: bool, message: string = #caller_expression(condition), loc := #caller_location) {…}
AbsFloat ¶
abs returns the absolute value of passed argument.
If the argument is a complex or quaternion, this is equivalent to real(conj(value) * value).
AbsMatrix3 ¶
Get the component-wise absolute value of a matrix.
Atan2 ¶
Compute an approximate arctangent in the range [-pi, pi] This is hand coded for cross-platform determinism. The atan2f function in the standard library is not cross-platform deterministic.
Accurate to around 0.0023 degrees.
BREAKPOINT ¶
BREAKPOINT :: intrinsics.debug_trap
BREAKPOINT :: proc() {…}
A call intended to cause an execution trap with the intention of requesting a debugger's attention.
Blend2 ¶
Blend two vectors: s a + t b
Body_ApplyAngularImpulse ¶
Apply an angular impulse in world space. The impulse is ignored if the body is not awake. This optionally wakes the body. @param bodyId The body id @param impulse the world angular impulse vector, usually in units of kgmm/s @param wake also wake up the body @warning This should be used for one-shot impulses. If you need a steady torque, use a torque instead, which will work better with the sub-stepping solver.
Body_ApplyForce ¶
Apply a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the angular velocity. This optionally wakes up the body. The force is ignored if the body is not awake. @param bodyId The body id @param force The world force vector, usually in newtons (N) @param point The world position of the point of application @param wake Option to wake up the body
Body_ApplyForceToCenter ¶
Apply a force to the center of mass. This optionally wakes up the body. The force is ignored if the body is not awake. @param bodyId The body id @param force the world force vector, usually in newtons (N). @param wake also wake up the body
Body_ApplyLinearImpulse ¶
Body_ApplyLinearImpulse :: proc "c" (bodyId: BodyId, impulse: [3]f32, point: [3]f32, wake: bool) ---
Apply an impulse at a point. This immediately modifies the velocity. It also modifies the angular velocity if the point of application is not at the center of mass. This optionally wakes the body. The impulse is ignored if the body is not awake. @param bodyId The body id @param impulse the world impulse vector, usually in Ns or kgm/s. @param point the world position of the point of application. @param wake also wake up the body @warning This should be used for one-shot impulses. If you need a steady force, use a force instead, which will work better with the sub-stepping solver.
Body_ApplyLinearImpulseToCenter ¶
Apply an impulse to the center of mass. This immediately modifies the velocity. The impulse is ignored if the body is not awake. This optionally wakes the body. @param bodyId The body id @param impulse the world impulse vector, usually in Ns or kgm/s. @param wake also wake up the body @warning This should be used for one-shot impulses. If you need a steady force, use a force instead, which will work better with the sub-stepping solver.
Body_ApplyMassFromShapes ¶
Body_ApplyMassFromShapes :: proc "c" (bodyId: BodyId) ---
This updates the mass properties to the sum of the mass properties of the shapes. This normally does not need to be called unless you called SetMassData to override the mass and you later want to reset the mass. You may also use this when automatic mass computation has been disabled. You should call this regardless of body type.
Body_ApplyTorque ¶
Apply a torque. This affects the angular velocity without affecting the linear velocity. This optionally wakes the body. The torque is ignored if the body is not awake. @param bodyId The body id @param torque the world torque vector, usually in N*m. @param wake also wake up the body
Body_CastRay ¶
Body_CastRay :: proc "c" ( bodyId: BodyId, origin: [3]f32, translation: [3]f32, filter: QueryFilter, maxFraction: f32, bodyTransform: WorldTransform, ) -> BodyCastResult ---
Cast a ray at a specific body using a specified body transform.
Body_CastShape ¶
Body_CastShape :: proc "c" ( bodyId: BodyId, origin: [3]f32, #by_ptr proxy: ShapeProxy, translation: [3]f32, filter: QueryFilter, maxFraction: f32, canEncroach: b32, bodyTransform: WorldTransform, ) -> BodyCastResult ---
Cast a shape at a specific body using a specified body transform.
Body_CollideMover ¶
Body_CollideMover :: proc "c" ( bodyId: BodyId, bodyPlanes: [^]BodyPlaneResult, planeCapacity: i32, origin: [3]f32, #by_ptr mover: Capsule, filter: QueryFilter, bodyTransform: WorldTransform, ) -> i32 ---
Collide a character mover with a specific body using a specified body transform.
Body_ComputeAABB ¶
Get the current world AABB that contains all the attached shapes. Note that this may not encompass the body origin. If there are no shapes attached then the returned AABB is empty and centered on the body origin.
Body_Disable ¶
Body_Disable :: proc "c" (bodyId: BodyId) ---
Disable a body by removing it completely from the simulation. This is expensive.
Body_Enable ¶
Body_Enable :: proc "c" (bodyId: BodyId) ---
Enable a body by adding it to the simulation. This is expensive.
Body_EnableContactRecycling ¶
Enable or disable contact recycling for this body. Contact recycling is a performance optimization that reuses contact manifolds when bodies move slightly. Disabling it can avoid ghost collisions on characters at the cost of higher per-step work. Existing contacts retain their prior setting; only contacts created after this call see the new value. @see BodyDef::enableContactRecycling
Body_EnableHitEvents ¶
Enable/disable hit events on all shapes @see ShapeDef::enableHitEvents
Body_EnableSleep ¶
Enable or disable sleeping for this body. If sleeping is disabled the body will wake.
Body_GetAngularDamping ¶
Get the current angular damping.
Body_GetAngularVelocity ¶
Get the angular velocity of a body in radians per second
Body_GetClosestPoint ¶
Get the closest point on a body to a world target.
Body_GetContactCapacity ¶
Get the maximum capacity required for retrieving all the touching contacts on a body
Body_GetContactData ¶
Body_GetContactData :: proc "c" (bodyId: BodyId, contactData: [^]ContactData, capacity: i32) -> i32 ---
Get the touching contact data for a body
Body_GetGravityScale ¶
Get the current gravity scale
Body_GetInverseMass ¶
Get the inverse mass of the body, usually in 1/kilograms
Body_GetJointCount ¶
Get the number of joints on this body
Body_GetJoints ¶
Get the joint ids for all joints on this body, up to the provided capacity @returns the number of joint ids stored in the user array
Body_GetLinearDamping ¶
Get the current linear damping.
Body_GetLinearVelocity ¶
Get the linear velocity of a body's center of mass. Usually in meters per second.
Body_GetLocalCenterOfMass ¶
Get the center of mass position of the body in local space
Body_GetLocalPoint ¶
Get a local point on a body given a world point
Body_GetLocalPointVelocity ¶
Get the linear velocity of a local point attached to a body. Usually in meters per second.
Body_GetLocalRotationalInertia ¶
Get the rotational inertia of the body in local space, usually in kg*m^2
Body_GetLocalVector ¶
Get a local vector on a body given a world vector
Body_GetMass ¶
Get the mass of the body, usually in kilograms
Body_GetMassData ¶
Get the mass data for a body
Body_GetMotionLocks ¶
Body_GetMotionLocks :: proc "c" (bodyId: BodyId) -> MotionLocks ---
Get the motion locks for this body.
Body_GetPosition ¶
Get the world position of a body. This is the location of the body origin.
Body_GetRotation ¶
Body_GetRotation :: proc "c" (bodyId: BodyId) -> quaternion128 ---
Get the world rotation of a body as a quaternion
Body_GetShapeCount ¶
Get the number of shapes on this body
Body_GetShapes ¶
Get the shape ids for all shapes on this body, up to the provided capacity. @returns the number of shape ids stored in the user array
Body_GetSleepThreshold ¶
Get the sleep threshold, usually in meters per second.
Body_GetTransform ¶
Body_GetTransform :: proc "c" (bodyId: BodyId) -> WorldTransform ---
Get the world transform of a body.
Body_GetType ¶
Get the body type: static, kinematic, or dynamic
Body_GetUserData ¶
Body_GetUserData :: proc "c" (bodyId: BodyId) ---
Get the user data stored in a body
Body_GetWorld ¶
Get the world that owns this body
Body_GetWorldCenterOfMass ¶
Get the center of mass position of the body in world space
Body_GetWorldInverseRotationalInertia ¶
Get the inverse rotational inertia of the body in world space, usually in 1/kg*m^2
Body_GetWorldPoint ¶
Get a world point on a body given a local point
Body_GetWorldPointVelocity ¶
Get the linear velocity of a world point attached to a body. Usually in meters per second.
Body_GetWorldVector ¶
Get a world vector on a body given a local vector
Body_IsAwake ¶
@return true if this body is awake
Body_IsContactRecyclingEnabled ¶
Is contact recycling enabled on this body?
Body_IsEnabled ¶
Returns true if this body is enabled
Body_IsSleepEnabled ¶
Returns true if sleeping is enabled for this body
Body_IsValid ¶
Body identifier validation. A valid body exists in a world and is non-null. This can be used to detect orphaned ids. Provides validation for up to 64K allocations.
Body_OverlapShape ¶
Body_OverlapShape :: proc "c" (bodyId: BodyId, origin: [3]f32, #by_ptr proxy: ShapeProxy, filter: QueryFilter, bodyTransform: WorldTransform) -> bool ---
Overlap a shape with a specific body using a specified body transform.
Body_SetAngularDamping ¶
Adjust the angular damping. Normally this is set in BodyDef before creation.
Body_SetAngularVelocity ¶
Set the angular velocity of a body in radians per second
Body_SetAwake ¶
Wake a body from sleep. This wakes the entire island the body is touching. @warning Putting a body to sleep will put the entire island of bodies touching this body to sleep, which can be expensive and possibly unintuitive.
Body_SetBullet ¶
Set this body to be a bullet. A bullet does continuous collision detection against dynamic bodies (but not other bullets).
Body_SetGravityScale ¶
Adjust the gravity scale. Normally this is set in BodyDef before creation. @see BodyDef::gravityScale
Body_SetLinearDamping ¶
Adjust the linear damping. Normally this is set in BodyDef before creation.
Body_SetLinearVelocity ¶
Set the linear velocity of a body. Usually in meters per second.
Body_SetMassData ¶
Override the body's mass properties. Normally this is computed automatically using the shape geometry and density. This information is lost if a shape is added or removed or if the body type changes.
Body_SetMotionLocks ¶
Body_SetMotionLocks :: proc "c" (bodyId: BodyId, locks: MotionLocks) ---
Set the motion locks on this body.
Body_SetName ¶
Set the body name. Up to B3_BODY_NAME_LENGTH characters including null termination.
Body_SetSleepThreshold ¶
Set the sleep threshold, usually in meters per second
Body_SetTargetTransform ¶
Body_SetTargetTransform :: proc "c" (bodyId: BodyId, target: WorldTransform, timeStep: f32, wake: bool) ---
Set the velocity to reach the given transform after a given time step. The result will be close but maybe not exact. This is meant for kinematic bodies. The target is not applied if the velocity would be below the sleep threshold. This will optionally wake the body if asleep, but only if the movement is significant.
Body_SetTransform ¶
Body_SetTransform :: proc "c" (bodyId: BodyId, position: [3]f32, rotation: quaternion128) ---
Set the world transform of a body. This acts as a teleport and is fairly expensive. @note Generally you should create a body with the intended transform. @see BodyDef::position and BodyDef::rotation
Body_SetType ¶
Change the body type. This is an expensive operation. This automatically updates the mass properties regardless of the automatic mass setting.
Body_SetUserData ¶
Set the user data for a body
CONTACT_RECYCLE_DISTANCE ¶
CONTACT_RECYCLE_DISTANCE :: proc "c" () -> f32 {…}
The default contact recycling distance.
ClampFloat ¶
clamp returns a value v clamped between minimum and maximum.
This is calculated as follows: minimum if v < minimum else maximum if v > maximum else v.
ClampInt ¶
clamp returns a value v clamped between minimum and maximum.
This is calculated as follows: minimum if v < minimum else maximum if v > maximum else v.
ClipVector ¶
ClipVector :: proc "c" (vector: [3]f32, planes: [^]CollisionPlane, count: i32) -> [3]f32 ---
Clips the velocity against the given collision planes. Planes with zero push or clipVelocity set to false are skipped.
CloneAndTransformHull ¶
CloneAndTransformHull :: proc "c" (#by_ptr original: HullData, transform: Transform, scale: [3]f32) -> ^HullData ---
Clone and transform a hull. Supports non-uniform and mirroring scale.
CloneHull ¶
Deep clone a hull.
ClosestPointToAABB ¶
Get the closest point on an axis-aligned bounding box.
CollideCapsuleAndSphere ¶
CollideCapsuleAndSphere :: proc "c" (manifold: ^LocalManifold, capacity: i32, #by_ptr capsuleA: Capsule, #by_ptr sphereB: Sphere, transformBtoA: Transform) ---
Collide a capsule and a sphere.
CollideCapsuleAndTriangle ¶
CollideCapsuleAndTriangle :: proc "c" (manifold: ^LocalManifold, capacity: i32, #by_ptr capsuleA: Capsule, #by_ptr triangleB: [3][3]f32, cache: ^SimplexCache) ---
Collide a capsule and a triangle.
CollideCapsules ¶
CollideCapsules :: proc "c" (manifold: ^LocalManifold, capacity: i32, #by_ptr capsuleA, #by_ptr capsuleB: Capsule, transformBtoA: Transform) ---
Collide two capsules.
CollideHullAndCapsule ¶
CollideHullAndCapsule :: proc "c" ( manifold: ^LocalManifold, capacity: i32, #by_ptr hullA: HullData, #by_ptr capsuleB: Capsule, transformBtoA: Transform, cache: ^SimplexCache, ) ---
Collide a hull and a capsule.
CollideHullAndSphere ¶
CollideHullAndSphere :: proc "c" ( manifold: ^LocalManifold, capacity: i32, #by_ptr hullA: HullData, #by_ptr sphereB: Sphere, transformBtoA: Transform, cache: ^SimplexCache, ) ---
Collide a hull and a sphere.
CollideHullAndTriangle ¶
CollideHullAndTriangle :: proc "c" ( manifold: ^LocalManifold, capacity: i32, #by_ptr hullA: HullData, v1, v2, v3: [3]f32, triangleFlags: i32, cache: ^SATCache, ) ---
Collide a hull and a triangle.
CollideHulls ¶
CollideHulls :: proc "c" ( manifold: ^LocalManifold, capacity: i32, #by_ptr hullA: HullData, #by_ptr hullB: HullData, transformBtoA: Transform, cache: ^SATCache, ) ---
Collide two hulls.
CollideSphereAndTriangle ¶
CollideSphereAndTriangle :: proc "c" (manifold: ^LocalManifold, capacity: i32, #by_ptr sphereA: Sphere, #by_ptr triangleB: [3][3]f32) ---
Collide a sphere and a triangle.
CollideSpheres ¶
CollideSpheres :: proc "c" (manifold: ^LocalManifold, capacity: i32, #by_ptr sphereA, #by_ptr sphereB: Sphere, transformBtoA: Transform) ---
Collide two spheres.
ComputeCapsuleAABB ¶
Compute the bounding box of a transformed capsule
ComputeCapsuleMass ¶
Compute mass properties of a capsule
ComputeCompoundAABB ¶
ComputeCompoundAABB :: proc "c" (#by_ptr shape: CompoundData, transform: Transform) -> AABB ---
Compute the bounding box of a compound
ComputeCosSin ¶
Compute the cosine and sine of an angle in radians. Implemented for cross-platform determinism.
ComputeHeightFieldAABB ¶
ComputeHeightFieldAABB :: proc "c" (#by_ptr shape: HeightFieldData, transform: Transform) -> AABB ---
Compute the bounding box of a transformed height-field
ComputeHullAABB ¶
Compute the bounding box of a transformed hull
ComputeHullMass ¶
Compute mass properties of a hull
ComputeMeshAABB ¶
ComputeMeshAABB :: proc "c" (#by_ptr shape: MeshData, transform: Transform, scale: [3]f32) -> AABB ---
Compute the bounding box of a transformed mesh. Scale may be non-uniform and have negative components.
ComputeQuatBetweenUnitVectors ¶
ComputeQuatBetweenUnitVectors :: proc "c" (v1, v2: [3]f32) -> quaternion128 ---
Find a quaternion that rotates one vector to another.
ComputeSphereAABB ¶
Compute the bounding box of a transformed sphere
ComputeSphereMass ¶
Compute mass properties of a sphere
Contact_GetData ¶
Contact_GetData :: proc "c" (contactId: ContactId) -> ContactData ---
Get the manifolds for a contact. The manifold may have no points if the contact is not touching.
Contact_IsValid ¶
Contact identifier validation. Provides validation for up to 2^32 allocations.
ConvertBytesToCompound ¶
ConvertBytesToCompound :: proc "c" (bytes: [^]u8, byteCount: i32) -> ^CompoundData ---
Convert bytes to compound. This does not clone. The bytes must remain in scope while the compound is used. This is done to improve run-time performance and allow for instancing. The bytes are mutated to fixup pointers.
ConvertCompoundToBytes ¶
ConvertCompoundToBytes :: proc "c" (compound: ^CompoundData) -> [^]u8 ---
If bytes is null then this returns the number of required bytes. This clones all the data into the bytes buffer. This is expected to run offline or asynchronously. This mutates the compound to nullify pointers, leaving the compound in an unusable state.
CreateBody ¶
Create a rigid body given a definition. No reference to the definition is retained. So you can create the definition on the stack and pass it as a pointer. @code{.c} BodyDef bodyDef = DefaultBodyDef(); BodyId myBodyId = CreateBody(myWorldId, &bodyDef); @endcode @warning This function is locked during callbacks.
CreateBoxMesh ¶
Create a box mesh.
CreateCapsuleShape ¶
CreateCapsuleShape :: proc "c" (bodyId: BodyId, #by_ptr def: ShapeDef, #by_ptr capsule: Capsule) -> ShapeId ---
Create a capsule shape and attach it to a body. The shape definition and geometry are fully cloned. Contacts are not created until the next time step. @return the shape id for accessing the shape
CreateCompound ¶
CreateCompound :: proc "c" (#by_ptr def: CompoundDef) -> ^CompoundData ---
Create a compound shape. All input data in the definition is cloned into the resulting compound.
CreateCompoundShape ¶
CreateCompoundShape :: proc "c" (bodyId: BodyId, def: ^ShapeDef, #by_ptr compound: CompoundData) -> ShapeId ---
Compound shapes are only allowed on static bodies.
CreateCone ¶
Create a tessellated cone as a hull.
CreateCylinder ¶
Create a tessellated cylinder as a hull.
CreateDistanceJoint ¶
CreateDistanceJoint :: proc "c" (worldId: WorldId, #by_ptr def: DistanceJointDef) -> JointId ---
Create a distance joint @see DistanceJointDef for details
CreateFilterJoint ¶
CreateFilterJoint :: proc "c" (worldId: WorldId, #by_ptr def: FilterJointDef) -> JointId ---
Create a filter joint. @see FilterJointDef for details
CreateGrid ¶
CreateGrid :: proc "c" (rowCount, columnCount: i32, scale: [3]f32, makeHoles: bool) -> ^HeightFieldData ---
Create a grid as a height field.
CreateGridMesh ¶
CreateGridMesh :: proc "c" (xCount: i32, zCount: i32, cellWidth: f32, materialCount: i32, identifyEdges: bool) -> ^MeshData ---
Create a grid mesh along the x and z axes. @param xCount the number of rows in the x direction @param zCount the number of rows in the z direction @param cellWidth the width of each cell @param materialCount the number of materials to generate @param identifyEdges compute adjacency information
CreateHeightField ¶
CreateHeightField :: proc "c" (#by_ptr data: HeightFieldDef) -> ^HeightFieldData ---
Create a generic height field.
CreateHeightFieldShape ¶
CreateHeightFieldShape :: proc "c" (bodyId: BodyId, #by_ptr def: ShapeDef, #by_ptr heightField: HeightFieldData) -> ShapeId ---
Create a height-field shape and attach it to a body. The shape definition is fully cloned but the height field is not. Contacts are not created until the next time step. Height field is only allowed on static bodies. @warning this holds reference to the input height field which must remain valid for the lifetime of this shape @return the shape id for accessing the shape
CreateHollowBoxMesh ¶
Create a hollow box mesh.
CreateHull ¶
Create a generic convex hull.
CreateHullShape ¶
CreateHullShape :: proc "c" (bodyId: BodyId, #by_ptr def: ShapeDef, #by_ptr hull: HullData) -> ShapeId ---
Create a convex hull shape and attach it to a body. The shape definition is fully cloned. Contacts are not created until the next time step. @return the shape id for accessing the shape
CreateMesh ¶
CreateMesh :: proc "c" (#by_ptr def: MeshDef, degenerateTriangleIndices: [^]i32, degenerateCapacity: i32) -> ^MeshData ---
Create a generic mesh.
CreateMeshShape ¶
CreateMeshShape :: proc "c" (bodyId: BodyId, #by_ptr def: ShapeDef, #by_ptr mesh: MeshData, scale: [3]f32) -> ShapeId ---
Create a mesh hull shape and attach it to a body. The shape definition is fully cloned but the mesh is not. Contacts are not created until the next time step. Mesh collision only creates contacts on static bodies. @warning this holds reference to the input mesh data which must remain valid for the lifetime of this shape @return the shape id for accessing the shape
CreateMotorJoint ¶
CreateMotorJoint :: proc "c" (worldId: WorldId, #by_ptr def: MotorJointDef) -> JointId ---
Create a motor joint @see MotorJointDef for details
CreateParallelJoint ¶
CreateParallelJoint :: proc "c" (worldId: WorldId, #by_ptr def: ParallelJointDef) -> JointId ---
Create a parallel joint @see ParallelJointDef for details
CreatePlatformMesh ¶
CreatePlatformMesh :: proc "c" (center: [3]f32, height, topWidth, bottomWidth: f32) -> ^MeshData ---
Create a platform mesh. A truncated pyramid.
CreatePrismaticJoint ¶
CreatePrismaticJoint :: proc "c" (worldId: WorldId, #by_ptr def: PrismaticJointDef) -> JointId ---
Create a prismatic (slider) joint. @see PrismaticJointDef for details
CreateRecording ¶
Create a recording buffer with an optional initial byte capacity. Pass 0 to use the default (64 KiB). The buffer grows on demand. @return a new recording, owned by the caller
CreateRevoluteJoint ¶
CreateRevoluteJoint :: proc "c" (worldId: WorldId, #by_ptr def: RevoluteJointDef) -> JointId ---
Create a revolute joint @see RevoluteJointDef for details
CreateSphereShape ¶
CreateSphereShape :: proc "c" (bodyId: BodyId, #by_ptr def: ShapeDef, #by_ptr sphere: Sphere) -> ShapeId ---
Create a circle shape and attach it to a body. The shape definition and geometry are fully cloned. Contacts are not created until the next time step. @return the shape id for accessing the shape
CreateSphericalJoint ¶
CreateSphericalJoint :: proc "c" (worldId: WorldId, #by_ptr def: SphericalJointDef) -> JointId ---
Create a spherical joint @see SphericalJointDef for details
CreateTorusMesh ¶
CreateTorusMesh :: proc "c" (radialResolution: i32, tubularResolution: i32, radius: f32, thickness: f32) -> ^MeshData ---
Create a torus mesh.
CreateTransformedHullShape ¶
CreateTransformedHullShape :: proc "c" (bodyId: BodyId, #by_ptr def: ShapeDef, #by_ptr hull: HullData, transform: Transform, scale: [3]f32) -> ShapeId ---
Create a convex hull shape and attach it to a body. The hull is cloned then transformed with scale applied first. Use this for non-uniform or mirrored scale or a baked local transform. The baked result is shared through the world hull database. The shape definition and geometry are fully cloned. Contacts are not created until the next time step. @return the shape id for accessing the shape
CreateWave ¶
CreateWave :: proc "c" ( rowCount, columnCount: i32, scale: [3]f32, rowFrequency: f32, columnFrequency: f32, makeHoles: bool, ) -> ^HeightFieldData ---
Create a wave grid as a height field.
CreateWaveMesh ¶
CreateWaveMesh :: proc "c" ( xCount: i32, zCount: i32, cellWidth: f32, amplitude: f32, rowFrequency: f32, columnFrequency: f32, ) -> ^MeshData ---
Create a wave mesh along the x and z axes.
CreateWeldJoint ¶
CreateWeldJoint :: proc "c" (worldId: WorldId, #by_ptr def: WeldJointDef) -> JointId ---
Create a weld joint @see WeldJointDef for details
CreateWheelJoint ¶
CreateWheelJoint :: proc "c" (worldId: WorldId, #by_ptr def: WheelJointDef) -> JointId ---
Create a wheel joint. @see WheelJointDef for details.
CreateWorld ¶
Create a world for rigid body simulation. A world contains bodies, shapes, and constraints. You may create up to 128 worlds. Each world is completely independent and may be simulated in parallel. @return the world id.
DefaultBodyDef ¶
DefaultBodyDef :: proc "c" () -> BodyDef ---
Use this to initialize your body definition @ingroup body
DefaultDebugDraw ¶
DefaultDebugDraw :: proc "c" () -> DebugDraw ---
Create a debug draw struct with default values.
DefaultDistanceJointDef ¶
DefaultDistanceJointDef :: proc "c" () -> DistanceJointDef ---
Use this to initialize your joint definition @ingroup distance_joint
DefaultExplosionDef ¶
DefaultExplosionDef :: proc "c" () -> ExplosionDef ---
Use this to initialize your explosion definition @ingroup world
DefaultFilter ¶
DefaultFilter :: proc "c" () -> Filter ---
Use this to initialize your filter @ingroup shape
DefaultFilterJointDef ¶
DefaultFilterJointDef :: proc "c" () -> FilterJointDef ---
Use this to initialize your joint definition @ingroup filter_joint
DefaultMotorJointDef ¶
DefaultMotorJointDef :: proc "c" () -> MotorJointDef ---
Use this to initialize your joint definition @ingroup motor_joint
DefaultParallelJointDef ¶
DefaultParallelJointDef :: proc "c" () -> ParallelJointDef ---
Use this to initialize your joint definition @ingroup parallel_joint
DefaultPrismaticJointDef ¶
DefaultPrismaticJointDef :: proc "c" () -> PrismaticJointDef ---
Use this to initialize your joint definition @ingroup prismatic_joint
DefaultQueryFilter ¶
DefaultQueryFilter :: proc "c" () -> QueryFilter ---
Use this to initialize your query filter
DefaultRevoluteJointDef ¶
DefaultRevoluteJointDef :: proc "c" () -> RevoluteJointDef ---
Use this to initialize your joint definition. @ingroup revolute_joint
DefaultShapeDef ¶
DefaultShapeDef :: proc "c" () -> ShapeDef ---
Use this to initialize your shape definition @ingroup shape
DefaultSphericalJointDef ¶
DefaultSphericalJointDef :: proc "c" () -> SphericalJointDef ---
Use this to initialize your joint definition. @ingroup spherical_joint
DefaultSurfaceMaterial ¶
DefaultSurfaceMaterial :: proc "c" () -> SurfaceMaterial ---
Use this to initialize your surface material @ingroup shape
DefaultWeldJointDef ¶
DefaultWeldJointDef :: proc "c" () -> WeldJointDef ---
Use this to initialize your joint definition @ingroup weld_joint
DefaultWheelJointDef ¶
DefaultWheelJointDef :: proc "c" () -> WheelJointDef ---
Use this to initialize your joint definition @ingroup wheel_joint
DefaultWorldDef ¶
DefaultWorldDef :: proc "c" () -> WorldDef ---
Use this to initialize your world definition @ingroup world
DestroyBody ¶
DestroyBody :: proc "c" (bodyId: BodyId) ---
Destroy a rigid body given an id. This destroys all shapes and joints attached to the body. Do not keep references to the associated shapes and joints.
DestroyCompound ¶
DestroyCompound :: proc "c" (compound: ^CompoundData) ---
Destroy a compound shape.
DestroyHeightField ¶
DestroyHeightField :: proc "c" (heightField: ^HeightFieldData) ---
Destroy a height field.
DestroyJoint ¶
Destroy a joint
DestroyRecording ¶
DestroyRecording :: proc "c" (recording: ^Recording) ---
Destroy a recording and free its buffer. @param recording may be NULL
DestroyShape ¶
Destroy a shape. You may defer the body mass update which can improve performance if several shapes on a
body are destroyed at once. @see Body_ApplyMassFromShapes
DistanceJoint_EnableLimit ¶
Enable joint limit. The limit only works if the joint spring is enabled. Otherwise the joint is rigid and the limit has no effect.
DistanceJoint_EnableMotor ¶
Enable/disable the distance joint motor
DistanceJoint_EnableSpring ¶
Enable/disable the distance joint spring. When disabled the distance joint is rigid.
DistanceJoint_GetCurrentLength ¶
Get the current length of a distance joint
DistanceJoint_GetLength ¶
Get the rest length of a distance joint
DistanceJoint_GetMaxLength ¶
Get the distance joint maximum length
DistanceJoint_GetMaxMotorForce ¶
Get the distance joint maximum motor force, usually in newtons
DistanceJoint_GetMinLength ¶
Get the distance joint minimum length
DistanceJoint_GetMotorForce ¶
Get the distance joint current motor force, usually in newtons
DistanceJoint_GetMotorSpeed ¶
Get the distance joint motor speed, usually in meters per second
DistanceJoint_GetSpringDampingRatio ¶
Get the spring damping ratio
DistanceJoint_GetSpringForceRange ¶
Get the force range for the spring.
DistanceJoint_GetSpringHertz ¶
Get the spring Hertz
DistanceJoint_IsLimitEnabled ¶
Is the distance joint limit enabled?
DistanceJoint_IsMotorEnabled ¶
Is the distance joint motor enabled?
DistanceJoint_IsSpringEnabled ¶
Is the distance joint spring enabled?
DistanceJoint_SetLength ¶
Set the rest length of a distance joint @param jointId The id for a distance joint @param length The new distance joint length
DistanceJoint_SetLengthRange ¶
Set the minimum and maximum length parameters of a distance joint
DistanceJoint_SetMaxMotorForce ¶
Set the distance joint maximum motor force, usually in newtons
DistanceJoint_SetMotorSpeed ¶
Set the distance joint motor speed, usually in meters per second
DistanceJoint_SetSpringDampingRatio ¶
Set the spring damping ratio, non-dimensional
DistanceJoint_SetSpringForceRange ¶
Set the force range for the spring.
DistanceJoint_SetSpringHertz ¶
Set the spring stiffness in Hertz
DistanceSquared ¶
Squared distance between two points.
DumpHeightData ¶
DumpHeightData :: proc "c" (#by_ptr data: HeightFieldDef, fileName: cstring) ---
Save input height data to a file
DynamicTree_BoxCast ¶
DynamicTree_BoxCast :: proc "c" ( #by_ptr tree: DynamicTree, #by_ptr input: BoxCastInput, maskBits: u64, requireAllBits: bool, callback: TreeBoxCastCallbackFcn, ctx: rawptr, ) -> TreeStats ---
Sweep an AABB through the tree. The box is in the tree's world float frame and the callback re-differences each shape at full precision against the query origin. Used by the large world spatial queries so the tree traversal stays float while the narrow phase stays precise.
DynamicTree_Create ¶
DynamicTree_Create :: proc "c" (proxyCapacity: i32) -> DynamicTree ---
Constructing the tree initializes the node pool.
DynamicTree_CreateProxy ¶
DynamicTree_CreateProxy :: proc "c" (tree: ^DynamicTree, aabb: AABB, categoryBits: u64, userData: u64) -> i32 ---
Create a proxy. Provide an AABB and a userData value.
DynamicTree_Destroy ¶
DynamicTree_Destroy :: proc "c" (tree: ^DynamicTree) ---
Destroy the tree, freeing the node pool.
DynamicTree_DestroyProxy ¶
DynamicTree_DestroyProxy :: proc "c" (tree: ^DynamicTree, proxyId: i32) ---
Destroy a proxy. This asserts if the id is invalid.
DynamicTree_EnlargeProxy ¶
DynamicTree_EnlargeProxy :: proc "c" (tree: ^DynamicTree, proxyId: i32, aabb: AABB) ---
Enlarge a proxy and enlarge ancestors as necessary.
DynamicTree_GetAABB ¶
DynamicTree_GetAABB :: proc "c" (#by_ptr tree: DynamicTree, proxyId: i32) -> AABB {…}
Get the AABB of a proxy
DynamicTree_GetAreaRatio ¶
DynamicTree_GetAreaRatio :: proc "c" (#by_ptr tree: DynamicTree) -> f32 ---
Get the ratio of the sum of the node areas to the root area.
DynamicTree_GetByteCount ¶
DynamicTree_GetByteCount :: proc "c" (#by_ptr tree: DynamicTree) -> i32 ---
Get the number of bytes used by this tree
DynamicTree_GetCategoryBits ¶
DynamicTree_GetCategoryBits :: proc "c" (tree: ^DynamicTree, proxyId: i32) -> u64 ---
Get the category bits on a proxy.
DynamicTree_GetHeight ¶
DynamicTree_GetHeight :: proc "c" (#by_ptr tree: DynamicTree) -> i32 ---
Get the height of the binary tree.
DynamicTree_GetProxyCount ¶
DynamicTree_GetProxyCount :: proc "c" (#by_ptr tree: DynamicTree) -> i32 ---
Get the number of proxies created
DynamicTree_GetRootBounds ¶
DynamicTree_GetRootBounds :: proc "c" (#by_ptr tree: DynamicTree) -> AABB ---
Get the bounding box that contains the entire tree
DynamicTree_GetUserData ¶
DynamicTree_GetUserData :: proc "c" (#by_ptr tree: DynamicTree, proxyId: i32) -> u64 {…}
Get proxy user data
DynamicTree_Load ¶
DynamicTree_Load :: proc "c" (fileName: cstring, scale: f32) -> DynamicTree ---
Load a file for debugging
DynamicTree_MoveProxy ¶
DynamicTree_MoveProxy :: proc "c" (tree: ^DynamicTree, proxyId: i32, aabb: AABB) ---
Move a proxy to a new AABB by removing and reinserting into the tree.
DynamicTree_Query ¶
DynamicTree_Query :: proc "c" ( #by_ptr tree: DynamicTree, aabb: AABB, maskBits: u64, requireAllBits: bool, callback: TreeQueryCallbackFcn, ctx: rawptr, ) -> TreeStats ---
Query an AABB for overlapping proxies. The callback function is called for each proxy that overlaps the supplied AABB.
@return performance data
DynamicTree_QueryClosest ¶
DynamicTree_QueryClosest :: proc "c" ( #by_ptr tree: DynamicTree, point: [3]f32, maskBits: u64, requireAllBits: bool, callback: TreeQueryClosestCallbackFcn, ctx: rawptr, minDistanceSqr: ^f32, ) -> TreeStats ---
Query an AABB for the closest object. The callback function is called for each proxy that might be closest to the supplied point. @param tree the dynamic tree to query @param point the query point @param maskBits nodes are skipped if the bit-wise AND with the node category bits is zero @param requireAllBits nodes are skipped if the bit-wise AND with the node category bits does not equal the maskBits @param callback a user provided instance of TreeQueryClosestCallbackFcn @param context a user context object that is provided to the callback @param minDistanceSqr the initial and final minimum squared distance. Provide a small initial to restrict the search and improve performance. If the value is large this query has performance that scales linearly with the number of proxies and would be slower than a brute force search.
@return performance data
DynamicTree_RayCast ¶
DynamicTree_RayCast :: proc "c" ( #by_ptr tree: DynamicTree, #by_ptr input: RayCastInput, maskBits: u64, requireAllBits: bool, callback: TreeRayCastCallbackFcn, ctx: rawptr, ) -> TreeStats ---
Ray cast against the proxies in the tree. This relies on the callback to perform an exact ray cast in the case where the proxy contains a shape. The callback also performs any collision filtering. This has performance roughly equal to k * log(n), where k is the number of collisions and n is the number of proxies in the tree. Bit-wise filtering using mask bits can greatly improve performance in some scenarios.
However, this filtering may be approximate, so the user should still apply filtering to results.
@param tree the dynamic tree to ray cast
@param input the ray cast input data. The ray extends from p1 to p1 + maxFraction * (p2 - p1)
@param maskBits bit mask test: bool accept = (maskBits & node->categoryBits) != 0;
@param requireAllBits modifies bit mask test: bool accept = (maskBits & node->categoryBits) == maskBits;
@param callback a callback function that is called for each proxy that is hit by the ray
@param context user context that is passed to the callback
@return performance data
DynamicTree_Rebuild ¶
DynamicTree_Rebuild :: proc "c" (tree: ^DynamicTree, fullBuild: bool) -> i32 ---
Rebuild the tree while retaining subtrees that haven't changed. Returns the number of boxes sorted.
DynamicTree_Save ¶
DynamicTree_Save :: proc "c" (#by_ptr tree: DynamicTree, fileName: cstring) ---
Save this tree to a file for debugging
DynamicTree_SetCategoryBits ¶
DynamicTree_SetCategoryBits :: proc "c" (tree: ^DynamicTree, proxyId: i32, categoryBits: u64) ---
Modify the category bits on a proxy. This is an expensive operation.
DynamicTree_Validate ¶
DynamicTree_Validate :: proc "c" (#by_ptr tree: DynamicTree) ---
Validate this tree. For testing.
DynamicTree_ValidateNoEnlarged ¶
DynamicTree_ValidateNoEnlarged :: proc "c" (#by_ptr tree: DynamicTree) ---
Validate this tree has no enlarged AABBs. For testing.
GetAxisAngle ¶
GetAxisAngle :: proc "c" (q: quaternion128) -> (radians: f32, axis: [3]f32) {…}
Get the axis and angle from a quaternion. Assumes the quaternion is normalized.
GetCompoundCapsule ¶
GetCompoundCapsule :: proc "c" (#by_ptr compound: CompoundData, index: i32) -> CompoundCapsule ---
Access a child capsule by index.
GetCompoundChild ¶
GetCompoundChild :: proc "c" (#by_ptr compound: CompoundData, childIndex: i32) -> ChildShape ---
Get a child shape of a compound.
GetCompoundHull ¶
GetCompoundHull :: proc "c" (#by_ptr compound: CompoundData, index: i32) -> CompoundHull ---
Access a child hull by index.
GetCompoundMaterials ¶
GetCompoundMaterials :: proc "c" (#by_ptr compound: CompoundData) -> ^SurfaceMaterial ---
Access the compound material array.
GetCompoundMesh ¶
GetCompoundMesh :: proc "c" (#by_ptr compound: CompoundData, index: i32) -> CompoundMesh ---
Access a child mesh by index.
GetCompoundSphere ¶
GetCompoundSphere :: proc "c" (#by_ptr compound: CompoundData, index: i32) -> CompoundSphere ---
Access a child sphere by index.
GetGraphColor ¶
Get the visualization color assigned to a constraint graph color slot. The last index (B3_GRAPH_COLOR_COUNT - 1) is the overflow color.
GetHeight ¶
Get the height of the mesh BVH.
GetHeightFieldCompressedHeights ¶
GetHeightFieldCompressedHeights :: proc "c" (hf: ^HeightFieldData) -> [^]u16 {…}
Get read only compressed heights. One u16 per grid point.
GetHeightFieldFlags ¶
GetHeightFieldFlags :: proc "c" (hf: ^HeightFieldData) -> [^]u8 {…}
Get read only triangle flags. One u8 per triangle.
GetHeightFieldMaterialIndices ¶
GetHeightFieldMaterialIndices :: proc "c" (hf: ^HeightFieldData) -> [^]u8 {…}
Get read only material indices. One u8 per cell.
GetHullEdges ¶
Get read only hull half edges.
GetHullFaces ¶
Get read only hull faces.
GetHullPlanes ¶
Get read only hull planes.
GetHullPoints ¶
Get read only hull points.
GetHullVertices ¶
Get read only hull vertices.
GetLengthAndNormalize ¶
Normalize a vector and return the length. Returns a zero vector if the input is very small.
GetLengthUnitsPerMeter ¶
GetLengthUnitsPerMeter :: proc "c" () -> f32 ---
Get the current length units per meter.
GetMaxWorldCount ¶
GetMaxWorldCount :: proc "c" () -> i32 ---
Get the maximum number of simultaneous worlds that have been created
GetMeshFlags ¶
Get read only mesh flags. The count is equal to the triangle count.
GetMeshMaterialIndices ¶
Get read only mesh materials. The count is equal to the triangle count.
GetMeshNodes ¶
Get read only mesh BVH nodes.
GetMeshTriangles ¶
Get read only mesh triangles.
GetMeshVertices ¶
Get read only mesh vertices.
GetMilliseconds ¶
Get the milliseconds passed from an initial tick value.
GetMillisecondsAndReset ¶
Get the milliseconds passed from an initial tick value.
GetQuatAngle ¶
GetQuatAngle :: proc "c" (q: quaternion128) -> f32 {…}
Get the angle for a quaternion in radians
GetStallThreshold ¶
GetStallThreshold :: proc "c" () -> f32 ---
Get the threshold for logging stalls.
GetSweepTransform ¶
Evaluate the transform sweep at a specific time.
GetSwingAngle ¶
GetSwingAngle :: proc "c" (q: quaternion128) -> f32 {…}
Swing angle used for cone limit
GetTicks ¶
GetTicks :: proc "c" () -> u64 ---
Get the absolute number of system ticks. The value is platform specific.
GetTwistAngle ¶
GetTwistAngle :: proc "c" (q: quaternion128) -> f32 {…}
Twist angle around the z-axis, used for twist limit and revolute angle limit
HUGE ¶
HUGE :: proc "c" () -> f32 {…}
Used to detect bad values. In float mode positions greater than about 16km have precision problems, so 100km is a safe limit. Large world mode keeps coordinates accurate much farther from the origin, so the sanity limit widens to keep valid far-field positions from tripping it.
Hash ¶
Simple djb2 hash function for determinism testing
ID_EQUALS ¶
ID_EQUALS :: proc "c" (id1, id2: $T) -> bool {…}
/ Compare two ids for equality. Doesn't work for b3WorldId. Don't mix types.
IS_NON_NULL ¶
IS_NON_NULL :: proc "c" (id: $T) -> bool {…}
/ Macro to determine if any id is non-null.
InternalAssert ¶
Internal assertion handler. Allows for host intervention.
InvMulQuat ¶
InvMulQuat :: proc "c" (q1, q2: quaternion128) -> quaternion128 {…}
Compute a relative quaternion. inv(q1) * q2
InvMulTransforms ¶
Creates a transform that converts a local point in frame B to a local point in frame A. This is useful for transforming points between the local spaces of two frames that are in world space.
InvMulWorldTransforms ¶
InvMulWorldTransforms :: proc "c" (A, B: WorldTransform) -> (C: Transform) {…}
Relative transform of frame B in frame A. The narrow phase boundary.
InvRotateVector ¶
InvRotateVector :: proc "c" (q: quaternion128, v: [3]f32) -> [3]f32 {…}
Inverse rotate a vector.
InvTransformPoint ¶
Inverse transform a point.
InvTransformWorldPoint ¶
InvTransformWorldPoint :: proc "c" (t: WorldTransform, p: [3]f32) -> [3]f32 {…}
Transform a world position to a local point. One double subtraction, then float.
InvertMatrix ¶
General matrix inverse.
InvertTransform ¶
Get the inverse of a transform.
IsBoundedAABB ¶
Is this AABB reasonably close to the origin? See B3_HUGE.
IsDoublePrecision ¶
IsDoublePrecision :: proc "c" () -> bool ---
@return true if the library was built with BOX3D_DOUBLE_PRECISION (large world mode)
IsNormalized ¶
Is a vector normalized? In other words, does it have unit length?
IsNormalizedQuat ¶
IsNormalizedQuat :: proc "c" (q: quaternion128) -> bool {…}
Does the supplied quaternion have unit length?
IsValidAABB ¶
Is this a valid bounding box? Not Nan or infinity. Upper bound greater than or equal to lower bound.
IsValidFloat ¶
@return is this float valid (finite and not NaN).
IsValidMatrix3 ¶
Is this a valid matrix? Not NaN or infinity.
IsValidPlane ¶
Is this a valid plane? Normal is a unit vector. Not Nan or infinity.
IsValidPosition ¶
Is this a valid world position? Not NaN or infinity.
IsValidQuat ¶
IsValidQuat :: proc "c" (q: quaternion128) -> bool ---
Is this a valid quaternion? Not NaN or infinity. Is normalized.
IsValidRay ¶
IsValidRay :: proc "c" (#by_ptr input: RayCastInput) -> bool ---
Use this to ensure your ray cast input is valid and avoid internal assertions.
IsValidTransform ¶
Is this a valid transform? Not NaN or infinity. Is normalized.
IsValidVec3 ¶
Is this a valid vector? Not NaN or infinity.
IsValidWorldTransform ¶
IsValidWorldTransform :: proc "c" (t: WorldTransform) -> bool ---
Is this a valid world transform? Not NaN or infinity. Rotation is normalized.
Joint_GetAngularSeparation ¶
Get the current angular separation error for this joint. Does not consider admissible movement. Usually in radians.
Joint_GetBodyA ¶
Get body A id on a joint
Joint_GetBodyB ¶
Get body B id on a joint
Joint_GetCollideConnected ¶
Is collision allowed between connected bodies?
Joint_GetConstraintForce ¶
Get the current constraint force for this joint
Joint_GetConstraintTorque ¶
Get the current constraint torque for this joint
Joint_GetConstraintTuning ¶
Get the joint constraint tuning. Advanced feature.
Joint_GetForceThreshold ¶
Get the force threshold for joint events (Newtons)
Joint_GetLinearSeparation ¶
Get the current linear separation error for this joint. Does not consider admissible movement. Usually in meters.
Joint_GetLocalFrameA ¶
Get the local frame on bodyA
Joint_GetLocalFrameB ¶
Get the local frame on bodyB
Joint_GetTorqueThreshold ¶
Get the torque threshold for joint events (N-m)
Joint_GetType ¶
Get the joint type
Joint_GetUserData ¶
Joint_GetUserData :: proc "c" (jointId: JointId) ---
Get the user data on a joint
Joint_GetWorld ¶
Get the world that owns this joint
Joint_IsValid ¶
Joint identifier validation. Provides validation for up to 64K allocations.
Joint_SetCollideConnected ¶
Toggle collision between connected bodies
Joint_SetConstraintTuning ¶
Set the joint constraint tuning. Advanced feature. @param jointId the joint @param hertz the stiffness in Hertz (cycles per second) @param dampingRatio the non-dimensional damping ratio (one for critical damping)
Joint_SetForceThreshold ¶
Set the force threshold for joint events (Newtons)
Joint_SetLocalFrameA ¶
Set the local frame on bodyA
Joint_SetLocalFrameB ¶
Set the local frame on bodyB
Joint_SetTorqueThreshold ¶
Set the torque threshold for joint events (N-m)
Joint_SetUserData ¶
Set the user data on a joint
Joint_WakeBodies ¶
Joint_WakeBodies :: proc "c" (jointId: JointId) ---
Wake the bodies connect to this joint
LINEAR_SLOP ¶
LINEAR_SLOP :: proc "c" () -> f32 {…}
A small length used as a collision and constraint tolerance. Usually it is chosen to be numerically significant, but visually insignificant. In meters. @warning modifying this can have a significant impact on stability
LineDistance ¶
LineDistance :: proc "c" (p1, d1: [3]f32, p2, d2: [3]f32) -> SegmentDistanceResult ---
Compute the closest points on two infinite lines.
LoadContactId ¶
/ Load a contact id from three uint32 values.
LoadHeightField ¶
LoadHeightField :: proc "c" (fileName: cstring) -> ^HeightFieldData ---
Create a height field by loading a previously saved height data
LoadRecordingFromFile ¶
Load a recording from a file. Returns NULL on failure (file not found, wrong magic). The caller owns the returned recording and must destroy it with DestroyRecording. @param path file path to read
MAX_AABB_MARGIN ¶
MAX_AABB_MARGIN :: proc "c" () -> f32 {…}
This is used to fatten AABBs in the dynamic tree. This allows proxies to move by a small amount without triggering a tree adjustment. This is in meters. @warning modifying this can have a significant impact on performance
MESH_REST_OFFSET ¶
MESH_REST_OFFSET :: proc "c" () -> f32 {…}
The rest offset is used for mesh contact to reduce ghost collisions and assist with CCD. The rest offset adjusts the contact point separation value, making the solver push the shapes apart by this distance. Must be at least B3_LINEAR_SLOP and less than B3_SPECULATIVE_DISTANCE.
MIN_CAPSULE_LENGTH ¶
MIN_CAPSULE_LENGTH :: proc "c" () -> f32 {…}
MakeAABB ¶
Get the AABB of a point cloud.
MakeBoxHull ¶
Make a box as a hull. Do not call DestroyHull on this.
MakeCubeHull ¶
Make a cube as a hull. Do not call DestroyHull on this.
MakeDebugColor ¶
MakeDebugColor :: proc "c" (rgb: HexColor, material: DebugMaterial) -> u32 {…}
Pack an RGB color with a material preset for debug draw. The preset rides in the high byte where the color converters ignore it.
MakeMatrixFromQuat ¶
MakeMatrixFromQuat :: proc "c" (q: quaternion128) -> (out: matrix[3, 3]f32) {…}
Make a matrix from a quaternion. This is useful if you need to rotate many vectors. The force inline improves the performance of ShapeDistance.
MakeOffsetBoxHull ¶
Make an offset box as a hull. Do not call DestroyHull on this.
MakeQuatFromAxisAngle ¶
MakeQuatFromAxisAngle :: proc "c" (axis: [3]f32, radians: f32) -> quaternion128 {…}
Make a quaternion that is equivalent to rotating around an axis by a specified angle.
MakeQuatFromMatrix ¶
MakeQuatFromMatrix :: proc "c" (m: matrix[3, 3]f32) -> quaternion128 ---
Extract a quaternion from a rotation matrix.
MakeScaledBoxHull ¶
MakeScaledBoxHull :: proc "c" (halfWidths: [3]f32, transform: Transform, postScale: [3]f32) -> BoxHull ---
This makes a transformed box hull with post scaling. This is useful for boxes that are scaled in a level editor. Such scaling can have reflection and shear. In the case of shear the result may be approximate. If you need to support shear consider using CreateHull. Do not call DestroyHull on this. @param halfWidths positive half widths @param transform local transform of box @param postScale scale applied after the transform, may be negative
MakeTransformedBoxHull ¶
Make a transformed box as a hull. Do not call DestroyHull on this. @param hx, hy, hz positive half widths @param transform local transform of box
MakeWorldTransform ¶
MakeWorldTransform :: proc "c" (t: Transform) -> (w: WorldTransform) {…}
Promote a float transform to a world transform. Lossless.
MaxFloat ¶
max returns the maximum value of passed arguments of all the same type.
If one argument is passed and it is an enum or numeric type, then max returns the maximum value of the enum type's fields or its maximum numeric value respectively.
MaxInt ¶
max returns the maximum value of passed arguments of all the same type.
If one argument is passed and it is an enum or numeric type, then max returns the maximum value of the enum type's fields or its maximum numeric value respectively.
MinFloat ¶
min returns the minimum value of passed arguments of all the same type.
If one argument is passed and it is an enum or numeric type, then min returns the minimum value of the enum type's fields or its minimum / most negative numeric value respectively.
MinInt ¶
min returns the minimum value of passed arguments of all the same type.
If one argument is passed and it is an enum or numeric type, then min returns the minimum value of the enum type's fields or its minimum / most negative numeric value respectively.
MotorJoint_GetAngularDampingRatio ¶
Get the spring angular damping ratio.
MotorJoint_GetAngularHertz ¶
Get the spring angular hertz stiffness
MotorJoint_GetAngularVelocity ¶
Get the desired relative angular velocity in radians per second
MotorJoint_GetLinearDampingRatio ¶
Get the spring linear damping ratio.
MotorJoint_GetLinearHertz ¶
Get the spring linear hertz stiffness
MotorJoint_GetLinearVelocity ¶
Get the desired relative linear velocity in meters per second
MotorJoint_GetMaxSpringForce ¶
Get the maximum spring force in newtons.
MotorJoint_GetMaxSpringTorque ¶
Get the maximum spring torque in newtons * meters
MotorJoint_GetMaxVelocityForce ¶
Get the motor joint maximum force, usually in newtons
MotorJoint_GetMaxVelocityTorque ¶
Get the motor joint maximum torque, usually in newton-meters
MotorJoint_SetAngularDampingRatio ¶
Set the spring angular damping ratio. Use 1.0 for critical damping.
MotorJoint_SetAngularHertz ¶
Set the spring angular hertz stiffness
MotorJoint_SetAngularVelocity ¶
Set the desired relative angular velocity in radians per second
MotorJoint_SetLinearDampingRatio ¶
Set the spring linear damping ratio. Use 1.0 for critical damping.
MotorJoint_SetLinearHertz ¶
Set the spring linear hertz stiffness
MotorJoint_SetLinearVelocity ¶
Set the desired relative linear velocity in meters per second
MotorJoint_SetMaxSpringForce ¶
Set the maximum spring force in newtons.
MotorJoint_SetMaxSpringTorque ¶
Set the maximum spring torque in newtons * meters
MotorJoint_SetMaxVelocityForce ¶
Set the motor joint maximum force, usually in newtons
MotorJoint_SetMaxVelocityTorque ¶
Set the motor joint maximum torque, usually in newton-meters
MulQuat ¶
MulQuat :: proc "c" (q1, q2: quaternion128) -> quaternion128 {…}
Multiply two quaternions.
MulTransforms ¶
Multiply two transforms. If the result is applied to a point p local to frame B, the transform would first convert p to a point local to frame A, then into a point in the world frame. This is useful if frame B is a child of frame A.
MulWorldTransforms ¶
MulWorldTransforms :: proc "c" (A: WorldTransform, B: Transform) -> (C: WorldTransform) {…}
Compose a world transform with a local transform.
NLerp ¶
NLerp :: proc "c" (q1, q2: quaternion128, alpha: f32) -> quaternion128 {…}
Linearly interpolate and normalize between two quaternions
NegateQuat ¶
NegateQuat :: proc "c" (q: quaternion128) -> quaternion128 {…}
Component-wise quaternion negation.
Normalize ¶
Normalize a vector. Returns a zero vector if the input vector is very small.
NormalizeQuat ¶
NormalizeQuat :: proc "c" (q: quaternion128) -> quaternion128 {…}
Normalize a quaternion.
OVERLAP_SLOP ¶
OVERLAP_SLOP :: proc "c" () -> f32 {…}
The distance between shapes where they are considered overlapped. This is needed because GJK may return small positive values for overlapped shapes in degenerate configurations.
OffsetAABB ¶
Translate a local AABB by a world origin, rounding outward so the float box always contains the double box. Far from the origin a plain conversion could clip a shape out of its own box. In float mode the origin is float and the rounding is a no-op.
OverlapCapsule ¶
OverlapCapsule :: proc "c" (#by_ptr shape: Capsule, shapeTransform: Transform, #by_ptr proxy: ShapeProxy) -> bool ---
Overlap shape versus capsule
OverlapCompound ¶
OverlapCompound :: proc "c" (#by_ptr shape: CompoundData, shapeTransform: Transform, #by_ptr proxy: ShapeProxy) -> bool ---
Overlap shape versus compound
OverlapHeightField ¶
OverlapHeightField :: proc "c" (#by_ptr shape: HeightFieldData, shapeTransform: Transform, #by_ptr proxy: ShapeProxy) -> bool ---
Overlap shape versus height field
OverlapHull ¶
OverlapHull :: proc "c" (#by_ptr shape: HullData, shapeTransform: Transform, #by_ptr proxy: ShapeProxy) -> bool ---
Overlap shape versus hull
OverlapMesh ¶
OverlapMesh :: proc "c" (#by_ptr shape: Mesh, shapeTransform: Transform, #by_ptr proxy: ShapeProxy) -> bool ---
Overlap shape versus mesh
OverlapSphere ¶
OverlapSphere :: proc "c" (#by_ptr shape: Sphere, shapeTransform: Transform, #by_ptr proxy: ShapeProxy) -> bool ---
Overlap shape versus sphere
ParallelJoint_GetMaxTorque ¶
Get the maximum spring torque, usually in newton-meters
ParallelJoint_GetSpringDampingRatio ¶
Get the spring damping ratio
ParallelJoint_GetSpringHertz ¶
Get the spring Hertz
ParallelJoint_SetMaxTorque ¶
Set the maximum spring torque, usually in newton-meters
ParallelJoint_SetSpringDampingRatio ¶
Set the spring damping ratio, non-dimensional
ParallelJoint_SetSpringHertz ¶
Set the spring stiffness in Hertz
Perp ¶
Get a unit vector that is perpendicular to the supplied vector.
PointToSegmentDistance ¶
Compute the closest point on the segment a-b to the target q.
PrismaticJoint_EnableLimit ¶
Enable/disable a prismatic joint limit
PrismaticJoint_EnableMotor ¶
Enable/disable a prismatic joint motor
PrismaticJoint_EnableSpring ¶
Enable/disable the joint spring.
PrismaticJoint_GetLowerLimit ¶
Get the prismatic joint lower limit
PrismaticJoint_GetMaxMotorForce ¶
Get the prismatic joint maximum motor force, usually in newtons
PrismaticJoint_GetMotorForce ¶
Get the prismatic joint current motor force, usually in newtons
PrismaticJoint_GetMotorSpeed ¶
Get the prismatic joint motor speed, usually in meters per second
PrismaticJoint_GetSpeed ¶
Get the current joint translation speed, usually in meters per second.
PrismaticJoint_GetSpringDampingRatio ¶
Get the prismatic spring damping ratio (non-dimensional)
PrismaticJoint_GetSpringHertz ¶
Get the prismatic joint stiffness in Hertz
PrismaticJoint_GetTargetTranslation ¶
Get the prismatic joint target translation. Usually in meters.
PrismaticJoint_GetTranslation ¶
Get the current joint translation, usually in meters.
PrismaticJoint_GetUpperLimit ¶
Get the prismatic joint upper limit
PrismaticJoint_IsLimitEnabled ¶
Is the prismatic joint limit enabled?
PrismaticJoint_IsMotorEnabled ¶
Is the prismatic joint motor enabled?
PrismaticJoint_IsSpringEnabled ¶
Is the prismatic joint spring enabled or not?
PrismaticJoint_SetLimits ¶
Set the prismatic joint limits
PrismaticJoint_SetMaxMotorForce ¶
Set the prismatic joint maximum motor force, usually in newtons
PrismaticJoint_SetMotorSpeed ¶
Set the prismatic joint motor speed, usually in meters per second
PrismaticJoint_SetSpringDampingRatio ¶
Set the prismatic joint damping ratio (non-dimensional)
PrismaticJoint_SetSpringHertz ¶
Set the prismatic joint stiffness in Hertz. This should usually be less than a quarter of the simulation rate. For example, if the simulation runs at 60Hz then the joint stiffness should be 15Hz or less.
PrismaticJoint_SetTargetTranslation ¶
Set the prismatic joint target translation. Usually in meters.
QueryCompound ¶
QueryCompound :: proc "c" (#by_ptr compound: CompoundData, aabb: AABB, fcn: CompoundQueryFcn, ctx: rawptr) ---
Query a compound shape for children that overlap an AABB.
QueryHeightField ¶
QueryHeightField :: proc "c" (#by_ptr heightField: HeightFieldData, bounds: AABB, fcn: MeshQueryFcn, ctx: rawptr) ---
Query a height field for triangles overlapping a bounding box in local space. May have false positives. Useful for debug draw. @param heightField the height field to query @param bounds the bounding box in local space @param fcn a user function to collect triangles @param context the context sent to the user function.
QueryMesh ¶
QueryMesh :: proc "c" (#by_ptr mesh: Mesh, bounds: AABB, fcn: MeshQueryFcn, ctx: rawptr) ---
Query a mesh for triangles overlapping a bounding box in local space. May have false positives. Useful for debug draw. @param mesh the mesh to query, includes scale @param bounds the bounding box in local space @param fcn a user function to collect triangles @param context the context sent to the user function.
RayCastCapsule ¶
RayCastCapsule :: proc "c" (#by_ptr shape: Capsule, #by_ptr input: RayCastInput) -> CastOutput ---
Ray cast versus capsule in local space. A zero length ray is a point query. Initial overlap reports a hit at the ray origin with zero fraction and zero normal.
RayCastCompound ¶
RayCastCompound :: proc "c" (#by_ptr shape: CompoundData, #by_ptr input: RayCastInput) -> CastOutput ---
Ray cast versus compound in local space. A zero length ray is a point query. Initial overlap with a child reports a hit at the ray origin with zero fraction and zero normal.
RayCastHeightField ¶
RayCastHeightField :: proc "c" (#by_ptr shape: HeightFieldData, #by_ptr input: RayCastInput) -> CastOutput ---
Ray cast versus height field in local space. A thin surface with no interior, so there is no overlap case.
RayCastHollowSphere ¶
RayCastHollowSphere :: proc "c" (#by_ptr shape: Sphere, #by_ptr input: RayCastInput) -> CastOutput ---
Ray cast versus a hollow sphere shell in local space. Unlike the solid sphere a ray starting inside is not an overlap: it passes through and hits the far wall.
RayCastHull ¶
RayCastHull :: proc "c" (#by_ptr shape: HullData, #by_ptr input: RayCastInput) -> CastOutput ---
Ray cast versus hull shape in local space. A zero length ray is a point query. Initial overlap reports a hit at the ray origin with zero fraction and zero normal.
RayCastMesh ¶
RayCastMesh :: proc "c" (#by_ptr shape: Mesh, #by_ptr input: RayCastInput) -> CastOutput ---
Ray cast versus mesh in local space. A thin surface with no interior, so there is no overlap case.
RayCastSphere ¶
RayCastSphere :: proc "c" (#by_ptr shape: Sphere, #by_ptr input: RayCastInput) -> CastOutput ---
Ray cast versus sphere in local space. A zero length ray is a point query. Initial overlap reports a hit at the ray origin with zero fraction and zero normal.
RecPlayer_Create ¶
Create a player over a recording. Owns a private copy of the bytes. @param data pointer to recording bytes @param size byte count of the recording @param workerCount worker count for the replay world; pass 1 to match a serial recording. Replaying at a different count re-partitions the constraint graph, so the StateHash check becomes a cross-thread determinism test. Adjustable later with RecPlayer_SetWorkerCount. @return a new player, or NULL on bad header or deserialization failure
RecPlayer_Destroy ¶
RecPlayer_Destroy :: proc "c" (player: ^RecPlayer) ---
Destroy the player and free all memory. Restores the previous global length scale.
RecPlayer_DrawFrameQueries ¶
RecPlayer_DrawFrameQueries :: proc "c" (player: ^RecPlayer, draw: ^DebugDraw, queryIndex: i32, selectedIndex: i32) ---
Draw the spatial queries recorded during the most recently replayed frame, layered on top of the world. Call after World_Draw. NULL draw function pointers are skipped. @param player a valid player handle @param draw debug draw callbacks @param queryIndex index of the frame query to draw, or -1 to draw all of them @param selectedIndex index of the query to emphasize (reserved color plus a label), or -1 for none
RecPlayer_GetBodyCount ¶
@return the number of bodies tracked in creation order (including holes for destroyed bodies)
RecPlayer_GetBodyId ¶
Resolve a creation ordinal to the live body id at the current frame. @return the body id, or a null id if that ordinal is out of range or its body is destroyed
RecPlayer_GetDivergeFrame ¶
@return the first frame at which replay diverged, or -1 if it has not diverged
RecPlayer_GetFrame ¶
@return the last fully-stepped frame index (0 before any step)
RecPlayer_GetFrameCount ¶
@return total number of recorded frames
RecPlayer_GetFrameQuery ¶
RecPlayer_GetFrameQuery :: proc "c" (#by_ptr player: RecPlayer, index: i32) -> RecQueryInfo ---
Get a recorded query from the most recently replayed frame by index.
RecPlayer_GetFrameQueryCount ¶
@return the number of spatial queries recorded for the most recently replayed frame
RecPlayer_GetFrameQueryHit ¶
RecPlayer_GetFrameQueryHit :: proc "c" (#by_ptr player: RecPlayer, queryIndex: i32, hitIndex: i32) -> RecQueryHit ---
Get one result of a recorded query from the most recently replayed frame.
RecPlayer_GetInfo ¶
RecPlayer_GetInfo :: proc "c" (#by_ptr player: RecPlayer) -> RecPlayerInfo ---
@return a summary of the recording read at open: frame count, recorded tuning, and bounds
RecPlayer_GetKeyframeBudget ¶
@return the keyframe memory budget in bytes
RecPlayer_GetKeyframeBytes ¶
@return the memory currently held by keyframe snapshots, in bytes
RecPlayer_GetKeyframeInterval ¶
@return the current keyframe spacing in frames; starts at the min interval and doubles as the ring evicts to stay under budget, so it reflects the effective backward-seek granularity now
RecPlayer_GetKeyframeMinInterval ¶
@return the finest keyframe spacing in frames
RecPlayer_GetWorldId ¶
@return the world currently driven by this player
RecPlayer_HasDiverged ¶
@return true when any StateHash mismatch has been detected
RecPlayer_IsAtEnd ¶
@return true when the op stream is exhausted
RecPlayer_Restart ¶
RecPlayer_Restart :: proc "c" (player: ^RecPlayer) ---
Rewind to frame 0 (in-place restore so the world id stays stable).
RecPlayer_SeekFrame ¶
Seek to a specific frame. Forward seek steps op-by-op; backward seek restores the nearest keyframe then re-steps the remaining gap.
RecPlayer_SetDebugShapeCallbacks ¶
RecPlayer_SetDebugShapeCallbacks :: proc "c" (player: ^RecPlayer, createDebugShape: CreateDebugShapeCallback, destroyDebugShape: DestroyDebugShapeCallback, ctx: rawptr) ---
Wire host debug-shape callbacks into the player's replay world so a renderer can build per-shape draw resources (the 3D sample needs this or the replay world draws nothing). Rebuilds the current world under the new callbacks and rewinds to frame 0, so call it once right after RecPlayer_Create and re-read the world id afterward. The callbacks persist across Restart and backward seeks, which recreate the world internally. @param player the player to configure @param createDebugShape called when a replayed shape is added; returns a user draw handle @param destroyDebugShape called when a replayed shape is removed; may be NULL @param context user context passed to both callbacks
RecPlayer_SetKeyframePolicy ¶
RecPlayer_SetKeyframePolicy :: proc "c" (player: ^RecPlayer, budgetBytes: uint, minIntervalFrames: i32) ---
Tune the keyframe ring used to speed up backward seeking. A keyframe is a periodic snapshot the player restores from instead of replaying from the start, trading memory for seek speed. @param player the recording player @param budgetBytes memory cap for the kept snapshots; the spacing widens to stay under it @param minIntervalFrames finest spacing between keyframes, in frames A zero budget or a non-positive interval keeps that value. Clears the existing ring, so call RecPlayer_Restart afterward to repopulate it under the new policy.
RecPlayer_SetWorkerCount ¶
Set the worker count of the replay world. Clamped to [1, B3_MAX_WORKERS]. Applied to the live world at once and reused whenever the player rebuilds its world on Restart or a backward seek. Replaying at a different count than recorded re-partitions the constraint graph, so the StateHash check becomes a cross-thread determinism test.
RecPlayer_StepFrame ¶
Advance one frame: dispatch ops until the next Step completes. @return true when a frame was stepped, false at end-of-recording
Recording_GetData ¶
Get a pointer to the raw recording bytes. Valid until the recording buffer is modified or destroyed. @param recording the recording handle @return pointer to the byte buffer, or NULL if no bytes have been written
Recording_GetSize ¶
Get the number of bytes currently in the recording buffer. @param recording the recording handle
RevoluteJoint_EnableLimit ¶
Enable/disable the revolute joint limit
RevoluteJoint_EnableMotor ¶
Enable/disable a revolute joint motor
RevoluteJoint_EnableSpring ¶
Enable/disable the revolute joint spring
RevoluteJoint_GetAngle ¶
Get the revolute joint current angle in radians relative to the reference angle @see RevoluteJointDef::referenceAngle
RevoluteJoint_GetLowerLimit ¶
Get the revolute joint lower limit in radians
RevoluteJoint_GetMaxMotorTorque ¶
Get the revolute joint maximum motor torque, usually in newton-meters
RevoluteJoint_GetMotorSpeed ¶
Get the revolute joint motor speed in radians per second
RevoluteJoint_GetMotorTorque ¶
Get the revolute joint current motor torque, usually in newton-meters
RevoluteJoint_GetSpringDampingRatio ¶
Get the revolute joint spring damping ratio, non-dimensional
RevoluteJoint_GetSpringHertz ¶
Get the revolute joint spring stiffness in Hertz
RevoluteJoint_GetTargetAngle ¶
Get the revolute joint target angle in radians
RevoluteJoint_GetUpperLimit ¶
Get the revolute joint upper limit in radians
RevoluteJoint_IsLimitEnabled ¶
Is the revolute joint limit enabled?
RevoluteJoint_IsMotorEnabled ¶
Is the revolute joint motor enabled?
RevoluteJoint_IsSpringEnabled ¶
Is the revolute angular spring enabled?
RevoluteJoint_SetLimits ¶
RevoluteJoint_SetLimits :: proc "c" (jointId: JointId, lowerLimitRadians, upperLimitRadians: f32) ---
Set the revolute joint limits in radians
RevoluteJoint_SetMaxMotorTorque ¶
Set the revolute joint maximum motor torque, usually in newton-meters
RevoluteJoint_SetMotorSpeed ¶
Set the revolute joint motor speed in radians per second
RevoluteJoint_SetSpringDampingRatio ¶
Set the revolute joint spring damping ratio, non-dimensional
RevoluteJoint_SetSpringHertz ¶
Set the revolute joint spring stiffness in Hertz
RevoluteJoint_SetTargetAngle ¶
Set the revolute joint target angle in radians
RotateVector ¶
RotateVector :: proc "c" (q: quaternion128, v: [3]f32) -> [3]f32 {…}
Rotate a vector.
RoundDownFloat ¶
Narrow a world coordinate to float, rounding toward negative infinity. Use with RoundUpFloat to build a conservative float box that always contains the double bounds, where plain rounding far from the origin could clip. nextafterf is an exact IEEE operation, so this is cross-platform deterministic. With large world mode off this is a plain conversion.
RoundUpFloat ¶
Narrow a world coordinate to float, rounding toward positive infinity.
SPECULATIVE_DISTANCE ¶
SPECULATIVE_DISTANCE :: proc "c" () -> f32 {…}
@warning modifying this can have a significant impact on performance and stability
SafeScale ¶
Create a safe scaling value for scaling collision. This allows negative scale, but keeps scale sufficiently far from zero.
SaveRecordingToFile ¶
Save the recording buffer to a file. Returns true on success. @param recording the recording to save @param path file path to write
ScaleBox ¶
ScaleBox :: proc "c" (halfWidths: ^[3]f32, transform: ^Transform, postScale: [3]f32, minHalfWidth: f32) ---
This takes a box with a transform and post scale and converts it into a box with the post scale resolved with new half-widths and transform. This accepts non-uniform and negative scale. This is approximate if there is shear. @param halfWidths [in/out] the box half widths @param transform [in/out] the box transform with rotation and translation @param postScale the post scale being applied to the box after the transform @param minHalfWidth the minimum half width after scale is applied
SegmentDistance ¶
SegmentDistance :: proc "c" (p1, q1: [3]f32, p2, q2: [3]f32) -> SegmentDistanceResult ---
Compute the closest points on two line segments.
SetAllocator ¶
This allows the user to override the allocation functions. These should be
set during application startup.
SetAssertFcn ¶
SetAssertFcn :: proc "c" (assertFcn: AssertFcn) ---
Override the default assert callback.
@param assertFcn a non-null assert callback
SetLengthUnitsPerMeter ¶
SetLengthUnitsPerMeter :: proc "c" (lengthUnits: f32) ---
Box3D bases all length units on meters, but you may need different units for your game. You can set this value to use different units. This should be done at application startup and only modified once. Default value is 1. @warning This must be modified before any calls to Box3D
SetStallThreshold ¶
SetStallThreshold :: proc "c" (seconds: f32) ---
Set the threshold for logging stalls.
ShapeCast ¶
ShapeCast :: proc "c" (#by_ptr input: ShapeCastPairInput) -> CastOutput ---
Perform a linear shape cast of shape B moving and shape A fixed. Determines the hit point, normal, and translation fraction. The query runs in frame A, so the hit point and normal are returned in frame A. Initially touching shapes are a miss.
ShapeCastCapsule ¶
ShapeCastCapsule :: proc "c" (#by_ptr shape: Capsule, #by_ptr input: ShapeCastInput) -> CastOutput ---
Shape cast versus a capsule. Initial overlap is treated as a miss.
ShapeCastCompound ¶
ShapeCastCompound :: proc "c" (#by_ptr shape: CompoundData, #by_ptr input: ShapeCastInput) -> CastOutput ---
Shape cast versus compound. Initial overlap is treated as a miss.
ShapeCastHeightField ¶
ShapeCastHeightField :: proc "c" (#by_ptr shape: HeightFieldData, #by_ptr input: ShapeCastInput) -> CastOutput ---
Shape cast versus a height field. Initial overlap is treated as a miss.
ShapeCastHull ¶
ShapeCastHull :: proc "c" (#by_ptr shape: HullData, #by_ptr input: ShapeCastInput) -> CastOutput ---
Shape cast versus a hull. Initial overlap is treated as a miss.
ShapeCastMesh ¶
ShapeCastMesh :: proc "c" (#by_ptr shape: Mesh, #by_ptr input: ShapeCastInput) -> CastOutput ---
Shape cast versus a mesh. Initial overlap is treated as a miss.
ShapeCastSphere ¶
ShapeCastSphere :: proc "c" (#by_ptr shape: Sphere, #by_ptr input: ShapeCastInput) -> CastOutput ---
Shape cast versus a sphere. Initial overlap is treated as a miss.
ShapeDistance ¶
ShapeDistance :: proc "c" (#by_ptr input: DistanceInput, cache: ^SimplexCache, simplexes: [^]Simplex, simplexCapacity: i32) -> DistanceOutput ---
Compute the closest points between two shapes represented as point clouds. SimplexCache cache is input/output. On the first call set SimplexCache.count to zero. The query runs in frame A, so the witness points and normal are returned in frame A. The underlying GJK algorithm may be debugged by passing in debug simplexes and capacity. You may pass in NULL and 0 for these.
Shape_ApplyWind ¶
Shape_ApplyWind :: proc "c" ( shapeId: ShapeId, wind: [3]f32, drag, lift: f32, maxSpeed: f32, wake: bool, ) ---
Apply a wind force to the body for this shape using the density of air. This considers the projected area of the shape in the wind direction. This also considers the relative velocity of the shape. @param shapeId the shape id @param wind the wind velocity in world space @param drag the drag coefficient, the force that opposes the relative velocity @param lift the lift coefficient, the force that is perpendicular to the relative velocity @param maxSpeed the maximum relative speed. Speed cap is necessary for stability. Typically 10m/s or less. @param wake should this wake the body
Shape_AreContactEventsEnabled ¶
Returns true if contact events are enabled
Shape_AreHitEventsEnabled ¶
Returns true if hit events are enabled
Shape_ArePreSolveEventsEnabled ¶
Returns true if pre-solve events are enabled
Shape_AreSensorEventsEnabled ¶
Returns true if sensor events are enabled
Shape_ComputeMassData ¶
Compute the mass data for a shape
Shape_EnableContactEvents ¶
Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. @see ShapeDef::enableContactEvents
Shape_EnableHitEvents ¶
Enable contact hit events for this shape. Ignored for sensors. @see WorldDef.hitEventThreshold
Shape_EnablePreSolveEvents ¶
Enable pre-solve contact events for this shape. Only applies to dynamic bodies. These are expensive and must be carefully handled due to multithreading. Ignored for sensors. @see PreSolveFcn
Shape_EnableSensorEvents ¶
Enable sensor events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. @see ShapeDef::isSensor
Shape_GetAABB ¶
Get the current world AABB
Shape_GetBody ¶
Get the id of the body that a shape is attached to
Shape_GetCapsule ¶
Get a copy of the shape's capsule. Asserts the type is correct.
Shape_GetClosestPoint ¶
Get the closest point on a shape to a target point. Target and result are in world space.
Shape_GetContactCapacity ¶
Get the maximum capacity required for retrieving all the touching contacts on a shape
Shape_GetContactData ¶
Shape_GetContactData :: proc "c" (shapeId: ShapeId, contactData: [^]ContactData, capacity: i32) -> i32 ---
Get the touching contact data for a shape. The provided shapeId will be either shapeIdA or shapeIdB on the contact data. @note Box3D uses speculative collision so some contact points may be separated. @returns the number of elements filled in the provided array @warning do not ignore the return value, it specifies the valid number of elements
Shape_GetDensity ¶
Get the density of a shape, usually in kg/m^3
Shape_GetFilter ¶
Get the shape filter
Shape_GetFriction ¶
Get the friction of a shape
Shape_GetHeightField ¶
Shape_GetHeightField :: proc "c" (shapeId: ShapeId) -> ^HeightFieldData ---
Get the shape's height field. Asserts the type is correct.
Shape_GetHull ¶
Get the shape's convex hull. Asserts the type is correct.
Shape_GetMesh ¶
Get the shape's mesh. Asserts the type is correct.
Shape_GetMeshMaterialCount ¶
Get the number of mesh surface materials.
Shape_GetMeshSurfaceMaterial ¶
Shape_GetMeshSurfaceMaterial :: proc "c" (shapeId: ShapeId, index: i32) -> SurfaceMaterial ---
Get a surface material for a mesh shape
Shape_GetRestitution ¶
Get the shape restitution
Shape_GetSensorCapacity ¶
Get the maximum capacity required for retrieving all the overlapped shapes on a sensor shape. This returns 0 if the provided shape is not a sensor. @param shapeId the id of a sensor shape @returns the required capacity to get all the overlaps in Shape_GetSensorOverlaps
Shape_GetSensorData ¶
Shape_GetSensorData :: proc "c" (shapeId: ShapeId, visitorIds: [^]ShapeId, capacity: i32) -> i32 ---
Get the overlap data for a sensor shape. @param shapeId the id of a sensor shape @param visitorIds a user allocated array that is filled with the overlapping shapes (visitors) @param capacity the capacity of overlappedShapes @returns the number of elements filled in the provided array @warning do not ignore the return value, it specifies the valid number of elements @warning overlaps may contain destroyed shapes so use Shape_IsValid to confirm each overlap
Shape_GetSphere ¶
Get a copy of the shape's sphere. Asserts the type is correct.
Shape_GetSurfaceMaterial ¶
Shape_GetSurfaceMaterial :: proc "c" (shapeId: ShapeId) -> SurfaceMaterial ---
Get the base shape surface material.
Shape_GetType ¶
Get the type of a shape
Shape_GetUserData ¶
Shape_GetUserData :: proc "c" (shapeId: ShapeId) ---
Get the user data for a shape. This is useful when you get a shape id from an event or query.
Shape_GetWorld ¶
Get the world that owns this shape
Shape_IsSensor ¶
Returns true if the shape is a sensor
Shape_IsValid ¶
Shape identifier validation. Provides validation for up to 64K allocations.
Shape_RayCast ¶
Shape_RayCast :: proc "c" (shapeId: ShapeId, origin: [3]f32, translation: [3]f32) -> WorldCastOutput ---
Ray cast a shape directly. The ray runs from origin to origin + translation and the hit point comes back as a world position, so the cast stays precise far from the world origin.
Shape_SetCapsule ¶
Allows you to change a shape to be a capsule or update the current capsule. This does not modify the mass properties. @see Body_ApplyMassFromShapes
Shape_SetDensity ¶
Set the mass density of a shape, usually in kg/m^3. This will optionally update the mass properties on the parent body. @see ShapeDef::density, Body_ApplyMassFromShapes
Shape_SetFilter ¶
Set the current filter. This is almost as expensive as recreating the shape. @see ShapeDef::filter @param shapeId the shape @param filter the new filter @param invokeContacts if true then the shape will have all contacts recomputed the next time step (expensive)
Shape_SetFriction ¶
Set the friction on a shape
Shape_SetHull ¶
Allows you to change a shape to be a hull or update the current hull. This does not modify the mass properties. @see Body_ApplyMassFromShapes
Shape_SetMesh ¶
Allows you to change a shape to be a mesh or update the current mesh. This does not modify the mass properties. @see Body_ApplyMassFromShapes
Shape_SetMeshMaterial ¶
Shape_SetMeshMaterial :: proc "c" (shapeId: ShapeId, surfaceMaterial: SurfaceMaterial, index: i32) ---
Set a surface material for a mesh shape.
Shape_SetRestitution ¶
Set the shape restitution (bounciness)
Shape_SetSphere ¶
Allows you to change a shape to be a sphere or update the current sphere. This does not modify the mass properties. @see Body_ApplyMassFromShapes
Shape_SetSurfaceMaterial ¶
Shape_SetSurfaceMaterial :: proc "c" (shapeId: ShapeId, surfaceMaterial: SurfaceMaterial) ---
Set the shape base surface material. Does not change per triangle materials.
Shape_SetUserData ¶
Set the user data for a shape
Sleep ¶
Sleep :: proc "c" (milliseconds: i32) ---
Sleep the current thread for a number of milliseconds.
Solve3 ¶
Solve a matrix equation. @return inv(m) * a
SolvePlanes ¶
SolvePlanes :: proc "c" (targetDelta: [3]f32, planes: [^]CollisionPlane, count: i32) -> PlaneSolverResult ---
Solves the position of a mover that satisfies the given collision planes. @param targetDelta the desired translation from the position used to generate the collision planes @param planes the collision planes @param count the number of collision planes
SphericalJoint_EnableConeLimit ¶
Enable/disable the spherical joint cone limit
SphericalJoint_EnableMotor ¶
Enable/disable a spherical joint motor
SphericalJoint_EnableSpring ¶
Enable/disable the spherical joint spring
SphericalJoint_EnableTwistLimit ¶
Enable/disable the spherical joint limit
SphericalJoint_GetConeAngle ¶
Get the spherical joint current cone angle in radians.
SphericalJoint_GetConeLimit ¶
Get the spherical joint cone limit in radians
SphericalJoint_GetLowerTwistLimit ¶
Get the spherical joint lower limit in radians
SphericalJoint_GetMaxMotorTorque ¶
Get the spherical joint maximum motor torque, usually in newton-meters
SphericalJoint_GetMotorTorque ¶
Get the spherical joint current motor torque, usually in newton-meters
SphericalJoint_GetMotorVelocity ¶
Get the spherical joint motor velocity in radians per second
SphericalJoint_GetSpringDampingRatio ¶
Get the spherical joint spring damping ratio, non-dimensional
SphericalJoint_GetSpringHertz ¶
Get the spherical joint spring stiffness in Hertz
SphericalJoint_GetTargetRotation ¶
SphericalJoint_GetTargetRotation :: proc "c" (jointId: JointId) -> quaternion128 ---
Get the spherical joint spring target rotation
SphericalJoint_GetTwistAngle ¶
Get the spherical joint current twist angle in radians.
SphericalJoint_GetUpperTwistLimit ¶
Get the spherical joint upper limit in radians
SphericalJoint_IsConeLimitEnabled ¶
Is the spherical joint cone limit enabled?
SphericalJoint_IsMotorEnabled ¶
Is the spherical joint motor enabled?
SphericalJoint_IsSpringEnabled ¶
Is the spherical angular spring enabled?
SphericalJoint_IsTwistLimitEnabled ¶
Is the spherical joint limit enabled?
SphericalJoint_SetConeLimit ¶
Set the spherical joint limits in radians
SphericalJoint_SetMaxMotorTorque ¶
Set the spherical joint maximum motor torque, usually in newton-meters
SphericalJoint_SetMotorVelocity ¶
Set the spherical joint motor velocity in radians per second
SphericalJoint_SetSpringDampingRatio ¶
Set the spherical joint spring damping ratio, non-dimensional
SphericalJoint_SetSpringHertz ¶
Set the spherical joint spring stiffness in Hertz
SphericalJoint_SetTargetRotation ¶
SphericalJoint_SetTargetRotation :: proc "c" (jointId: JointId, targetRotation: quaternion128) ---
Set the spherical joint spring target rotation
SphericalJoint_SetTwistLimits ¶
SphericalJoint_SetTwistLimits :: proc "c" (jointId: JointId, lowerLimitRadians, upperLimitRadians: f32) ---
Set the spherical joint limits in radians
Steiner ¶
Get the inertia tensor of an offset point. https://en.wikipedia.org/wiki/Parallel_axis_theorem
StoreContactId ¶
/ Store a contact id into three uint32 values
StoreJointId ¶
/ Store a joint id into a u64.
StoreShapeId ¶
/ Store a shape id into a u64.
StoreWorldId ¶
/ Store a world id into a u32.
TimeOfImpact ¶
Compute the upper bound on time before two shapes penetrate. Time is represented as a fraction between [0,tMax]. This uses a swept separating axis and may miss some intermediate, non-tunneling collisions. If you change the time interval, you should call this function again.
ToRelativeTransform ¶
ToRelativeTransform :: proc "c" (t: WorldTransform, base: [3]f32) -> (r: Transform) {…}
Shift a world transform into the frame of a base position.
ToVec3 ¶
Lossy conversion of a world position to a float vector.
TransformPoint ¶
Transform a point.
TransformWorldPoint ¶
TransformWorldPoint :: proc "c" (t: WorldTransform, p: [3]f32) -> [3]f32 {…}
Transform a local point to a world position. Rotation in float, translation in double.
Transpose ¶
Transpose :: intrinsics.transpose
Transpose :: proc(m: $M/matrix[$R, $C]$E) -> matrix[C, R]E {…}
Matrix transpose.
UnwindAngle ¶
Convert any angle into the range [-pi, pi].
VALIDATE ¶
VALIDATE :: proc "c" (condition: bool, message: string = #caller_expression(condition), loc := #caller_location) {…}
ValidateReplay ¶
Replay a recording from memory and verify it reproduces the same world-state hashes. Stands up a fresh world, restores the seed snapshot, replays every op, and checks each embedded StateHash record. Returns true if replay completed without id mismatches or hash divergences. @param data pointer to recording bytes @param size byte count of the recording @param workerCount reserved for future multithreaded replay; pass 1 for now
WeldJoint_GetAngularDampingRatio ¶
Get the weld joint angular damping ratio, non-dimensional
WeldJoint_GetAngularHertz ¶
Get the weld joint angular stiffness in Hertz
WeldJoint_GetLinearDampingRatio ¶
Get the weld joint linear damping ratio (non-dimensional)
WeldJoint_GetLinearHertz ¶
Get the weld joint linear stiffness in Hertz
WeldJoint_SetAngularDampingRatio ¶
Set weld joint angular damping ratio, non-dimensional
WeldJoint_SetAngularHertz ¶
Set the weld joint angular stiffness in Hertz. 0 is rigid.
WeldJoint_SetLinearDampingRatio ¶
Set the weld joint linear damping ratio (non-dimensional)
WeldJoint_SetLinearHertz ¶
Set the weld joint linear stiffness in Hertz. 0 is rigid.
WheelJoint_EnableSpinMotor ¶
Enable/disable the wheel joint motor.
WheelJoint_EnableSteering ¶
Enable/disable wheel steering. Steering allows the wheel to rotate about the suspension axis.
WheelJoint_EnableSteeringLimit ¶
Enable/disable the wheel joint steering limit.
WheelJoint_EnableSuspension ¶
Enable/disable the wheel joint spring.
WheelJoint_EnableSuspensionLimit ¶
Enable/disable the wheel joint limit.
WheelJoint_GetLowerSteeringLimit ¶
Get the wheel joint lower steering limit in radians.
WheelJoint_GetLowerSuspensionLimit ¶
Get the wheel joint lower limit.
WheelJoint_GetMaxSpinTorque ¶
Get the wheel joint maximum motor torque, usually in newton-meters.
WheelJoint_GetMaxSteeringTorque ¶
Get the wheel joint maximum steering torque in N*m.
WheelJoint_GetSpinMotorSpeed ¶
Get the wheel joint motor speed in radians per second.
WheelJoint_GetSpinSpeed ¶
Get the current spin speed in radians per second.
WheelJoint_GetSpinTorque ¶
Get the wheel joint current motor torque, usually in newton-meters.
WheelJoint_GetSteeringAngle ¶
Get the current steering angle in radians.
WheelJoint_GetSteeringDampingRatio ¶
Get the wheel joint steering damping ratio, non-dimensional.
WheelJoint_GetSteeringHertz ¶
Get the wheel joint steering stiffness in Hertz.
WheelJoint_GetSteeringTorque ¶
Get the current steering torque in N*m.
WheelJoint_GetSuspensionDampingRatio ¶
Get the wheel joint damping ratio, non-dimensional.
WheelJoint_GetSuspensionHertz ¶
Get the wheel joint stiffness in Hertz.
WheelJoint_GetTargetSteeringAngle ¶
Get the wheel joint target steering angle in radians.
WheelJoint_GetUpperSteeringLimit ¶
Get the wheel joint upper steering limit in radians.
WheelJoint_GetUpperSuspensionLimit ¶
Get the wheel joint upper limit.
WheelJoint_IsSpinMotorEnabled ¶
Is the wheel joint motor enabled?
WheelJoint_IsSteeringEnabled ¶
Can the wheel steer?
WheelJoint_IsSteeringLimitEnabled ¶
Is the wheel joint steering limit enabled?
WheelJoint_IsSuspensionEnabled ¶
Is the wheel joint spring enabled?
WheelJoint_IsSuspensionLimitEnabled ¶
Is the wheel joint limit enabled?
WheelJoint_SetMaxSpinTorque ¶
Set the wheel joint maximum motor torque, usually in newton-meters.
WheelJoint_SetMaxSteeringTorque ¶
Set the wheel joint maximum steering torque in N*m.
WheelJoint_SetSpinMotorSpeed ¶
Set the wheel joint motor speed in radians per second.
WheelJoint_SetSteeringDampingRatio ¶
Set the wheel joint steering damping ratio, non-dimensional.
WheelJoint_SetSteeringHertz ¶
Set the wheel joint steering stiffness in Hertz.
WheelJoint_SetSteeringLimits ¶
Set the wheel joint steering limits in radians.
WheelJoint_SetSuspensionDampingRatio ¶
Set the wheel joint damping ratio, non-dimensional.
WheelJoint_SetSuspensionHertz ¶
Set the wheel joint stiffness in Hertz.
WheelJoint_SetSuspensionLimits ¶
Set the wheel joint limits.
WheelJoint_SetTargetSteeringAngle ¶
Set the wheel joint target steering angle in radians.
World_CastMover ¶
World_CastMover :: proc "c" ( worldId: WorldId, origin: [3]f32, #by_ptr mover: Capsule, translation: [3]f32, filter: QueryFilter, fcn: MoverFilterFcn, ctx: rawptr, ) -> f32 ---
Cast a capsule mover through the world. This is a special shape cast that handles sliding along other shapes while reducing clipping. This is not a good source of information about what the mover is touching. Instead use the planes returned by World_CollideMover. @param worldId World to cast the mover against @param origin World position the mover capsule is relative to @param mover Capsule mover, relative to the origin @param translation Desired mover translation @param filter Contains bit flags to filter unwanted shapes from the results @param fcn Optional callback for custom shape filtering @param context A user context that is passed along to the callback function @return the translation fraction
World_CastRay ¶
World_CastRay :: proc "c" ( worldId: WorldId, origin: [3]f32, translation: [3]f32, filter: QueryFilter, fcn: CastResultFcn, ctx: rawptr, ) -> TreeStats ---
Cast a ray into the world to collect shapes in the path of the ray. Your callback function controls whether you get the closest point, any point, or n-points. @note The callback function may receive shapes in any order @param worldId The world to cast the ray against @param origin The start point of the ray @param translation The translation of the ray from the start point to the end point @param filter Contains bit flags to filter unwanted shapes from the results @param fcn A user implemented callback function @param context A user context that is passed along to the callback function
@return traversal performance counters
World_CastRayClosest ¶
World_CastRayClosest :: proc "c" (worldId: WorldId, origin: [3]f32, translation: [3]f32, filter: QueryFilter) -> RayResult ---
Cast a ray into the world to collect the closest hit. This is a convenience function. Ignores initial overlap. This is less general than World_CastRay() and does not allow for custom filtering.
World_CastShape ¶
World_CastShape :: proc "c" ( worldId: WorldId, origin: [3]f32, #by_ptr proxy: ShapeProxy, translation: [3]f32, filter: QueryFilter, fcn: CastResultFcn, ctx: rawptr, ) -> TreeStats ---
Cast a shape through the world. Similar to a cast ray except that a shape is cast instead of a point. The proxy points are relative to the origin and the hit points come back as world positions, so the cast stays precise far from the world origin.
@see World_CastRay
World_CollideMover ¶
World_CollideMover :: proc "c" ( worldId: WorldId, origin: [3]f32, #by_ptr mover: Capsule, filter: QueryFilter, fcn: PlaneResultFcn, ctx: rawptr, ) ---
Collide a capsule mover with the world, gathering collision planes that can be fed to SolvePlanes. Useful for kinematic character movement. The mover and the returned planes are relative to the origin.
World_Draw ¶
Call this to draw shapes and other debug draw data
World_Dump ¶
World_Dump :: proc "c" (worldId: WorldId) ---
Dump world to a text file. Meshes are saved to binary m files.
World_DumpAwake ¶
World_DumpAwake :: proc "c" (worldId: WorldId) ---
Dump world to a text file. Saves only awake bodies and associated static bodies. Meshes are saved to binary m files.
World_DumpMemoryStats ¶
World_DumpMemoryStats :: proc "c" (worldId: WorldId) ---
Dump memory stats to log.
World_DumpShapeBounds ¶
Dump shape bounds to box3d_bounds.txt
World_EnableContinuous ¶
Enable/disable continuous collision between dynamic and static bodies. Generally you should keep continuous collision enabled to prevent fast moving objects from going through static objects. The performance gain from disabling continuous collision is minor. @see WorldDef
World_EnableSleeping ¶
Enable/disable sleep. If your application does not need sleeping, you can gain some performance by disabling sleep completely at the world level. @see WorldDef
World_EnableSpeculative ¶
This is for internal testing
World_EnableWarmStarting ¶
Enable/disable constraint warm starting. Advanced feature for testing. Disabling warm starting greatly reduces stability and provides no performance gain.
World_Explode ¶
World_Explode :: proc "c" (worldId: WorldId, #by_ptr explosionDef: ExplosionDef) ---
Apply a radial explosion @param worldId The world id @param explosionDef The explosion definition
World_GetAwakeBodyCount ¶
Get the number of awake bodies
World_GetBodyEvents ¶
World_GetBodyEvents :: proc "c" (worldId: WorldId) -> BodyEvents ---
Get the body events for the current time step. The event data is transient. Do not store a reference to this data.
World_GetBounds ¶
Get the world's bounds. This is the bounding box that covers the current simulation. May have a small amount of padding.
World_GetContactEvents ¶
World_GetContactEvents :: proc "c" (worldId: WorldId) -> ContactEvents ---
Get contact events for this current time step. The event data is transient. Do not store a reference to this data.
World_GetContactRecycleDistance ¶
Get the contact point recycling distance. Usually in meters.
World_GetCounters ¶
Get world counters and sizes
World_GetGravity ¶
Get the gravity vector
World_GetHitEventThreshold ¶
Get the hit event speed threshold. Usually in meters per second.
World_GetJointEvents ¶
World_GetJointEvents :: proc "c" (worldId: WorldId) -> JointEvents ---
Get the joint events for the current time step. The event data is transient. Do not store a reference to this data.
World_GetMaxCapacity ¶
Get max capacity. This can be used with WorldDef to avoid run-time allocations and copies
World_GetMaximumLinearSpeed ¶
Get the maximum linear speed. Usually in m/s.
World_GetProfile ¶
Get the current world performance profile
World_GetRestitutionThreshold ¶
Get the restitution speed threshold. Usually in meters per second.
World_GetSensorEvents ¶
World_GetSensorEvents :: proc "c" (worldId: WorldId) -> SensorEvents ---
Get sensor events for the current time step. The event data is transient. Do not store a reference to this data.
World_GetWorkerCount ¶
Get the worker count.
World_IsContinuousEnabled ¶
Is continuous collision enabled?
World_IsSleepingEnabled ¶
Is body sleeping enabled?
World_IsValid ¶
World id validation. Provides validation for up to 64K allocations.
World_IsWarmStartingEnabled ¶
Is constraint warm starting enabled?
World_OverlapAABB ¶
World_OverlapAABB :: proc "c" (worldId: WorldId, aabb: AABB, filter: QueryFilter, fcn: OverlapResultFcn, ctx: rawptr) -> TreeStats ---
Overlap test for all shapes that potentially overlap the provided AABB
World_OverlapShape ¶
World_OverlapShape :: proc "c" ( worldId: WorldId, origin: [3]f32, #by_ptr proxy: ShapeProxy, filter: QueryFilter, fcn: OverlapResultFcn, ctx: rawptr, ) -> TreeStats ---
Overlap test for all shapes that overlap the provided shape proxy. The proxy points are relative to the world origin, which lets the query stay precise far from the world origin.
World_RebuildStaticTree ¶
World_RebuildStaticTree :: proc "c" (worldId: WorldId) ---
This is for internal testing
World_SetContactRecycleDistance ¶
Set the contact point recycling distance. Setting this to zero disables contact point recycling. Usually in meters.
World_SetContactTuning ¶
World_SetContactTuning :: proc "c" (worldId: WorldId, hertz: f32, dampingRatio: f32, contactSpeed: f32) ---
Adjust contact tuning parameters @param worldId The world id @param hertz The contact stiffness (cycles per second) @param dampingRatio The contact bounciness with 1 being critical damping (non-dimensional) @param contactSpeed The maximum contact constraint push out speed (meters per second) @note Advanced feature
World_SetCustomFilterCallback ¶
World_SetCustomFilterCallback :: proc "c" (worldId: WorldId, fcn: CustomFilterFcn, ctx: rawptr) ---
Register the custom filter callback. This is optional.
World_SetFrictionCallback ¶
World_SetFrictionCallback :: proc "c" (worldId: WorldId, callback: FrictionCallback) ---
Set the friction callback. Passing NULL resets to default.
World_SetGravity ¶
Set the gravity vector for the entire world. Box3D has no concept of an up direction and this is left as a decision for the application. Usually in m/s^2. @see WorldDef
World_SetHitEventThreshold ¶
Adjust the hit event threshold. This controls the collision speed needed to generate a ContactHitEvent. Usually in meters per second. @see WorldDef::hitEventThreshold
World_SetMaximumLinearSpeed ¶
Set the maximum linear speed. Usually in m/s.
World_SetPreSolveCallback ¶
World_SetPreSolveCallback :: proc "c" (worldId: WorldId, fcn: PreSolveFcn, ctx: rawptr) ---
Register the pre-solve callback. This is optional.
World_SetRestitutionCallback ¶
World_SetRestitutionCallback :: proc "c" (worldId: WorldId, callback: RestitutionCallback) ---
Set the restitution callback. Passing NULL resets to default.
World_SetRestitutionThreshold ¶
Adjust the restitution threshold. It is recommended not to make this value very small because it will prevent bodies from sleeping. Usually in meters per second. @see WorldDef
World_SetUserData ¶
Set the user data pointer.
World_SetWorkerCount ¶
Set the worker count. Must be in the range [1, B3_MAX_WORKERS]
World_StartRecording ¶
Begin recording world mutations into the provided buffer. The buffer is reset on each call so a single Recording can be reused for multiple sessions. @param worldId the world to record @param recording the recording handle to write into
World_Step ¶
Simulate a world for one time step. This performs collision detection, integration, and constraint solution. @param worldId The world to simulate @param timeStep The amount of time to simulate, this should be a fixed number. Usually 1/60. @param subStepCount The number of sub-steps, increasing the sub-step count can increase accuracy. Usually 4.
World_StopRecording ¶
World_StopRecording :: proc "c" (worldId: WorldId) ---
End the current recording session. Writes the trailing geometry registry and backpatches the header. The buffer remains valid until the recording is destroyed. @param worldId the world currently being recorded
WriteBinaryFile ¶
Dump file support functions
Procedure Groups
Cross ¶
Cross :: proc{ linalg.scalar_cross, linalg.vector_cross2, linalg.vector_cross3, linalg.quaternion_cross, }
https://en.wikipedia.org/wiki/Cross_product
Det ¶
Det :: proc{ linalg.matrix1x1_determinant, linalg.matrix2x2_determinant, linalg.matrix3x3_determinant, linalg.matrix4x4_determinant, linalg.matrix5x5_determinant, linalg.matrix6x6_determinant, linalg.matrix7x7_determinant, linalg.matrix8x8_determinant, }
Compute the determinant of a 3-by-3 matrix.
Dot ¶
Dot :: proc{ linalg.scalar_dot, linalg.vector_dot, linalg.quaternion64_dot, linalg.quaternion128_dot, linalg.quaternion256_dot, }
Vector dot product.
DotQuat ¶
DotQuat :: proc{ linalg.scalar_dot, linalg.vector_dot, linalg.quaternion64_dot, linalg.quaternion128_dot, linalg.quaternion256_dot, }
Compute dot product of two quaternions. Useful for polarity tests.
Length ¶
Length :: proc{ linalg.vector_length, linalg.quaternion_length, }
LengthSquared ¶
LengthSquared :: proc{ linalg.vector_length2, linalg.quaternion_length2, }
Max ¶
Max :: proc{ linalg.max_single, linalg.max_double, linalg.max_triple, }
Component-wise maximum value.
Min ¶
Min :: proc{ linalg.min_single, linalg.min_double, linalg.min_triple, }
Component-wise minimum value.
Source Files
Generation Information
Generated with odin version dev-2026-07 (vendor "odin") Windows_amd64 @ 2026-07-03 21:57:05.062208800 +0000 UTC