package vendor:box3d
Overview
Bindings for Box3D
External Examples 1 ¶
The programs in odin-lang/examples about this package, and how many of its declarations each uses.
- raylib/
- box3d14
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 (69)
- AABB_MARGIN_FRACTION
- BOX3D_SHARED
- 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
- GYROSCOPIC_ITERATIONS
- HASH_INIT
- HEIGHT_FIELD_HOLE
- HEIGHT_FIELD_VERSION
- HULL_VERSION
- MESH_VERSION
- MIN_FRICTION_WEIGHT
- MIN_SCALE
- Mat3_identity
- Mat3_zero
- NULL_INDEX
- PARALLEL_EDGE_TOL
- PI
- Pos_zero
- Quat_identity
- RAD_TO_DEG
- RESTITUTION_ITERATIONS
- SHAPE_POWER
- TIME_TO_SLEEP
- Transform_identity
Vec3_… (5)
- 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 (692)
- ASSERT
- Abs
- AbsFloat
- AbsMatrix3
- Atan2
- BREAKPOINT
- Blend2
Body_… (74)
- Body_AllowFastRotation
- 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_GetLocalCenter
- 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_GetWorldCenter
- Body_GetWorldInverseRotationalInertia
- Body_GetWorldPoint
- Body_GetWorldPointVelocity
- Body_GetWorldVector
- Body_IsAwake
- Body_IsBullet
- Body_IsContactRecyclingEnabled
- Body_IsEnabled
- Body_IsFastRotationAllowed
- 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
- Clamp
- ClampFloat
- ClampInt
- ClipVector
- CloneAndTransformHull
- CloneHull
- ClosestPointToAABB
- CollideCapsuleAndSphere
- CollideCapsules
- CollideHullAndCapsule
- CollideHullAndSphere
- CollideHulls
- CollideSpheres
- CollideTriangleAndCapsule
- CollideTriangleAndHull
- CollideTriangleAndSphere
- ComputeCapsuleAABB
- ComputeCapsuleMass
- ComputeCompoundAABB
- ComputeCosSin
- ComputeHeightFieldAABB
- ComputeHullAABB
- ComputeHullMass
- ComputeMeshAABB
- ComputeQuatBetweenUnitVectors
- ComputeSphereAABB
- ComputeSphereMass
- Conjugate
- Contact_GetData
- Contact_IsValid
- ConvertBytesToCompound
- ConvertCompoundToBytes
- CreateBakedCompoundShape
- CreateBody
- CreateBoxMesh
- CreateCapsuleShape
- CreateCompound
- 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_… (23)
- 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_… (24)
- 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
- GetHullSoaNormals
- GetHullSoaVertices
- 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
- IsValidMatrix3
- IsValidPlane
- IsValidPosition
- IsValidQuat
- IsValidRay
- IsValidTransform
- IsValidVec3
- IsValidWorldTransform
Joint_… (24)
- 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
- Lerp
- LerpFloat
- LerpPosition
- 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_… (20)
- 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
- Perp
- PointToSegmentDistance
PrismaticJoint_… (22)
- 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
RecPlayer_… (27)
- 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_IsAtPreStep
- RecPlayer_Restart
- RecPlayer_SeekFrame
- RecPlayer_SetDebugShapeCallbacks
- RecPlayer_SetKeyframePolicy
- RecPlayer_SetWorkerCount
- RecPlayer_StepFrame
- RecPlayer_SubStepFrame
- Recording_GetData
- Recording_GetSize
RevoluteJoint_… (21)
- 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_… (48)
- 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_GetName
- 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_SetName
- Shape_SetRestitution
- Shape_SetSphere
- Shape_SetSurfaceMaterial
- Shape_SetUserData
- Sign
- Sleep
- Solve3
- SolvePlanes
SphericalJoint_… (26)
- 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
WheelJoint_… (36)
- 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_… (53)
- 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
- Yield
`#config` values (1)
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
AssertFcn ¶
Prototype for the user assert callback. Return 0 to skip the debugger break.
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. 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
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
BodyId ¶
/ Body id references a body instance. This should be treated as an opaque handle.
External examples raylib/box3d
Related Procedures With Parameters
- Body_AllowFastRotation
- 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_GetLocalCenter
- 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_GetWorldCenter
- Body_GetWorldInverseRotationalInertia
- Body_GetWorldPoint
- Body_GetWorldPointVelocity
- Body_GetWorldVector
- Body_IsAwake
- Body_IsBullet
- Body_IsContactRecyclingEnabled
- Body_IsEnabled
- Body_IsFastRotationAllowed
- 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
- CreateBakedCompoundShape
- CreateCapsuleShape
- 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.
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
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.
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. boxPlanes: [6]Plane, // < Box face planes. boxFaces: [6]HullFace, // < Box faces. padding: [10]u8, // < Explicit padding, see b3HullData::padding. vx: [8]f32, // < vertex x vy: [8]f32, // < vertex y vz: [8]f32, // < vertex z nx: [8]f32, // < normal x, padded to multiple of 4 ny: [8]f32, // < normal y, padded to multiple of 4 nz: [8]f32, }
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
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.
CastOutput ¶
CastOutput :: struct { // The surface normal at the hit point. normal: [3]f32, // The surface hit point. 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, userMaterialId: 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
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.
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 data for a baked 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. Note: you don't need to use this to create runtime compounds. For runtime compounds you can add multiple shapes to a body using the regular shape creation functions.
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.
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.
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.
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.
CompoundSphere ¶
CompoundSphere :: struct { // Local sphere. sphere: Sphere, // Index to a shared material. materialIndex: i32, }
A sphere that lives in a compound.
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 shapeIdA: ShapeId, // Id of the second shape shapeIdB: ShapeId, // The transient contact id. This contact may be destroyed automatically when the world is modified or simulated. // Use b3Contact_IsValid before using this id. 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
ContactEndTouchEvent ¶
ContactEndTouchEvent :: struct { // Id of the first shape shapeIdA: ShapeId, // Id of the second shape shapeIdB: ShapeId, // The transient contact id. This contact may be destroyed automatically when the world is modified or simulated. // Use b3Contact_IsValid before using this id. 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
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 Constants
CosSin ¶
Cosine and sine pair. This uses a custom implementation designed for cross-platform determinism.
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
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
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
DebugDraw ¶
DebugDraw :: struct { // Draws a user shape. The userShape pointer is owned by the application and is known to Box3D as // an opaque pointer returned from b3CreateDebugShapeCallback. When this is called the drawn shape has // passed a culling test against drawingBounds below. 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 the sleep information for dynamic and kinematic bodies drawSleep: bool, // Option to draw body names drawBodyNames: bool, // Option to draw contact points drawContacts: bool, // Draw contact anchor A or B drawAnchorA: bool, // 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 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
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.
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.
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
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
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
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
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 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
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`
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
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 = 0xF0F8FF, AntiqueWhite = 0xFAEBD7, Aqua = 0x00FFFF, Aquamarine = 0x7FFFD4, Azure = 0xF0FFFF, Beige = 0xF5F5DC, Bisque = 0xFFE4C4, Black = 0x000000, BlanchedAlmond = 0xFFEBCD, Blue = 0x0000FF, BlueViolet = 0x8A2BE2, Brown = 0xA52A2A, Burlywood = 0xDEB887, CadetBlue = 0x5F9EA0, Chartreuse = 0x7FFF00, Chocolate = 0xD2691E, Coral = 0xFF7F50, CornflowerBlue = 0x6495ED, Cornsilk = 0xFFF8DC, Crimson = 0xDC143C, Cyan = 0x00FFFF, DarkBlue = 0x00008B, DarkCyan = 0x008B8B, DarkGoldenRod = 0xB8860B, DarkGray = 0xA9A9A9, DarkGreen = 0x006400, DarkKhaki = 0xBDB76B, DarkMagenta = 0x8B008B, DarkOliveGreen = 0x556B2F, DarkOrange = 0xFF8C00, DarkOrchid = 0x9932CC, DarkRed = 0x8B0000, DarkSalmon = 0xE9967A, DarkSeaGreen = 0x8FBC8F, DarkSlateBlue = 0x483D8B, DarkSlateGray = 0x2F4F4F, DarkTurquoise = 0x00CED1, DarkViolet = 0x9400D3, DeepPink = 0xFF1493, DeepSkyBlue = 0x00BFFF, DimGray = 0x696969, DodgerBlue = 0x1E90FF, FireBrick = 0xB22222, FloralWhite = 0xFFFAF0, ForestGreen = 0x228B22, Fuchsia = 0xFF00FF, Gainsboro = 0xDCDCDC, GhostWhite = 0xF8F8FF, Gold = 0xFFD700, GoldenRod = 0xDAA520, Gray = 0x808080, Green = 0x008000, GreenYellow = 0xADFF2F, HoneyDew = 0xF0FFF0, HotPink = 0xFF69B4, IndianRed = 0xCD5C5C, Indigo = 0x4B0082, Ivory = 0xFFFFF0, Khaki = 0xF0E68C, Lavender = 0xE6E6FA, LavenderBlush = 0xFFF0F5, LawnGreen = 0x7CFC00, LemonChiffon = 0xFFFACD, LightBlue = 0xADD8E6, LightCoral = 0xF08080, LightCyan = 0xE0FFFF, LightGoldenRodYellow = 0xFAFAD2, LightGray = 0xD3D3D3, LightGreen = 0x90EE90, LightPink = 0xFFB6C1, LightSalmon = 0xFFA07A, LightSeaGreen = 0x20B2AA, LightSkyBlue = 0x87CEFA, LightSlateGray = 0x778899, LightSteelBlue = 0xB0C4DE, LightYellow = 0xFFFFE0, Lime = 0x00FF00, LimeGreen = 0x32CD32, Linen = 0xFAF0E6, Magenta = 0xFF00FF, Maroon = 0x800000, MediumAquaMarine = 0x66CDAA, MediumBlue = 0x0000CD, MediumOrchid = 0xBA55D3, MediumPurple = 0x9370DB, MediumSeaGreen = 0x3CB371, MediumSlateBlue = 0x7B68EE, MediumSpringGreen = 0x00FA9A, MediumTurquoise = 0x48D1CC, MediumVioletRed = 0xC71585, MidnightBlue = 0x191970, MintCream = 0xF5FFFA, MistyRose = 0xFFE4E1, Moccasin = 0xFFE4B5, NavajoWhite = 0xFFDEAD, Navy = 0x000080, OldLace = 0xFDF5E6, Olive = 0x808000, OliveDrab = 0x6B8E23, Orange = 0xFFA500, OrangeRed = 0xFF4500, Orchid = 0xDA70D6, PaleGoldenRod = 0xEEE8AA, PaleGreen = 0x98FB98, PaleTurquoise = 0xAFEEEE, PaleVioletRed = 0xDB7093, PapayaWhip = 0xFFEFD5, PeachPuff = 0xFFDAB9, Peru = 0xCD853F, Pink = 0xFFC0CB, Plum = 0xDDA0DD, PowderBlue = 0xB0E0E6, Purple = 0x800080, RebeccaPurple = 0x663399, Red = 0xFF0000, RosyBrown = 0xBC8F8F, RoyalBlue = 0x4169E1, SaddleBrown = 0x8B4513, Salmon = 0xFA8072, SandyBrown = 0xF4A460, SeaGreen = 0x2E8B57, SeaShell = 0xFFF5EE, Sienna = 0xA0522D, Silver = 0xC0C0C0, SkyBlue = 0x87CEEB, SlateBlue = 0x6A5ACD, SlateGray = 0x708090, Snow = 0xFFFAFA, SpringGreen = 0x00FF7F, SteelBlue = 0x4682B4, Tan = 0xD2B48C, Teal = 0x008080, Thistle = 0xD8BFD8, Tomato = 0xFF6347, Turquoise = 0x40E0D0, Violet = 0xEE82EE, Wheat = 0xF5DEB3, White = 0xFFFFFF, WhiteSmoke = 0xF5F5F5, Yellow = 0xFFFF00, YellowGreen = 0x9ACD32, Box2DRed = 0xDC3132, Box2DBlue = 0x30AEBF, Box2DGreen = 0x8CC924, Box2DYellow = 0xFFEE8C, }
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
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 plane array in bytes from the struct address. planeOffset: i32, // Offset of the face array in bytes from the struct address. faceOffset: i32, // Offset of structure of array (SOA) vertices soaVertexOffset: i32, // Offset of structure of array (SOA) unit normal vectors soaNormalOffset: 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
- CollideHulls
- CollideTriangleAndHull
- ComputeHullAABB
- ComputeHullMass
- CreateHullShape
- CreateTransformedHullShape
- DestroyHull
- GetHullEdges
- GetHullFaces
- GetHullPlanes
- GetHullPoints
- GetHullSoaNormals
- GetHullSoaVertices
- GetHullVertices
- OverlapHull
- RayCastHull
- ShapeCastHull
- Shape_SetHull
Related Procedures With Returns
HullFace ¶
HullFace :: struct { // An arbitrary half-edge on this face 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 { // An arbitrary half-edge on this face 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:
- You might not know where the center of mass will be.
- 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
JointId ¶
/ Joint id references a joint instance. This should be treated as an opaque handle.
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
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.
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 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
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. CCW winding. 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
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
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
MoverFilterFcn ¶
Used to filter shapes for shape casting character movers. Return true to accept the collision
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
Plane ¶
A plane. separation = dot(normal, point) - offset
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.
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.
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
- CollideTriangleAndHull
- 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_GetLocalCenter
- Body_GetPosition
- Body_GetWorldCenter
- 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
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
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
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
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.
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_IsAtPreStep
- RecPlayer_Restart
- RecPlayer_SeekFrame
- RecPlayer_SetDebugShapeCallbacks
- RecPlayer_SetKeyframePolicy
- RecPlayer_SetWorkerCount
- RecPlayer_StepFrame
- RecPlayer_SubStepFrame
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.
RecQueryHit ¶
One result of a recorded spatial query.
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.
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
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
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
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
ShapeDef ¶
ShapeDef :: struct { // Optional shape name for debugging name: cstring, // 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. // Only convex shapes may act as sensor visitors. 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. // Warning: if this is false, you MUST call b3Body_ApplyMassFromShapes or b3Body_SetMassData before simulating the world. updateBodyMass: bool, // Enable speculative collision. Leave this true unless you care about reducing ghost collision // more than continuous collision under rotation. // Experimental: this can only disable speculative contact between hulls and triangles (meshes and height fields). enableSpeculativeContact: bool, // Used internally to detect a valid definition. DO NOT SET. internalValue: i32, }
Used to create a shape @ingroup shape
Related Procedures With Parameters
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_GetName
- 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_SetName
- 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 baked compound shape composed of 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
Simplex ¶
Simplex :: struct { vertices: [4]SimplexVertex `fmt:"v,count"`, // < vertices count: i32, }
Simplex from the GJK algorithm
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
Sphere ¶
A solid sphere
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
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, // Explicit padding. Must be zero. padding: 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.
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
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
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
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
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
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
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
- CollideTriangleAndHull
- 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_GetLocalCenter
- Body_GetPosition
- Body_GetWorldCenter
- 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/
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
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
WorldCastOutput ¶
WorldCastOutput :: struct { // The surface normal at the hit point. normal: [3]f32, // The surface hit point. 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.
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
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.
BOX3D_SHARED ¶
BOX3D_SHARED :: #config(BOX3D_SHARED, false)
-define:BOX3D_SHARED=false
CHILD_POWER ¶
CHILD_POWER :: 64 - 2 * SHAPE_POWER
COMPOUND_VERSION ¶
COMPOUND_VERSION :: 0xB11DCE70FAD5622B ~ 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 :: 0xDA5150191B994C01
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_HULL_EDGES ¶
MAX_HULL_EDGES :: 128
The maximum number of convex hull edges. Full edges, not half-edges.
MAX_HULL_VERTICES ¶
MAX_HULL_VERTICES :: 128
The maximum number of convex hull vertices. This is fixed for performance reasons.
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 :: MAX_HULL_VERTICES
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.
MIN_FRICTION_WEIGHT ¶
MIN_FRICTION_WEIGHT :: 1e-10
Minimum contact point friction weight, lower bound for speculative points. Made small enough to be washed away by weights that hit 1.
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
PARALLEL_EDGE_TOL ¶
PARALLEL_EDGE_TOL :: 0.005
Relative tolerance used to determine if two edges are parallel.
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.
RESTITUTION_ITERATIONS ¶
RESTITUTION_ITERATIONS :: 1
Increase this if your application needs more accurate restitution. Doing so will slow down the simulation. Must be 1 or more.
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_Contains ¶
Does a fully contain b?
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 ¶
@(disabled=ODIN_DISABLE_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 ¶C · b3Atan2Source · box3d_math.odin:96
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_AllowFastRotation ¶C · b3Body_AllowFastRotationSource · box3d.odin:839
Allow this body to rotate fast. Useful for axially symmetric bodies, such as vehicle wheels. Normally rotation speed is clamped to improve CCD. However, this clamping is unnecessary for bodies that only rotate fast around an axis of symmetry.
Body_ApplyAngularImpulse ¶C · b3Body_ApplyAngularImpulseSource · box3d.odin:740
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 ¶C · b3Body_ApplyForceSource · box3d.odin:696
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 ¶C · b3Body_ApplyForceToCenterSource · box3d.odin:703
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 ¶C · b3Body_ApplyLinearImpulseSource · box3d.odin:722
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 ¶C · b3Body_ApplyLinearImpulseToCenterSource · box3d.odin:731
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 ¶C · b3Body_ApplyMassFromShapesSource · box3d.odin:773
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 ¶C · b3Body_ApplyTorqueSource · box3d.odin:710
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 ¶C · b3Body_CastRaySource · box3d.odin:889
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 ¶C · b3Body_CastShapeSource · box3d.odin:892
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 ¶C · b3Body_CollideMoverSource · box3d.odin:898
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 ¶C · b3Body_ComputeAABBSource · box3d.odin:883
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 ¶C · b3Body_DisableSource · box3d.odin:818
Body_Disable :: proc "c" (bodyId: BodyId) ---
Disable a body by removing it completely from the simulation. This is expensive.
Body_Enable ¶C · b3Body_EnableSource · box3d.odin:821
Body_Enable :: proc "c" (bodyId: BodyId) ---
Enable a body by adding it to the simulation. This is expensive.
Body_EnableContactRecycling ¶C · b3Body_EnableContactRecyclingSource · box3d.odin:849
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 ¶C · b3Body_EnableHitEventsSource · box3d.odin:856
Enable/disable hit events on all shapes @see ShapeDef::enableHitEvents
Body_EnableSleep ¶C · b3Body_EnableSleepSource · box3d.odin:803
Enable or disable sleeping for this body. If sleeping is disabled the body will wake.
Body_GetAngularDamping ¶C · b3Body_GetAngularDampingSource · box3d.odin:785
Get the current angular damping.
Body_GetAngularVelocity ¶C · b3Body_GetAngularVelocitySource · box3d.odin:669
Get the angular velocity of a body in radians per second
Body_GetClosestPoint ¶C · b3Body_GetClosestPointSource · box3d.odin:886
Get the closest point on a body to a world target.
Body_GetContactCapacity ¶C · b3Body_GetContactCapacitySource · box3d.odin:876
Get the maximum capacity required for retrieving all the touching contacts on a body
Body_GetContactData ¶C · b3Body_GetContactDataSource · box3d.odin:879
Body_GetContactData :: proc "c" ( bodyId: BodyId, contactData: [^]ContactData, capacity: i32, ) -> i32 ---
Get the touching contact data for a body
Body_GetGravityScale ¶C · b3Body_GetGravityScaleSource · box3d.odin:792
Get the current gravity scale
Body_GetInverseMass ¶C · b3Body_GetInverseMassSource · box3d.odin:749
Get the inverse mass of the body, usually in 1/kilograms
Body_GetJointCount ¶C · b3Body_GetJointCountSource · box3d.odin:869
Get the number of joints on this body
Body_GetJoints ¶C · b3Body_GetJointsSource · box3d.odin:873
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 ¶C · b3Body_GetLinearDampingSource · box3d.odin:779
Get the current linear damping.
Body_GetLinearVelocity ¶C · b3Body_GetLinearVelocitySource · box3d.odin:666
Get the linear velocity of a body's center of mass. Usually in meters per second.
Body_GetLocalCenter ¶C · b3Body_GetLocalCenterSource · box3d.odin:755
Get the center of mass position of the body in local space
Body_GetLocalPoint ¶C · b3Body_GetLocalPointSource · box3d.odin:654
Get a local point on a body given a world point
Body_GetLocalPointVelocity ¶C · b3Body_GetLocalPointVelocitySource · box3d.odin:684
Get the linear velocity of a local point attached to a body. Usually in meters per second.
Body_GetLocalRotationalInertia ¶C · b3Body_GetLocalRotationalInertiaSource · box3d.odin:746
Get the rotational inertia of the body in local space, usually in kg*m^2
Body_GetLocalVector ¶C · b3Body_GetLocalVectorSource · box3d.odin:660
Get a local vector on a body given a world vector
Body_GetMass ¶C · b3Body_GetMassSource · box3d.odin:743
Get the mass of the body, usually in kilograms
Body_GetMassData ¶C · b3Body_GetMassDataSource · box3d.odin:766
Get the mass data for a body
Body_GetMotionLocks ¶C · b3Body_GetMotionLocksSource · box3d.odin:827
Body_GetMotionLocks :: proc "c" (bodyId: BodyId) -> MotionLocks ---
Get the motion locks for this body.
Body_GetName ¶C · b3Body_GetNameSource · box3d.odin:631
Get the body name.
Body_GetPosition ¶C · b3Body_GetPositionSource · box3d.odin:640
Get the world position of a body. This is the location of the body origin.
External examples raylib/box3d
Body_GetRotation ¶C · b3Body_GetRotationSource · box3d.odin:643
Body_GetRotation :: proc "c" (bodyId: BodyId) -> quaternion128 ---
Get the world rotation of a body as a quaternion
External examples raylib/box3d
Body_GetShapeCount ¶C · b3Body_GetShapeCountSource · box3d.odin:862
Get the number of shapes on this body
Body_GetShapes ¶C · b3Body_GetShapesSource · box3d.odin:866
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 ¶C · b3Body_GetSleepThresholdSource · box3d.odin:812
Get the sleep threshold, usually in meters per second.
Body_GetTransform ¶C · b3Body_GetTransformSource · box3d.odin:646
Body_GetTransform :: proc "c" (bodyId: BodyId) -> WorldTransform ---
Get the world transform of a body.
Body_GetType ¶C · b3Body_GetTypeSource · box3d.odin:621
Get the body type: static, kinematic, or dynamic
Body_GetUserData ¶C · b3Body_GetUserDataSource · box3d.odin:637
Get the user data stored in a body
Body_GetWorld ¶C · b3Body_GetWorldSource · box3d.odin:859
Get the world that owns this body
Body_GetWorldCenter ¶C · b3Body_GetWorldCenterSource · box3d.odin:758
Get the center of mass position of the body in world space
Body_GetWorldInverseRotationalInertia ¶C · b3Body_GetWorldInverseRotationalInertiaSource · box3d.odin:752
Get the inverse rotational inertia of the body in world space, usually in 1/kg*m^2
Body_GetWorldPoint ¶C · b3Body_GetWorldPointSource · box3d.odin:657
Get a world point on a body given a local point
Body_GetWorldPointVelocity ¶C · b3Body_GetWorldPointVelocitySource · box3d.odin:687
Get the linear velocity of a world point attached to a body. Usually in meters per second.
Body_GetWorldVector ¶C · b3Body_GetWorldVectorSource · box3d.odin:663
Get a world vector on a body given a local vector
Body_IsAwake ¶C · b3Body_IsAwakeSource · box3d.odin:795
@return true if this body is awake
Body_IsBullet ¶C · b3Body_IsBulletSource · box3d.odin:834
Is this body a bullet?
Body_IsContactRecyclingEnabled ¶C · b3Body_IsContactRecyclingEnabledSource · box3d.odin:852
Is contact recycling enabled on this body?
Body_IsEnabled ¶C · b3Body_IsEnabledSource · box3d.odin:815
Returns true if this body is enabled
Body_IsFastRotationAllowed ¶C · b3Body_IsFastRotationAllowedSource · box3d.odin:842
Is this body allowed to rotate fast?
Body_IsSleepEnabled ¶C · b3Body_IsSleepEnabledSource · box3d.odin:806
Returns true if sleeping is enabled for this body
Body_IsValid ¶C · b3Body_IsValidSource · box3d.odin:618
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 ¶C · b3Body_OverlapShapeSource · box3d.odin:895
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 ¶C · b3Body_SetAngularDampingSource · box3d.odin:782
Adjust the angular damping. Normally this is set in BodyDef before creation.
Body_SetAngularVelocity ¶C · b3Body_SetAngularVelocitySource · box3d.odin:675
Set the angular velocity of a body in radians per second
Body_SetAwake ¶C · b3Body_SetAwakeSource · box3d.odin:800
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 ¶C · b3Body_SetBulletSource · box3d.odin:831
Set this body to be a bullet. A bullet does continuous collision detection against dynamic bodies (but not other bullets).
Body_SetGravityScale ¶C · b3Body_SetGravityScaleSource · box3d.odin:789
Adjust the gravity scale. Normally this is set in BodyDef before creation. @see BodyDef::gravityScale
Body_SetLinearDamping ¶C · b3Body_SetLinearDampingSource · box3d.odin:776
Adjust the linear damping. Normally this is set in BodyDef before creation.
Body_SetLinearVelocity ¶C · b3Body_SetLinearVelocitySource · box3d.odin:672
Set the linear velocity of a body. Usually in meters per second.
Body_SetMassData ¶C · b3Body_SetMassDataSource · box3d.odin:763
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 ¶C · b3Body_SetMotionLocksSource · box3d.odin:824
Body_SetMotionLocks :: proc "c" (bodyId: BodyId, locks: MotionLocks) ---
Set the motion locks on this body.
Body_SetName ¶C · b3Body_SetNameSource · box3d.odin:628
Set the body name.
Body_SetSleepThreshold ¶C · b3Body_SetSleepThresholdSource · box3d.odin:809
Set the sleep threshold, usually in meters per second
Body_SetTargetTransform ¶C · b3Body_SetTargetTransformSource · box3d.odin:681
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 ¶C · b3Body_SetTransformSource · box3d.odin:651
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 ¶C · b3Body_SetTypeSource · box3d.odin:625
Change the body type. This is an expensive operation. This automatically updates the mass properties regardless of the automatic mass setting.
Body_SetUserData ¶C · b3Body_SetUserDataSource · box3d.odin:634
Set the user data for a body
CONTACT_RECYCLE_DISTANCE ¶
@(require_results) 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 ¶C · b3ClipVectorSource · box3d_collision.odin:467
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 ¶C · b3CloneAndTransformHullSource · box3d_collision.odin:132
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 ¶C · b3CloneHullSource · box3d_collision.odin:129
Deep clone a hull.
ClosestPointToAABB ¶
Get the closest point on an axis-aligned bounding box.
CollideCapsuleAndSphere ¶C · b3CollideCapsuleAndSphereSource · box3d_collision.odin:427
CollideCapsuleAndSphere :: proc "c" ( manifold: ^LocalManifold, capacity: i32, #by_ptr capsuleA: Capsule, #by_ptr sphereB: Sphere, transformBtoA: Transform, ) ---
Collide a capsule and a sphere.
CollideCapsules ¶C · b3CollideCapsulesSource · box3d_collision.odin:433
CollideCapsules :: proc "c" ( manifold: ^LocalManifold, capacity: i32, #by_ptr capsuleA, #by_ptr capsuleB: Capsule, transformBtoA: Transform, ) ---
Collide two capsules.
CollideHullAndCapsule ¶C · b3CollideHullAndCapsuleSource · box3d_collision.odin:436
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 ¶C · b3CollideHullAndSphereSource · box3d_collision.odin:430
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.
CollideHulls ¶C · b3CollideHullsSource · box3d_collision.odin:439
CollideHulls :: proc "c" ( manifold: ^LocalManifold, capacity: i32, #by_ptr hullA: HullData, #by_ptr hullB: HullData, transformBtoA: Transform, cache: ^SATCache, ) ---
Collide two hulls.
CollideSpheres ¶C · b3CollideSpheresSource · box3d_collision.odin:424
CollideSpheres :: proc "c" ( manifold: ^LocalManifold, capacity: i32, #by_ptr sphereA, #by_ptr sphereB: Sphere, transformBtoA: Transform, ) ---
Collide two spheres.
CollideTriangleAndCapsule ¶C · b3CollideTriangleAndCapsuleSource · box3d_collision.odin:442
CollideTriangleAndCapsule :: proc "c" ( manifold: ^LocalManifold, capacity: i32, #by_ptr triangleA: [3][3]f32, #by_ptr capsuleB: Capsule, cache: ^SimplexCache, ) ---
Collide a triangle and capsule. Normal points from triangle to capsule.
CollideTriangleAndHull ¶C · b3CollideTriangleAndHullSource · box3d_collision.odin:445
CollideTriangleAndHull :: proc "c" ( manifold: ^LocalManifold, capacity: i32, v1, v2, v3: [3]f32, triangleFlags: i32, #by_ptr hullB: HullData, cache: ^SATCache, enableSpeculative: bool, ) ---
Collide a triangle and hull. Normal points from triangle to hull.
CollideTriangleAndSphere ¶C · b3CollideTriangleAndSphereSource · box3d_collision.odin:449
CollideTriangleAndSphere :: proc "c" ( manifold: ^LocalManifold, capacity: i32, #by_ptr triangleA: [3][3]f32, #by_ptr sphereB: Sphere, ) ---
Collide a triangle and sphere. Normal points from triangle to sphere.
ComputeCapsuleAABB ¶C · b3ComputeCapsuleAABBSource · box3d_collision.odin:296
Compute the bounding box of a transformed capsule
ComputeCapsuleMass ¶C · b3ComputeCapsuleMassSource · box3d_collision.odin:287
Compute mass properties of a capsule
ComputeCompoundAABB ¶C · b3ComputeCompoundAABBSource · box3d_collision.odin:308
ComputeCompoundAABB :: proc "c" (#by_ptr shape: CompoundData, transform: Transform) -> AABB ---
Compute the bounding box of a compound
ComputeCosSin ¶C · b3ComputeCosSinSource · box3d_math.odin:100
Compute the cosine and sine of an angle in radians. Implemented for cross-platform determinism.
ComputeHeightFieldAABB ¶C · b3ComputeHeightFieldAABBSource · box3d_collision.odin:305
ComputeHeightFieldAABB :: proc "c" ( #by_ptr shape: HeightFieldData, transform: Transform, ) -> AABB ---
Compute the bounding box of a transformed height-field
ComputeHullAABB ¶C · b3ComputeHullAABBSource · box3d_collision.odin:299
Compute the bounding box of a transformed hull
ComputeHullMass ¶C · b3ComputeHullMassSource · box3d_collision.odin:290
Compute mass properties of a hull
ComputeMeshAABB ¶C · b3ComputeMeshAABBSource · box3d_collision.odin:302
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 ¶C · b3ComputeQuatBetweenUnitVectorsSource · box3d_math.odin:149
ComputeQuatBetweenUnitVectors :: proc "c" (v1, v2: [3]f32) -> quaternion128 ---
Find a quaternion that rotates one vector to another.
ComputeSphereAABB ¶C · b3ComputeSphereAABBSource · box3d_collision.odin:293
Compute the bounding box of a transformed sphere
ComputeSphereMass ¶C · b3ComputeSphereMassSource · box3d_collision.odin:284
Compute mass properties of a sphere
Contact_GetData ¶C · b3Contact_GetDataSource · box3d.odin:1866
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 ¶C · b3Contact_IsValidSource · box3d.odin:1863
Contact identifier validation. Provides validation for up to 2^32 allocations.
ConvertBytesToCompound ¶C · b3ConvertBytesToCompoundSource · box3d_collision.odin:274
ConvertBytesToCompound :: proc "c" (bytes: [^]u8, byteCount: i32) -> ^CompoundData ---
Cast the provided bytes to compound data, setting up internal pointers. Use this after de-serializing the compound bytes.
ConvertCompoundToBytes ¶C · b3ConvertCompoundToBytesSource · box3d_collision.odin:270
ConvertCompoundToBytes :: proc "c" (compound: ^CompoundData) -> [^]u8 ---
Cast the provided compound data to bytes, setting the internal pointers to null. Use this before serializing the compound bytes.
CreateBakedCompoundShape ¶C · b3CreateBakedCompoundShapeSource · box3d.odin:951
CreateBakedCompoundShape :: proc "c" ( bodyId: BodyId, #by_ptr def: ShapeDef, compound: ^CompoundData, ) -> ShapeId ---
Baked compound shapes are only allowed on static bodies. Note: runtime compounds are achieved by adding multiple shapes to a body. Runtime compounds can be dynamic and/or kinematic.
CreateBody ¶C · b3CreateBodySource · box3d.odin:610
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.
External examples raylib/box3d
CreateBoxMesh ¶C · b3CreateBoxMeshSource · box3d_collision.odin:192
Create a box mesh.
CreateCapsuleShape ¶C · b3CreateCapsuleShapeSource · box3d.odin:921
CreateCapsuleShape :: proc "c" ( bodyId: BodyId, #by_ptr def: ShapeDef, 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 ¶C · b3CreateCompoundSource · box3d_collision.odin:263
CreateCompound :: proc "c" (#by_ptr def: CompoundDef) -> ^CompoundData ---
Create a compound shape. All input data in the definition is cloned into the resulting compound.
CreateCone ¶C · b3CreateConeSource · box3d_collision.odin:120
Create a tessellated cone as a hull.
CreateCylinder ¶C · b3CreateCylinderSource · box3d_collision.odin:117
Create a tessellated cylinder as a hull.
CreateDistanceJoint ¶C · b3CreateDistanceJointSource · box3d.odin:1267
CreateDistanceJoint :: proc "c" (worldId: WorldId, #by_ptr def: DistanceJointDef) -> JointId ---
Create a distance joint @see DistanceJointDef for details
CreateFilterJoint ¶C · b3CreateFilterJointSource · box3d.odin:1432
CreateFilterJoint :: proc "c" (worldId: WorldId, #by_ptr def: FilterJointDef) -> JointId ---
Create a filter joint. @see FilterJointDef for details
CreateGrid ¶C · b3CreateGridSource · box3d_collision.odin:220
CreateGrid :: proc "c" ( rowCount, columnCount: i32, scale: [3]f32, makeHoles: bool, ) -> ^HeightFieldData ---
Create a grid as a height field.
CreateGridMesh ¶C · b3CreateGridMeshSource · box3d_collision.odin:183
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 ¶C · b3CreateHeightFieldSource · box3d_collision.odin:217
CreateHeightField :: proc "c" (#by_ptr data: HeightFieldDef) -> ^HeightFieldData ---
Create a generic height field.
CreateHeightFieldShape ¶C · b3CreateHeightFieldShapeSource · box3d.odin:946
CreateHeightFieldShape :: proc "c" ( bodyId: BodyId, #by_ptr def: ShapeDef, 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 ¶C · b3CreateHollowBoxMeshSource · box3d_collision.odin:195
Create a hollow box mesh.
CreateHull ¶C · b3CreateHullSource · box3d_collision.odin:126
Create a generic convex hull.
CreateHullShape ¶C · b3CreateHullShapeSource · box3d.odin:926
CreateHullShape :: proc "c" ( bodyId: BodyId, #by_ptr def: ShapeDef, 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
External examples raylib/box3d
CreateMesh ¶C · b3CreateMeshSource · box3d_collision.odin:201
CreateMesh :: proc "c" ( #by_ptr def: MeshDef, degenerateTriangleIndices: [^]i32, degenerateCapacity: i32, ) -> ^MeshData ---
Create a generic mesh.
CreateMeshShape ¶C · b3CreateMeshShapeSource · box3d.odin:939
CreateMeshShape :: proc "c" ( bodyId: BodyId, #by_ptr def: ShapeDef, 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 ¶C · b3CreateMotorJointSource · box3d.odin:1357
CreateMotorJoint :: proc "c" (worldId: WorldId, #by_ptr def: MotorJointDef) -> JointId ---
Create a motor joint @see MotorJointDef for details
CreateParallelJoint ¶C · b3CreateParallelJointSource · box3d.odin:1237
CreateParallelJoint :: proc "c" (worldId: WorldId, #by_ptr def: ParallelJointDef) -> JointId ---
Create a parallel joint @see ParallelJointDef for details
CreatePlatformMesh ¶C · b3CreatePlatformMeshSource · box3d_collision.odin:198
CreatePlatformMesh :: proc "c" ( center: [3]f32, height, topWidth, bottomWidth: f32, ) -> ^MeshData ---
Create a platform mesh. A truncated pyramid.
CreatePrismaticJoint ¶C · b3CreatePrismaticJointSource · box3d.odin:1447
CreatePrismaticJoint :: proc "c" (worldId: WorldId, #by_ptr def: PrismaticJointDef) -> JointId ---
Create a prismatic (slider) joint. @see PrismaticJointDef for details
CreateRecording ¶C · b3CreateRecordingSource · box3d.odin:430
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 ¶C · b3CreateRevoluteJointSource · box3d.odin:1529
CreateRevoluteJoint :: proc "c" (worldId: WorldId, #by_ptr def: RevoluteJointDef) -> JointId ---
Create a revolute joint @see RevoluteJointDef for details
CreateRock ¶C · b3CreateRockSource · box3d_collision.odin:123
Create a rock shaped hull.
CreateSphereShape ¶C · b3CreateSphereShapeSource · box3d.odin:916
CreateSphereShape :: proc "c" ( bodyId: BodyId, #by_ptr def: ShapeDef, 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 ¶C · b3CreateSphericalJointSource · box3d.odin:1607
CreateSphericalJoint :: proc "c" (worldId: WorldId, #by_ptr def: SphericalJointDef) -> JointId ---
Create a spherical joint @see SphericalJointDef for details
CreateTorusMesh ¶C · b3CreateTorusMeshSource · box3d_collision.odin:189
CreateTorusMesh :: proc "c" ( radialResolution: i32, tubularResolution: i32, radius: f32, thickness: f32, ) -> ^MeshData ---
Create a torus mesh.
CreateTransformedHullShape ¶C · b3CreateTransformedHullShapeSource · box3d.odin:932
CreateTransformedHullShape :: proc "c" ( bodyId: BodyId, #by_ptr def: ShapeDef, 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 ¶C · b3CreateWaveSource · box3d_collision.odin:223
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 ¶C · b3CreateWaveMeshSource · box3d_collision.odin:186
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 ¶C · b3CreateWeldJointSource · box3d.odin:1702
CreateWeldJoint :: proc "c" (worldId: WorldId, #by_ptr def: WeldJointDef) -> JointId ---
Create a weld joint @see WeldJointDef for details
CreateWheelJoint ¶C · b3CreateWheelJointSource · box3d.odin:1742
CreateWheelJoint :: proc "c" (worldId: WorldId, #by_ptr def: WheelJointDef) -> JointId ---
Create a wheel joint. @see WheelJointDef for details.
CreateWorld ¶C · b3CreateWorldSource · box3d.odin:207
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.
External examples raylib/box3d
DefaultBodyDef ¶C · b3DefaultBodyDefSource · box3d_types.odin:117
DefaultBodyDef :: proc "c" () -> BodyDef ---
Use this to initialize your body definition @ingroup body
External examples raylib/box3d
DefaultDebugDraw ¶C · b3DefaultDebugDrawSource · box3d_types.odin:183
DefaultDebugDraw :: proc "c" () -> DebugDraw ---
Create a debug draw struct with default values.
DefaultDistanceJointDef ¶C · b3DefaultDistanceJointDefSource · box3d_types.odin:133
DefaultDistanceJointDef :: proc "c" () -> DistanceJointDef ---
Use this to initialize your joint definition @ingroup distance_joint
DefaultExplosionDef ¶C · b3DefaultExplosionDefSource · box3d_types.odin:173
DefaultExplosionDef :: proc "c" () -> ExplosionDef ---
Use this to initialize your explosion definition @ingroup world
DefaultFilter ¶C · b3DefaultFilterSource · box3d_types.odin:121
DefaultFilter :: proc "c" () -> Filter ---
Use this to initialize your filter @ingroup shape
DefaultFilterJointDef ¶C · b3DefaultFilterJointDefSource · box3d_types.odin:141
DefaultFilterJointDef :: proc "c" () -> FilterJointDef ---
Use this to initialize your joint definition @ingroup filter_joint
DefaultMotorJointDef ¶C · b3DefaultMotorJointDefSource · box3d_types.odin:137
DefaultMotorJointDef :: proc "c" () -> MotorJointDef ---
Use this to initialize your joint definition @ingroup motor_joint
DefaultParallelJointDef ¶C · b3DefaultParallelJointDefSource · box3d_types.odin:146
DefaultParallelJointDef :: proc "c" () -> ParallelJointDef ---
Use this to initialize your joint definition @ingroup parallel_joint
DefaultPrismaticJointDef ¶C · b3DefaultPrismaticJointDefSource · box3d_types.odin:151
DefaultPrismaticJointDef :: proc "c" () -> PrismaticJointDef ---
Use this to initialize your joint definition @ingroup prismatic_joint
DefaultQueryFilter ¶C · b3DefaultQueryFilterSource · box3d_types.odin:176
DefaultQueryFilter :: proc "c" () -> QueryFilter ---
Use this to initialize your query filter
DefaultRevoluteJointDef ¶C · b3DefaultRevoluteJointDefSource · box3d_types.odin:156
DefaultRevoluteJointDef :: proc "c" () -> RevoluteJointDef ---
Use this to initialize your joint definition. @ingroup revolute_joint
DefaultShapeDef ¶C · b3DefaultShapeDefSource · box3d_types.odin:129
DefaultShapeDef :: proc "c" () -> ShapeDef ---
Use this to initialize your shape definition @ingroup shape
External examples raylib/box3d
DefaultSphericalJointDef ¶C · b3DefaultSphericalJointDefSource · box3d_types.odin:160
DefaultSphericalJointDef :: proc "c" () -> SphericalJointDef ---
Use this to initialize your joint definition. @ingroup spherical_joint
DefaultSurfaceMaterial ¶C · b3DefaultSurfaceMaterialSource · box3d_types.odin:125
DefaultSurfaceMaterial :: proc "c" () -> SurfaceMaterial ---
Use this to initialize your surface material @ingroup shape
DefaultWeldJointDef ¶C · b3DefaultWeldJointDefSource · box3d_types.odin:165
DefaultWeldJointDef :: proc "c" () -> WeldJointDef ---
Use this to initialize your joint definition @ingroup weld_joint
DefaultWheelJointDef ¶C · b3DefaultWheelJointDefSource · box3d_types.odin:169
DefaultWheelJointDef :: proc "c" () -> WheelJointDef ---
Use this to initialize your joint definition @ingroup wheel_joint
DefaultWorldDef ¶C · b3DefaultWorldDefSource · box3d_types.odin:113
DefaultWorldDef :: proc "c" () -> WorldDef ---
Use this to initialize your world definition @ingroup world
External examples raylib/box3d
DestroyBody ¶C · b3DestroyBodySource · box3d.odin:614
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 ¶C · b3DestroyCompoundSource · box3d_collision.odin:266
DestroyCompound :: proc "c" (compound: ^CompoundData) ---
Destroy a compound shape.
DestroyHeightField ¶C · b3DestroyHeightFieldSource · box3d_collision.odin:226
DestroyHeightField :: proc "c" (heightField: ^HeightFieldData) ---
Destroy a height field.
DestroyHull ¶C · b3DestroyHullSource · box3d_collision.odin:135
DestroyHull :: proc "c" (hull: ^HullData) ---
Destroy a hull.
DestroyJoint ¶C · b3DestroyJointSource · box3d.odin:1152
Destroy a joint
DestroyMesh ¶C · b3DestroyMeshSource · box3d_collision.odin:204
DestroyMesh :: proc "c" (mesh: ^MeshData) ---
Destroy a mesh.
DestroyRecording ¶C · b3DestroyRecordingSource · box3d.odin:434
DestroyRecording :: proc "c" (recording: ^Recording) ---
Destroy a recording and free its buffer. @param recording may be NULL
DestroyShape ¶C · b3DestroyShapeSource · box3d.odin:956
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
DestroyWorld ¶C · b3DestroyWorldSource · box3d.odin:210
DestroyWorld :: proc "c" (worldId: WorldId) ---
Destroy a world
External examples raylib/box3d
Distance ¶
Distance between two points.
DistanceJoint_EnableLimit ¶C · b3DistanceJoint_EnableLimitSource · box3d.odin:1303
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 ¶C · b3DistanceJoint_EnableMotorSource · box3d.odin:1321
Enable/disable the distance joint motor
DistanceJoint_EnableSpring ¶C · b3DistanceJoint_EnableSpringSource · box3d.odin:1278
Enable/disable the distance joint spring. When disabled the distance joint is rigid.
DistanceJoint_GetCurrentLength ¶C · b3DistanceJoint_GetCurrentLengthSource · box3d.odin:1318
Get the current length of a distance joint
DistanceJoint_GetLength ¶C · b3DistanceJoint_GetLengthSource · box3d.odin:1275
Get the rest length of a distance joint
DistanceJoint_GetMaxLength ¶C · b3DistanceJoint_GetMaxLengthSource · box3d.odin:1315
Get the distance joint maximum length
DistanceJoint_GetMaxMotorForce ¶C · b3DistanceJoint_GetMaxMotorForceSource · box3d.odin:1336
Get the distance joint maximum motor force, usually in newtons
DistanceJoint_GetMinLength ¶C · b3DistanceJoint_GetMinLengthSource · box3d.odin:1312
Get the distance joint minimum length
DistanceJoint_GetMotorForce ¶C · b3DistanceJoint_GetMotorForceSource · box3d.odin:1339
Get the distance joint current motor force, usually in newtons
DistanceJoint_GetMotorSpeed ¶C · b3DistanceJoint_GetMotorSpeedSource · box3d.odin:1330
Get the distance joint motor speed, usually in meters per second
DistanceJoint_GetSpringDampingRatio ¶C · b3DistanceJoint_GetSpringDampingRatioSource · box3d.odin:1299
Get the spring damping ratio
DistanceJoint_GetSpringForceRange ¶C · b3DistanceJoint_GetSpringForceRangeSource · box3d.odin:1287
Get the force range for the spring.
DistanceJoint_GetSpringHertz ¶C · b3DistanceJoint_GetSpringHertzSource · box3d.odin:1296
Get the spring Hertz
DistanceJoint_IsLimitEnabled ¶C · b3DistanceJoint_IsLimitEnabledSource · box3d.odin:1306
Is the distance joint limit enabled?
DistanceJoint_IsMotorEnabled ¶C · b3DistanceJoint_IsMotorEnabledSource · box3d.odin:1324
Is the distance joint motor enabled?
DistanceJoint_IsSpringEnabled ¶C · b3DistanceJoint_IsSpringEnabledSource · box3d.odin:1281
Is the distance joint spring enabled?
DistanceJoint_SetLength ¶C · b3DistanceJoint_SetLengthSource · box3d.odin:1272
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 ¶C · b3DistanceJoint_SetLengthRangeSource · box3d.odin:1309
Set the minimum and maximum length parameters of a distance joint
DistanceJoint_SetMaxMotorForce ¶C · b3DistanceJoint_SetMaxMotorForceSource · box3d.odin:1333
Set the distance joint maximum motor force, usually in newtons
DistanceJoint_SetMotorSpeed ¶C · b3DistanceJoint_SetMotorSpeedSource · box3d.odin:1327
Set the distance joint motor speed, usually in meters per second
DistanceJoint_SetSpringDampingRatio ¶C · b3DistanceJoint_SetSpringDampingRatioSource · box3d.odin:1293
Set the spring damping ratio, non-dimensional
DistanceJoint_SetSpringForceRange ¶C · b3DistanceJoint_SetSpringForceRangeSource · box3d.odin:1284
Set the force range for the spring.
DistanceJoint_SetSpringHertz ¶C · b3DistanceJoint_SetSpringHertzSource · box3d.odin:1290
Set the spring stiffness in Hertz
DistanceSquared ¶
Squared distance between two points.
DumpHeightData ¶C · b3DumpHeightDataSource · box3d_collision.odin:229
DumpHeightData :: proc "c" (#by_ptr data: HeightFieldDef, fileName: cstring) ---
Save input height data to a file
DynamicTree_BoxCast ¶C · b3DynamicTree_BoxCastSource · box3d_collision.odin:76
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 aganist the query origin. Used by the large world spatial queries so the tree traversal stays float while the narrow phase stays precise.
DynamicTree_Create ¶C · b3DynamicTree_CreateSource · box3d_collision.odin:17
DynamicTree_Create :: proc "c" (proxyCapacity: i32) -> DynamicTree ---
Constructing the tree initializes the node pool.
DynamicTree_CreateProxy ¶C · b3DynamicTree_CreateProxySource · box3d_collision.odin:23
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 ¶C · b3DynamicTree_DestroySource · box3d_collision.odin:20
DynamicTree_Destroy :: proc "c" (tree: ^DynamicTree) ---
Destroy the tree, freeing the node pool.
DynamicTree_DestroyProxy ¶C · b3DynamicTree_DestroyProxySource · box3d_collision.odin:26
DynamicTree_DestroyProxy :: proc "c" (tree: ^DynamicTree, proxyId: i32) ---
Destroy a proxy. This asserts if the id is invalid.
DynamicTree_EnlargeProxy ¶C · b3DynamicTree_EnlargeProxySource · box3d_collision.odin:32
DynamicTree_EnlargeProxy :: proc "c" (tree: ^DynamicTree, proxyId: i32, aabb: AABB) ---
Enlarge a proxy and enlarge ancestors as necessary.
DynamicTree_GetAABB ¶
@(require_results) DynamicTree_GetAABB :: proc "c" (#by_ptr tree: DynamicTree, proxyId: i32) -> AABB {…}
Get the AABB of a proxy
DynamicTree_GetAreaRatio ¶C · b3DynamicTree_GetAreaRatioSource · box3d_collision.odin:85
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 ¶C · b3DynamicTree_GetByteCountSource · box3d_collision.odin:97
DynamicTree_GetByteCount :: proc "c" (#by_ptr tree: DynamicTree) -> i32 ---
Get the number of bytes used by this tree
DynamicTree_GetCategoryBits ¶C · b3DynamicTree_GetCategoryBitsSource · box3d_collision.odin:38
DynamicTree_GetCategoryBits :: proc "c" (tree: ^DynamicTree, proxyId: i32) -> u64 ---
Get the category bits on a proxy.
DynamicTree_GetHeight ¶C · b3DynamicTree_GetHeightSource · box3d_collision.odin:82
DynamicTree_GetHeight :: proc "c" (#by_ptr tree: DynamicTree) -> i32 ---
Get the height of the binary tree.
DynamicTree_GetProxyCount ¶C · b3DynamicTree_GetProxyCountSource · box3d_collision.odin:91
DynamicTree_GetProxyCount :: proc "c" (#by_ptr tree: DynamicTree) -> i32 ---
Get the number of proxies created
DynamicTree_GetRootBounds ¶C · b3DynamicTree_GetRootBoundsSource · box3d_collision.odin:88
DynamicTree_GetRootBounds :: proc "c" (#by_ptr tree: DynamicTree) -> AABB ---
Get the bounding box that contains the entire tree
DynamicTree_GetUserData ¶
@(require_results) DynamicTree_GetUserData :: proc "c" (#by_ptr tree: DynamicTree, proxyId: i32) -> u64 {…}
Get proxy user data
DynamicTree_Load ¶C · b3DynamicTree_LoadSource · box3d_collision.odin:106
DynamicTree_Load :: proc "c" (fileName: cstring, scale: f32) -> DynamicTree ---
Load a file for debugging
DynamicTree_MoveProxy ¶C · b3DynamicTree_MoveProxySource · box3d_collision.odin:29
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 ¶C · b3DynamicTree_QuerySource · box3d_collision.odin:42
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 ¶C · b3DynamicTree_QueryClosestSource · box3d_collision.odin:55
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 ¶C · b3DynamicTree_RayCastSource · box3d_collision.odin:71
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 ¶C · b3DynamicTree_RebuildSource · box3d_collision.odin:94
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 ¶C · b3DynamicTree_SaveSource · box3d_collision.odin:103
DynamicTree_Save :: proc "c" (#by_ptr tree: DynamicTree, fileName: cstring) ---
Save this tree to a file for debugging
DynamicTree_SetCategoryBits ¶C · b3DynamicTree_SetCategoryBitsSource · box3d_collision.odin:35
DynamicTree_SetCategoryBits :: proc "c" (tree: ^DynamicTree, proxyId: i32, categoryBits: u64) ---
Modify the category bits on a proxy. This is an expensive operation.
DynamicTree_Validate ¶C · b3DynamicTree_ValidateSource · box3d_collision.odin:79
DynamicTree_Validate :: proc "c" (#by_ptr tree: DynamicTree) ---
Validate this tree. For testing.
DynamicTree_ValidateNoEnlarged ¶C · b3DynamicTree_ValidateNoEnlargedSource · box3d_collision.odin:100
DynamicTree_ValidateNoEnlarged :: proc "c" (#by_ptr tree: DynamicTree) ---
Validate this tree has no enlarged AABBs. For testing.
GetAxisAngle ¶
@(require_results) GetAxisAngle :: proc "c" (q: quaternion128) -> (radians: f32, axis: [3]f32) {…}
Get the axis and angle from a quaternion. Assumes the quaternion is normalized.
External examples raylib/box3d
GetByteCount ¶C · b3GetByteCountSource · box3d.odin:63
GetByteCount :: proc "c" () -> i32 ---
Total bytes allocated by Box3D
GetCompoundCapsule ¶C · b3GetCompoundCapsuleSource · box3d_collision.odin:248
GetCompoundCapsule :: proc "c" (#by_ptr compound: CompoundData, index: i32) -> CompoundCapsule ---
Access a child capsule by index.
GetCompoundChild ¶C · b3GetCompoundChildSource · box3d_collision.odin:242
GetCompoundChild :: proc "c" (#by_ptr compound: CompoundData, childIndex: i32) -> ChildShape ---
Get a child shape of a compound.
GetCompoundHull ¶C · b3GetCompoundHullSource · box3d_collision.odin:251
GetCompoundHull :: proc "c" (#by_ptr compound: CompoundData, index: i32) -> CompoundHull ---
Access a child hull by index.
GetCompoundMaterials ¶C · b3GetCompoundMaterialsSource · box3d_collision.odin:260
GetCompoundMaterials :: proc "c" (#by_ptr compound: CompoundData) -> ^SurfaceMaterial ---
Access the compound material array.
GetCompoundMesh ¶C · b3GetCompoundMeshSource · box3d_collision.odin:254
GetCompoundMesh :: proc "c" (#by_ptr compound: CompoundData, index: i32) -> CompoundMesh ---
Access a child mesh by index.
GetCompoundSphere ¶C · b3GetCompoundSphereSource · box3d_collision.odin:257
GetCompoundSphere :: proc "c" (#by_ptr compound: CompoundData, index: i32) -> CompoundSphere ---
Access a child sphere by index.
GetGraphColor ¶C · b3GetGraphColorSource · box3d_types.odin:180
Get the visualization color assigned to a constraint graph color slot. The last index (B3_GRAPH_COLOR_COUNT - 1) is the overflow color.
GetHeight ¶C · b3GetHeightSource · box3d_collision.odin:207
Get the height of the mesh BVH.
GetHeightFieldCompressedHeights ¶
@(require_results) GetHeightFieldCompressedHeights :: proc "c" (hf: ^HeightFieldData) -> [^]u16 {…}
Get read only compressed heights. One u16 per grid point.
GetHeightFieldFlags ¶
@(require_results) GetHeightFieldFlags :: proc "c" (hf: ^HeightFieldData) -> [^]u8 {…}
Get read only triangle flags. One u8 per triangle.
GetHeightFieldMaterialIndices ¶
@(require_results) GetHeightFieldMaterialIndices :: proc "c" (hf: ^HeightFieldData) -> [^]u8 {…}
Get read only material indices. One u8 per cell.
GetHullEdges ¶
@(require_results) GetHullEdges :: proc "c" (hull: ^HullData) -> runtime.Maybe($T=^HullHalfEdge) {…}
Get read only hull half edges.
GetHullFaces ¶
Get read only hull faces.
GetHullPlanes ¶
Get read only hull planes.
GetHullPoints ¶
Get read only hull points.
GetHullSoaNormals ¶
Get read only SOA unit normal vectors. This is an array of normals with all x values, y values, and z values as separate arrays. The array lengths are padded to a multiple of 4. The padded values are repeats of the first value.
GetHullSoaVertices ¶
Get read only SOA vertices. This is an array of vertices with all x values, y values, and z values as separate arrays. The array lengths are padded to a multiple of 4. The padded values are repeats of the first value.
GetHullVertices ¶
@(require_results) GetHullVertices :: proc "c" (hull: ^HullData) -> runtime.Maybe($T=^HullVertex) {…}
Get read only hull vertices.
GetLengthAndNormalize ¶
Normalize a vector and return the length. Returns a zero vector if the input is very small.
GetLengthUnitsPerMeter ¶C · b3GetLengthUnitsPerMeterSource · box3d_constants.odin:13
GetLengthUnitsPerMeter :: proc "c" () -> f32 ---
Get the current length units per meter.
GetMaxWorldCount ¶C · b3GetMaxWorldCountSource · box3d.odin:216
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 ¶
@(require_results) GetMeshMaterialIndices :: proc "c" (mesh: ^MeshData) -> runtime.Maybe($T=[^]u8) {…}
Get read only mesh materials. The count is equal to the triangle count.
GetMeshNodes ¶
Get read only mesh BVH nodes.
GetMeshTriangles ¶
@(require_results) GetMeshTriangles :: proc "c" (mesh: ^MeshData) -> runtime.Maybe($T=^MeshTriangle) {…}
Get read only mesh triangles.
GetMeshVertices ¶
Get read only mesh vertices.
GetMilliseconds ¶C · b3GetMillisecondsSource · box3d.odin:103
Get the milliseconds passed from an initial tick value.
GetMillisecondsAndReset ¶C · b3GetMillisecondsAndResetSource · box3d.odin:106
Get the milliseconds passed from an initial tick value.
GetQuatAngle ¶
@(require_results) GetQuatAngle :: proc "c" (q: quaternion128) -> f32 {…}
Get the angle for a quaternion in radians
GetStallThreshold ¶C · b3GetStallThresholdSource · box3d_constants.odin:19
GetStallThreshold :: proc "c" () -> f32 ---
Get the threshold for logging stalls.
GetSweepTransform ¶C · b3GetSweepTransformSource · box3d_collision.odin:408
Evaluate the transform sweep at a specific time.
GetSwingAngle ¶
@(require_results) GetSwingAngle :: proc "c" (q: quaternion128) -> f32 {…}
Swing angle used for cone limit
GetTicks ¶C · b3GetTicksSource · box3d.odin:100
GetTicks :: proc "c" () -> u64 ---
Get the absolute number of system ticks. The value is platform specific.
GetTwistAngle ¶
@(require_results) GetTwistAngle :: proc "c" (q: quaternion128) -> f32 {…}
Twist angle around the z-axis, used for twist limit and revolute angle limit
GetVersion ¶C · b3GetVersionSource · box3d.odin:94
GetVersion :: proc "c" () -> Version ---
Get the current version of Box3D
GetWorldCount ¶C · b3GetWorldCountSource · box3d.odin:213
GetWorldCount :: proc "c" () -> i32 ---
Get the current number of worlds
HUGE ¶
@(require_results) 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 ¶C · b3HashSource · box3d.odin:115
Simple djb2 hash function for determinism testing
ID_EQUALS ¶
@(require_results) 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 ¶
@(require_results) IS_NON_NULL :: proc "c" (id: $T) -> bool {…}
/ Macro to determine if any id is non-null.
IS_NULL ¶
@(require_results) IS_NULL :: proc "c" (id: $T) -> bool {…}
/ Macro to determine if any id is null.
InternalAssert ¶C · b3InternalAssertSource · box3d.odin:70
Internal assertion handler. Allows for host intervention.
InvMulQuat ¶
@(require_results) 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 ¶
@(require_results) InvMulWorldTransforms :: proc "c" (A, B: WorldTransform) -> (C: Transform) {…}
Relative transform of frame B in frame A. The narrow phase boundary.
InvRotateVector ¶
@(require_results) InvRotateVector :: proc "c" (q: quaternion128, v: [3]f32) -> [3]f32 {…}
Inverse rotate a vector.
InvTransformPoint ¶
Inverse transform a point.
InvTransformWorldPoint ¶
@(require_results) 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.
InvertT ¶
Invert a matrix.
InvertTransform ¶
Get the inverse of a transform.
IsBoundedAABB ¶C · b3IsBoundedAABBSource · box3d_math.odin:127
Is this AABB reasonably close to the origin? See B3_HUGE.
IsDoublePrecision ¶C · b3IsDoublePrecisionSource · box3d.odin:97
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 ¶
@(require_results) IsNormalizedQuat :: proc "c" (q: quaternion128) -> bool {…}
Does the supplied quaternion have unit length?
IsSaneAABB ¶C · b3IsSaneAABBSource · box3d_math.odin:130
Is this AABB valid and reasonable?
IsValidAABB ¶C · b3IsValidAABBSource · box3d_math.odin:124
Is this a valid bounding box? Not Nan or infinity. Upper bound greater than or equal to lower bound.
IsValidMatrix3 ¶C · b3IsValidMatrix3Source · box3d_math.odin:121
Is this a valid matrix? Not NaN or infinity.
IsValidPlane ¶C · b3IsValidPlaneSource · box3d_math.odin:133
Is this a valid plane? Normal is a unit vector. Not Nan or infinity.
IsValidPosition ¶C · b3IsValidPositionSource · box3d_math.odin:136
Is this a valid world position? Not NaN or infinity.
IsValidQuat ¶C · b3IsValidQuatSource · box3d_math.odin:115
IsValidQuat :: proc "c" (q: quaternion128) -> bool ---
Is this a valid quaternion? Not NaN or infinity. Is normalized.
IsValidRay ¶C · b3IsValidRaySource · box3d_collision.odin:318
IsValidRay :: proc "c" (#by_ptr input: RayCastInput) -> bool ---
Use this to ensure your ray cast input is valid and avoid internal assertions.
IsValidTransform ¶C · b3IsValidTransformSource · box3d_math.odin:118
Is this a valid transform? Not NaN or infinity. Is normalized.
IsValidVec3 ¶C · b3IsValidVec3Source · box3d_math.odin:112
Is this a valid vector? Not NaN or infinity.
IsValidWorldTransform ¶C · b3IsValidWorldTransformSource · box3d_math.odin:139
IsValidWorldTransform :: proc "c" (t: WorldTransform) -> bool ---
Is this a valid world transform? Not NaN or infinity. Rotation is normalized.
Joint_GetAngularSeparation ¶C · b3Joint_GetAngularSeparationSource · box3d.odin:1206
Get the current angular separation error for this joint. Does not consider admissible movement. Usually in radians.
Joint_GetBodyA ¶C · b3Joint_GetBodyASource · box3d.odin:1161
Get body A id on a joint
Joint_GetBodyB ¶C · b3Joint_GetBodyBSource · box3d.odin:1164
Get body B id on a joint
Joint_GetCollideConnected ¶C · b3Joint_GetCollideConnectedSource · box3d.odin:1185
Is collision allowed between connected bodies?
Joint_GetConstraintForce ¶C · b3Joint_GetConstraintForceSource · box3d.odin:1197
Get the current constraint force for this joint
Joint_GetConstraintTorque ¶C · b3Joint_GetConstraintTorqueSource · box3d.odin:1200
Get the current constraint torque for this joint
Joint_GetConstraintTuning ¶C · b3Joint_GetConstraintTuningSource · box3d.odin:1215
Get the joint constraint tuning. Advanced feature.
Joint_GetForceThreshold ¶C · b3Joint_GetForceThresholdSource · box3d.odin:1221
Get the force threshold for joint events (Newtons)
Joint_GetLinearSeparation ¶C · b3Joint_GetLinearSeparationSource · box3d.odin:1203
Get the current linear separation error for this joint. Does not consider admissible movement. Usually in meters.
Joint_GetLocalFrameA ¶C · b3Joint_GetLocalFrameASource · box3d.odin:1173
Get the local frame on bodyA
Joint_GetLocalFrameB ¶C · b3Joint_GetLocalFrameBSource · box3d.odin:1179
Get the local frame on bodyB
Joint_GetTorqueThreshold ¶C · b3Joint_GetTorqueThresholdSource · box3d.odin:1227
Get the torque threshold for joint events (N-m)
Joint_GetType ¶C · b3Joint_GetTypeSource · box3d.odin:1158
Get the joint type
Joint_GetUserData ¶C · b3Joint_GetUserDataSource · box3d.odin:1191
Get the user data on a joint
Joint_GetWorld ¶C · b3Joint_GetWorldSource · box3d.odin:1167
Get the world that owns this joint
Joint_IsValid ¶C · b3Joint_IsValidSource · box3d.odin:1155
Joint identifier validation. Provides validation for up to 64K allocations.
Joint_SetCollideConnected ¶C · b3Joint_SetCollideConnectedSource · box3d.odin:1182
Toggle collision between connected bodies
Joint_SetConstraintTuning ¶C · b3Joint_SetConstraintTuningSource · box3d.odin:1212
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 ¶C · b3Joint_SetForceThresholdSource · box3d.odin:1218
Set the force threshold for joint events (Newtons)
Joint_SetLocalFrameA ¶C · b3Joint_SetLocalFrameASource · box3d.odin:1170
Set the local frame on bodyA
Joint_SetLocalFrameB ¶C · b3Joint_SetLocalFrameBSource · box3d.odin:1176
Set the local frame on bodyB
Joint_SetTorqueThreshold ¶C · b3Joint_SetTorqueThresholdSource · box3d.odin:1224
Set the torque threshold for joint events (N-m)
Joint_SetUserData ¶C · b3Joint_SetUserDataSource · box3d.odin:1188
Set the user data on a joint
Joint_WakeBodies ¶C · b3Joint_WakeBodiesSource · box3d.odin:1194
Joint_WakeBodies :: proc "c" (jointId: JointId) ---
Wake the bodies connect to this joint
LINEAR_SLOP ¶
@(require_results) 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
LerpFloat ¶
LerpFloat :: math.lerp
LerpPosition ¶
LerpPosition :: linalg.lerp
LineDistance ¶C · b3LineDistanceSource · box3d_math.odin:106
LineDistance :: proc "c" (p1, d1: [3]f32, p2, d2: [3]f32) -> SegmentDistanceResult ---
Compute the closest points on two infinite lines.
LoadBodyId ¶
/ Load a u64 into a body id.
LoadContactId ¶
/ Load a contact id from three uint32 values.
LoadHeightField ¶C · b3LoadHeightFieldSource · box3d_collision.odin:232
LoadHeightField :: proc "c" (fileName: cstring) -> ^HeightFieldData ---
Create a height field by loading a previously saved height data
LoadJointId ¶
/ Load a u64 into a joint id.
LoadRecordingFromFile ¶C · b3LoadRecordingFromFileSource · box3d.odin:465
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
LoadShapeId ¶
/ Load a u64 into a shape id.
LoadWorldId ¶
/ Load a u32 into a world id.
MAX_AABB_MARGIN ¶
@(require_results) 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 ¶
@(require_results) 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 ¶
@(require_results) MIN_CAPSULE_LENGTH :: proc "c" () -> f32 {…}
MakeAABB ¶
Get the AABB of a point cloud.
MakeBoxHull ¶C · b3MakeBoxHullSource · box3d_collision.odin:141
Make a box as a hull. Do not call DestroyHull on this.
External examples raylib/box3d
MakeCubeHull ¶C · b3MakeCubeHullSource · box3d_collision.odin:138
Make a cube as a hull. Do not call DestroyHull on this.
External examples raylib/box3d
MakeDebugColor ¶
@(require_results) 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 ¶
@(require_results) 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 ¶C · b3MakeOffsetBoxHullSource · box3d_collision.odin:144
Make an offset box as a hull. Do not call DestroyHull on this.
MakeQuatFromAxisAngle ¶
@(require_results) 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 ¶C · b3MakeQuatFromMatrixSource · box3d_math.odin:146
MakeQuatFromMatrix :: proc "c" (m: matrix[3, 3]f32) -> quaternion128 ---
Extract a quaternion from a rotation matrix.
MakeScaledBoxHull ¶C · b3MakeScaledBoxHullSource · box3d_collision.odin:158
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 ¶C · b3MakeTransformedBoxHullSource · box3d_collision.odin:149
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 ¶
@(require_results) 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 ¶C · b3MotorJoint_GetAngularDampingRatioSource · box3d.odin:1405
Get the spring angular damping ratio.
MotorJoint_GetAngularHertz ¶C · b3MotorJoint_GetAngularHertzSource · box3d.odin:1399
Get the spring angular hertz stiffness
MotorJoint_GetAngularVelocity ¶C · b3MotorJoint_GetAngularVelocitySource · box3d.odin:1369
Get the desired relative angular velocity in radians per second
MotorJoint_GetLinearDampingRatio ¶C · b3MotorJoint_GetLinearDampingRatioSource · box3d.odin:1393
Get the spring linear damping ratio.
MotorJoint_GetLinearHertz ¶C · b3MotorJoint_GetLinearHertzSource · box3d.odin:1387
Get the spring linear hertz stiffness
MotorJoint_GetLinearVelocity ¶C · b3MotorJoint_GetLinearVelocitySource · box3d.odin:1363
Get the desired relative linear velocity in meters per second
MotorJoint_GetMaxSpringForce ¶C · b3MotorJoint_GetMaxSpringForceSource · box3d.odin:1411
Get the maximum spring force in newtons.
MotorJoint_GetMaxSpringTorque ¶C · b3MotorJoint_GetMaxSpringTorqueSource · box3d.odin:1417
Get the maximum spring torque in newtons * meters
MotorJoint_GetMaxVelocityForce ¶C · b3MotorJoint_GetMaxVelocityForceSource · box3d.odin:1375
Get the motor joint maximum force, usually in newtons
MotorJoint_GetMaxVelocityTorque ¶C · b3MotorJoint_GetMaxVelocityTorqueSource · box3d.odin:1381
Get the motor joint maximum torque, usually in newton-meters
MotorJoint_SetAngularDampingRatio ¶C · b3MotorJoint_SetAngularDampingRatioSource · box3d.odin:1402
Set the spring angular damping ratio. Use 1.0 for critical damping.
MotorJoint_SetAngularHertz ¶C · b3MotorJoint_SetAngularHertzSource · box3d.odin:1396
Set the spring angular hertz stiffness
MotorJoint_SetAngularVelocity ¶C · b3MotorJoint_SetAngularVelocitySource · box3d.odin:1366
Set the desired relative angular velocity in radians per second
MotorJoint_SetLinearDampingRatio ¶C · b3MotorJoint_SetLinearDampingRatioSource · box3d.odin:1390
Set the spring linear damping ratio. Use 1.0 for critical damping.
MotorJoint_SetLinearHertz ¶C · b3MotorJoint_SetLinearHertzSource · box3d.odin:1384
Set the spring linear hertz stiffness
MotorJoint_SetLinearVelocity ¶C · b3MotorJoint_SetLinearVelocitySource · box3d.odin:1360
Set the desired relative linear velocity in meters per second
MotorJoint_SetMaxSpringForce ¶C · b3MotorJoint_SetMaxSpringForceSource · box3d.odin:1408
Set the maximum spring force in newtons.
MotorJoint_SetMaxSpringTorque ¶C · b3MotorJoint_SetMaxSpringTorqueSource · box3d.odin:1414
Set the maximum spring torque in newtons * meters
MotorJoint_SetMaxVelocityForce ¶C · b3MotorJoint_SetMaxVelocityForceSource · box3d.odin:1372
Set the motor joint maximum force, usually in newtons
MotorJoint_SetMaxVelocityTorque ¶C · b3MotorJoint_SetMaxVelocityTorqueSource · box3d.odin:1378
Set the motor joint maximum torque, usually in newton-meters
MulQuat ¶
@(require_results) 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 ¶
@(require_results) MulWorldTransforms :: proc "c" (A: WorldTransform, B: Transform) -> (C: WorldTransform) {…}
Compose a world transform with a local transform.
NLerp ¶
@(require_results) NLerp :: proc "c" (q1, q2: quaternion128, alpha: f32) -> quaternion128 {…}
Linearly interpolate and normalize between two quaternions
NegateQuat ¶
@(require_results) 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 ¶
@(require_results) NormalizeQuat :: proc "c" (q: quaternion128) -> quaternion128 {…}
Normalize a quaternion.
OVERLAP_SLOP ¶
@(require_results) 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.
OffsetPos ¶
p + d
OverlapCapsule ¶C · b3OverlapCapsuleSource · box3d_collision.odin:321
OverlapCapsule :: proc "c" ( #by_ptr shape: Capsule, shapeTransform: Transform, #by_ptr proxy: ShapeProxy, ) -> bool ---
Overlap shape versus capsule
OverlapCompound ¶C · b3OverlapCompoundSource · box3d_collision.odin:324
OverlapCompound :: proc "c" ( #by_ptr shape: CompoundData, shapeTransform: Transform, #by_ptr proxy: ShapeProxy, ) -> bool ---
Overlap shape versus compound
OverlapHeightField ¶C · b3OverlapHeightFieldSource · box3d_collision.odin:327
OverlapHeightField :: proc "c" ( #by_ptr shape: HeightFieldData, shapeTransform: Transform, #by_ptr proxy: ShapeProxy, ) -> bool ---
Overlap shape versus height field
OverlapHull ¶C · b3OverlapHullSource · box3d_collision.odin:330
OverlapHull :: proc "c" ( #by_ptr shape: HullData, shapeTransform: Transform, #by_ptr proxy: ShapeProxy, ) -> bool ---
Overlap shape versus hull
OverlapMesh ¶C · b3OverlapMeshSource · box3d_collision.odin:333
OverlapMesh :: proc "c" ( #by_ptr shape: Mesh, shapeTransform: Transform, #by_ptr proxy: ShapeProxy, ) -> bool ---
Overlap shape versus mesh
OverlapSphere ¶C · b3OverlapSphereSource · box3d_collision.odin:336
OverlapSphere :: proc "c" ( #by_ptr shape: Sphere, shapeTransform: Transform, #by_ptr proxy: ShapeProxy, ) -> bool ---
Overlap shape versus sphere
ParallelJoint_GetMaxTorque ¶C · b3ParallelJoint_GetMaxTorqueSource · box3d.odin:1255
Get the maximum spring torque, usually in newton-meters
ParallelJoint_GetSpringDampingRatio ¶C · b3ParallelJoint_GetSpringDampingRatioSource · box3d.odin:1249
Get the spring damping ratio
ParallelJoint_GetSpringHertz ¶C · b3ParallelJoint_GetSpringHertzSource · box3d.odin:1246
Get the spring Hertz
ParallelJoint_SetMaxTorque ¶C · b3ParallelJoint_SetMaxTorqueSource · box3d.odin:1252
Set the maximum spring torque, usually in newton-meters
ParallelJoint_SetSpringDampingRatio ¶C · b3ParallelJoint_SetSpringDampingRatioSource · box3d.odin:1243
Set the spring damping ratio, non-dimensional
ParallelJoint_SetSpringHertz ¶C · b3ParallelJoint_SetSpringHertzSource · box3d.odin:1240
Set the spring stiffness in Hertz
Perp ¶
Get a unit vector that is perpendicular to the supplied vector.
PointToSegmentDistance ¶C · b3PointToSegmentDistanceSource · box3d_math.odin:103
Compute the closest point on the segment a-b to the target q.
PrismaticJoint_EnableLimit ¶C · b3PrismaticJoint_EnableLimitSource · box3d.odin:1476
Enable/disable a prismatic joint limit
PrismaticJoint_EnableMotor ¶C · b3PrismaticJoint_EnableMotorSource · box3d.odin:1491
Enable/disable a prismatic joint motor
PrismaticJoint_EnableSpring ¶C · b3PrismaticJoint_EnableSpringSource · box3d.odin:1450
Enable/disable the joint spring.
PrismaticJoint_GetLowerLimit ¶C · b3PrismaticJoint_GetLowerLimitSource · box3d.odin:1482
Get the prismatic joint lower limit
PrismaticJoint_GetMaxMotorForce ¶C · b3PrismaticJoint_GetMaxMotorForceSource · box3d.odin:1506
Get the prismatic joint maximum motor force, usually in newtons
PrismaticJoint_GetMotorForce ¶C · b3PrismaticJoint_GetMotorForceSource · box3d.odin:1509
Get the prismatic joint current motor force, usually in newtons
PrismaticJoint_GetMotorSpeed ¶C · b3PrismaticJoint_GetMotorSpeedSource · box3d.odin:1500
Get the prismatic joint motor speed, usually in meters per second
PrismaticJoint_GetSpeed ¶C · b3PrismaticJoint_GetSpeedSource · box3d.odin:1515
Get the current joint translation speed, usually in meters per second.
PrismaticJoint_GetSpringDampingRatio ¶C · b3PrismaticJoint_GetSpringDampingRatioSource · box3d.odin:1467
Get the prismatic spring damping ratio (non-dimensional)
PrismaticJoint_GetSpringHertz ¶C · b3PrismaticJoint_GetSpringHertzSource · box3d.odin:1461
Get the prismatic joint stiffness in Hertz
PrismaticJoint_GetTargetTranslation ¶C · b3PrismaticJoint_GetTargetTranslationSource · box3d.odin:1473
Get the prismatic joint target translation. Usually in meters.
PrismaticJoint_GetTranslation ¶C · b3PrismaticJoint_GetTranslationSource · box3d.odin:1512
Get the current joint translation, usually in meters.
PrismaticJoint_GetUpperLimit ¶C · b3PrismaticJoint_GetUpperLimitSource · box3d.odin:1485
Get the prismatic joint upper limit
PrismaticJoint_IsLimitEnabled ¶C · b3PrismaticJoint_IsLimitEnabledSource · box3d.odin:1479
Is the prismatic joint limit enabled?
PrismaticJoint_IsMotorEnabled ¶C · b3PrismaticJoint_IsMotorEnabledSource · box3d.odin:1494
Is the prismatic joint motor enabled?
PrismaticJoint_IsSpringEnabled ¶C · b3PrismaticJoint_IsSpringEnabledSource · box3d.odin:1453
Is the prismatic joint spring enabled or not?
PrismaticJoint_SetLimits ¶C · b3PrismaticJoint_SetLimitsSource · box3d.odin:1488
Set the prismatic joint limits
PrismaticJoint_SetMaxMotorForce ¶C · b3PrismaticJoint_SetMaxMotorForceSource · box3d.odin:1503
Set the prismatic joint maximum motor force, usually in newtons
PrismaticJoint_SetMotorSpeed ¶C · b3PrismaticJoint_SetMotorSpeedSource · box3d.odin:1497
Set the prismatic joint motor speed, usually in meters per second
PrismaticJoint_SetSpringDampingRatio ¶C · b3PrismaticJoint_SetSpringDampingRatioSource · box3d.odin:1464
Set the prismatic joint damping ratio (non-dimensional)
PrismaticJoint_SetSpringHertz ¶C · b3PrismaticJoint_SetSpringHertzSource · box3d.odin:1458
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 ¶C · b3PrismaticJoint_SetTargetTranslationSource · box3d.odin:1470
Set the prismatic joint target translation. Usually in meters.
QueryCompound ¶C · b3QueryCompoundSource · box3d_collision.odin:245
QueryCompound :: proc "c" ( #by_ptr compound: CompoundData, aabb: AABB, fcn: CompoundQueryFcn, ctx: rawptr, ) ---
Query a compound shape for children that overlap an AABB.
QueryHeightField ¶C · b3QueryHeightFieldSource · box3d_collision.odin:395
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 ¶C · b3QueryMeshSource · box3d_collision.odin:388
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 ¶C · b3RayCastCapsuleSource · box3d_collision.odin:348
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 ¶C · b3RayCastCompoundSource · box3d_collision.odin:352
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 ¶C · b3RayCastHeightFieldSource · box3d_collision.odin:362
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 ¶C · b3RayCastHollowSphereSource · box3d_collision.odin:344
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 ¶C · b3RayCastHullSource · box3d_collision.odin:356
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 ¶C · b3RayCastMeshSource · box3d_collision.odin:359
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 ¶C · b3RayCastSphereSource · box3d_collision.odin:340
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 ¶C · b3RecPlayer_CreateSource · box3d.odin:483
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 ¶C · b3RecPlayer_DestroySource · box3d.odin:486
RecPlayer_Destroy :: proc "c" (player: ^RecPlayer) ---
Destroy the player and free all memory. Restores the previous global length scale.
RecPlayer_DrawFrameQueries ¶C · b3RecPlayer_DrawFrameQueriesSource · box3d.odin:581
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 ¶C · b3RecPlayer_GetBodyCountSource · box3d.odin:558
@return the number of bodies tracked in creation order (including holes for destroyed bodies)
RecPlayer_GetBodyId ¶C · b3RecPlayer_GetBodyIdSource · box3d.odin:562
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 ¶C · b3RecPlayer_GetDivergeFrameSource · box3d.odin:527
@return the first frame at which replay diverged, or -1 if it has not diverged
RecPlayer_GetFrame ¶C · b3RecPlayer_GetFrameSource · box3d.odin:509
@return the last fully-stepped frame index (0 before any step)
RecPlayer_GetFrameCount ¶C · b3RecPlayer_GetFrameCountSource · box3d.odin:512
@return total number of recorded frames
RecPlayer_GetFrameQuery ¶C · b3RecPlayer_GetFrameQuerySource · box3d.odin:588
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 ¶C · b3RecPlayer_GetFrameQueryCountSource · box3d.odin:585
@return the number of spatial queries recorded for the most recently replayed frame
RecPlayer_GetFrameQueryHit ¶C · b3RecPlayer_GetFrameQueryHitSource · box3d.odin:591
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 ¶C · b3RecPlayer_GetInfoSource · box3d.odin:524
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 ¶C · b3RecPlayer_GetKeyframeBudgetSource · box3d.odin:545
@return the keyframe memory budget in bytes
RecPlayer_GetKeyframeBytes ¶C · b3RecPlayer_GetKeyframeBytesSource · box3d.odin:555
@return the memory currently held by keyframe snapshots, in bytes
RecPlayer_GetKeyframeInterval ¶C · b3RecPlayer_GetKeyframeIntervalSource · box3d.odin:552
@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 ¶C · b3RecPlayer_GetKeyframeMinIntervalSource · box3d.odin:548
@return the finest keyframe spacing in frames
RecPlayer_GetWorldId ¶C · b3RecPlayer_GetWorldIdSource · box3d.odin:506
@return the world currently driven by this player
RecPlayer_HasDiverged ¶C · b3RecPlayer_HasDivergedSource · box3d.odin:521
@return true when any StateHash mismatch has been detected
RecPlayer_IsAtEnd ¶C · b3RecPlayer_IsAtEndSource · box3d.odin:515
@return true when the op stream is exhausted
RecPlayer_IsAtPreStep ¶C · b3RecPlayer_IsAtPreStepSource · box3d.odin:518
@return true when the op stream is paused between body creation and world step.
RecPlayer_Restart ¶C · b3RecPlayer_RestartSource · box3d.odin:499
RecPlayer_Restart :: proc "c" (player: ^RecPlayer) ---
Rewind to frame 0 (in-place restore so the world id stays stable).
RecPlayer_SeekFrame ¶C · b3RecPlayer_SeekFrameSource · box3d.odin:503
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 ¶C · b3RecPlayer_SetDebugShapeCallbacksSource · box3d.odin:573
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 ¶C · b3RecPlayer_SetKeyframePolicySource · box3d.odin:542
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 ¶C · b3RecPlayer_SetWorkerCountSource · box3d.odin:533
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 ¶C · b3RecPlayer_StepFrameSource · box3d.odin:490
Advance one frame: dispatch ops until the next Step completes. @return true when a frame was stepped, false at end-of-recording
RecPlayer_SubStepFrame ¶C · b3RecPlayer_SubStepFrameSource · box3d.odin:495
RecPlayer_SubStepFrame :: proc "c" (player: ^RecPlayer) ---
Sub-step one frame. This will sub-step and return immediately after body creation. The next call will execute the time step. This allows bodies to be rendered at the creation pose.
Recording_GetData ¶C · b3Recording_GetDataSource · box3d.odin:440
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 ¶C · b3Recording_GetSizeSource · box3d.odin:444
Get the number of bytes currently in the recording buffer. @param recording the recording handle
RevoluteJoint_EnableLimit ¶C · b3RevoluteJoint_EnableLimitSource · box3d.odin:1560
Enable/disable the revolute joint limit
RevoluteJoint_EnableMotor ¶C · b3RevoluteJoint_EnableMotorSource · box3d.odin:1575
Enable/disable a revolute joint motor
RevoluteJoint_EnableSpring ¶C · b3RevoluteJoint_EnableSpringSource · box3d.odin:1532
Enable/disable the revolute joint spring
RevoluteJoint_GetAngle ¶C · b3RevoluteJoint_GetAngleSource · box3d.odin:1557
Get the revolute joint current angle in radians relative to the reference angle @see RevoluteJointDef::referenceAngle
RevoluteJoint_GetLowerLimit ¶C · b3RevoluteJoint_GetLowerLimitSource · box3d.odin:1566
Get the revolute joint lower limit in radians
RevoluteJoint_GetMaxMotorTorque ¶C · b3RevoluteJoint_GetMaxMotorTorqueSource · box3d.odin:1593
Get the revolute joint maximum motor torque, usually in newton-meters
RevoluteJoint_GetMotorSpeed ¶C · b3RevoluteJoint_GetMotorSpeedSource · box3d.odin:1584
Get the revolute joint motor speed in radians per second
RevoluteJoint_GetMotorTorque ¶C · b3RevoluteJoint_GetMotorTorqueSource · box3d.odin:1587
Get the revolute joint current motor torque, usually in newton-meters
RevoluteJoint_GetSpringDampingRatio ¶C · b3RevoluteJoint_GetSpringDampingRatioSource · box3d.odin:1547
Get the revolute joint spring damping ratio, non-dimensional
RevoluteJoint_GetSpringHertz ¶C · b3RevoluteJoint_GetSpringHertzSource · box3d.odin:1541
Get the revolute joint spring stiffness in Hertz
RevoluteJoint_GetTargetAngle ¶C · b3RevoluteJoint_GetTargetAngleSource · box3d.odin:1553
Get the revolute joint target angle in radians
RevoluteJoint_GetUpperLimit ¶C · b3RevoluteJoint_GetUpperLimitSource · box3d.odin:1569
Get the revolute joint upper limit in radians
RevoluteJoint_IsLimitEnabled ¶C · b3RevoluteJoint_IsLimitEnabledSource · box3d.odin:1563
Is the revolute joint limit enabled?
RevoluteJoint_IsMotorEnabled ¶C · b3RevoluteJoint_IsMotorEnabledSource · box3d.odin:1578
Is the revolute joint motor enabled?
RevoluteJoint_IsSpringEnabled ¶C · b3RevoluteJoint_IsSpringEnabledSource · box3d.odin:1535
Is the revolute angular spring enabled?
RevoluteJoint_SetLimits ¶C · b3RevoluteJoint_SetLimitsSource · box3d.odin:1572
RevoluteJoint_SetLimits :: proc "c" ( jointId: JointId, lowerLimitRadians, upperLimitRadians: f32, ) ---
Set the revolute joint limits in radians
RevoluteJoint_SetMaxMotorTorque ¶C · b3RevoluteJoint_SetMaxMotorTorqueSource · box3d.odin:1590
Set the revolute joint maximum motor torque, usually in newton-meters
RevoluteJoint_SetMotorSpeed ¶C · b3RevoluteJoint_SetMotorSpeedSource · box3d.odin:1581
Set the revolute joint motor speed in radians per second
RevoluteJoint_SetSpringDampingRatio ¶C · b3RevoluteJoint_SetSpringDampingRatioSource · box3d.odin:1544
Set the revolute joint spring damping ratio, non-dimensional
RevoluteJoint_SetSpringHertz ¶C · b3RevoluteJoint_SetSpringHertzSource · box3d.odin:1538
Set the revolute joint spring stiffness in Hertz
RevoluteJoint_SetTargetAngle ¶C · b3RevoluteJoint_SetTargetAngleSource · box3d.odin:1550
Set the revolute joint target angle in radians
RotateVector ¶
@(require_results) 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 ¶
@(require_results) 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 ¶C · b3SaveRecordingToFileSource · box3d.odin:460
Save the recording buffer to a file. Returns true on success. @param recording the recording to save @param path file path to write
ScaleBox ¶C · b3ScaleBoxSource · box3d_collision.odin:167
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 ¶C · b3SegmentDistanceSource · box3d_math.odin:109
SegmentDistance :: proc "c" (p1, q1: [3]f32, p2, q2: [3]f32) -> SegmentDistanceResult ---
Compute the closest points on two line segments.
SetAllocator ¶C · b3SetAllocatorSource · box3d.odin:60
This allows the user to override the allocation functions. These should be
set during application startup.
SetAssertFcn ¶C · b3SetAssertFcnSource · box3d.odin:67
SetAssertFcn :: proc "c" (assertFcn: AssertFcn) ---
Override the default assert callback.
@param assertFcn a non-null assert callback
SetLengthUnitsPerMeter ¶C · b3SetLengthUnitsPerMeterSource · box3d_constants.odin:10
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
SetLogFcn ¶C · b3SetLogFcnSource · box3d.odin:73
SetLogFcn :: proc "c" (logFcn: LogFcn) ---
Override the default logging callback.
SetStallThreshold ¶C · b3SetStallThresholdSource · box3d_constants.odin:16
SetStallThreshold :: proc "c" (seconds: f32) ---
Set the threshold for logging stalls.
ShapeCast ¶C · b3ShapeCastSource · box3d_collision.odin:405
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 ¶C · b3ShapeCastCapsuleSource · box3d_collision.odin:368
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 ¶C · b3ShapeCastCompoundSource · box3d_collision.odin:371
ShapeCastCompound :: proc "c" ( #by_ptr shape: CompoundData, #by_ptr input: ShapeCastInput, ) -> CastOutput ---
Shape cast versus compound. Initial overlap is treated as a miss.
ShapeCastHeightField ¶C · b3ShapeCastHeightFieldSource · box3d_collision.odin:380
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 ¶C · b3ShapeCastHullSource · box3d_collision.odin:374
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 ¶C · b3ShapeCastMeshSource · box3d_collision.odin:377
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 ¶C · b3ShapeCastSphereSource · box3d_collision.odin:365
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 ¶C · b3ShapeDistanceSource · box3d_collision.odin:401
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 ¶C · b3Shape_ApplyWindSource · box3d.odin:1141
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 ¶C · b3Shape_AreContactEventsEnabledSource · box3d.odin:1043
Returns true if contact events are enabled
Shape_AreHitEventsEnabled ¶C · b3Shape_AreHitEventsEnabledSource · box3d.odin:1058
Returns true if hit events are enabled
Shape_ArePreSolveEventsEnabled ¶C · b3Shape_ArePreSolveEventsEnabledSource · box3d.odin:1051
Returns true if pre-solve events are enabled
Shape_AreSensorEventsEnabled ¶C · b3Shape_AreSensorEventsEnabledSource · box3d.odin:1036
Returns true if sensor events are enabled
Shape_ComputeMassData ¶C · b3Shape_ComputeMassDataSource · box3d.odin:1127
Compute the mass data for a shape
Shape_EnableContactEvents ¶C · b3Shape_EnableContactEventsSource · box3d.odin:1040
Enable contact events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. @see ShapeDef::enableContactEvents
Shape_EnableHitEvents ¶C · b3Shape_EnableHitEventsSource · box3d.odin:1055
Enable contact hit events for this shape. Ignored for sensors. @see WorldDef.hitEventThreshold
Shape_EnablePreSolveEvents ¶C · b3Shape_EnablePreSolveEventsSource · box3d.odin:1048
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 ¶C · b3Shape_EnableSensorEventsSource · box3d.odin:1033
Enable sensor events for this shape. Only applies to kinematic and dynamic bodies. Ignored for sensors. @see ShapeDef::isSensor
Shape_GetAABB ¶C · b3Shape_GetAABBSource · box3d.odin:1124
Get the current world AABB
Shape_GetBody ¶C · b3Shape_GetBodySource · box3d.odin:965
Get the id of the body that a shape is attached to
Shape_GetCapsule ¶C · b3Shape_GetCapsuleSource · box3d.odin:1068
Get a copy of the shape's capsule. Asserts the type is correct.
Shape_GetClosestPoint ¶C · b3Shape_GetClosestPointSource · box3d.odin:1130
Get the closest point on a shape to a target point. Target and result are in world space.
Shape_GetContactCapacity ¶C · b3Shape_GetContactCapacitySource · box3d.odin:1100
Get the maximum capacity required for retrieving all the touching contacts on a shape
Shape_GetContactData ¶C · b3Shape_GetContactDataSource · box3d.odin:1106
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 ¶C · b3Shape_GetDensitySource · box3d.odin:992
Get the density of a shape, usually in kg/m^3
Shape_GetFilter ¶C · b3Shape_GetFilterSource · box3d.odin:1022
Get the shape filter
Shape_GetFriction ¶C · b3Shape_GetFrictionSource · box3d.odin:998
Get the friction of a shape
Shape_GetHeightField ¶C · b3Shape_GetHeightFieldSource · box3d.odin:1077
Shape_GetHeightField :: proc "c" (shapeId: ShapeId) -> ^HeightFieldData ---
Get the shape's height field. Asserts the type is correct.
Shape_GetHull ¶C · b3Shape_GetHullSource · box3d.odin:1071
Get the shape's convex hull. Asserts the type is correct.
Shape_GetMesh ¶C · b3Shape_GetMeshSource · box3d.odin:1074
Get the shape's mesh. Asserts the type is correct.
Shape_GetMeshMaterialCount ¶C · b3Shape_GetMeshMaterialCountSource · box3d.odin:1013
Get the number of mesh surface materials.
Shape_GetMeshSurfaceMaterial ¶C · b3Shape_GetMeshSurfaceMaterialSource · box3d.odin:1019
Shape_GetMeshSurfaceMaterial :: proc "c" (shapeId: ShapeId, index: i32) -> SurfaceMaterial ---
Get a surface material for a mesh shape
Shape_GetName ¶C · b3Shape_GetNameSource · box3d.odin:977
Get the shape name. Returns an empty string if the name isn't set.
Shape_GetRestitution ¶C · b3Shape_GetRestitutionSource · box3d.odin:1004
Get the shape restitution
Shape_GetSensorCapacity ¶C · b3Shape_GetSensorCapacitySource · box3d.odin:1112
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 ¶C · b3Shape_GetSensorDataSource · box3d.odin:1121
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 ¶C · b3Shape_GetSphereSource · box3d.odin:1065
Get a copy of the shape's sphere. Asserts the type is correct.
Shape_GetSurfaceMaterial ¶C · b3Shape_GetSurfaceMaterialSource · box3d.odin:1010
Shape_GetSurfaceMaterial :: proc "c" (shapeId: ShapeId) -> SurfaceMaterial ---
Get the base shape surface material.
Shape_GetType ¶C · b3Shape_GetTypeSource · box3d.odin:962
Get the type of a shape
Shape_GetUserData ¶C · b3Shape_GetUserDataSource · box3d.odin:984
Get the user data for a shape. This is useful when you get a shape id from an event or query.
Shape_GetWorld ¶C · b3Shape_GetWorldSource · box3d.odin:968
Get the world that owns this shape
Shape_IsSensor ¶C · b3Shape_IsSensorSource · box3d.odin:971
Returns true if the shape is a sensor
Shape_IsValid ¶C · b3Shape_IsValidSource · box3d.odin:959
Shape identifier validation. Provides validation for up to 64K allocations.
Shape_RayCast ¶C · b3Shape_RayCastSource · box3d.odin:1062
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 ¶C · b3Shape_SetCapsuleSource · box3d.odin:1087
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 ¶C · b3Shape_SetDensitySource · box3d.odin:989
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 ¶C · b3Shape_SetFilterSource · box3d.odin:1029
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 ¶C · b3Shape_SetFrictionSource · box3d.odin:995
Set the friction on a shape
Shape_SetHull ¶C · b3Shape_SetHullSource · box3d.odin:1092
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 ¶C · b3Shape_SetMeshSource · box3d.odin:1097
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 ¶C · b3Shape_SetMeshMaterialSource · box3d.odin:1016
Shape_SetMeshMaterial :: proc "c" ( shapeId: ShapeId, surfaceMaterial: SurfaceMaterial, index: i32, ) ---
Set a surface material for a mesh shape.
Shape_SetName ¶C · b3Shape_SetNameSource · box3d.odin:974
Set the shape name.
Shape_SetRestitution ¶C · b3Shape_SetRestitutionSource · box3d.odin:1001
Set the shape restitution (bounciness)
Shape_SetSphere ¶C · b3Shape_SetSphereSource · box3d.odin:1082
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 ¶C · b3Shape_SetSurfaceMaterialSource · box3d.odin:1007
Shape_SetSurfaceMaterial :: proc "c" (shapeId: ShapeId, surfaceMaterial: SurfaceMaterial) ---
Set the shape base surface material. Does not change per triangle materials.
Shape_SetUserData ¶C · b3Shape_SetUserDataSource · box3d.odin:980
Set the user data for a shape
Sleep ¶C · b3SleepSource · box3d.odin:112
Sleep :: proc "c" (milliseconds: i32) ---
Sleep the current thread for a number of milliseconds.
Solve3 ¶
Solve a matrix equation. @return inv(m) * a
SolvePlanes ¶C · b3SolvePlanesSource · box3d_collision.odin:463
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 ¶C · b3SphericalJoint_EnableConeLimitSource · box3d.odin:1610
Enable/disable the spherical joint cone limit
SphericalJoint_EnableMotor ¶C · b3SphericalJoint_EnableMotorSource · box3d.odin:1667
Enable/disable a spherical joint motor
SphericalJoint_EnableSpring ¶C · b3SphericalJoint_EnableSpringSource · box3d.odin:1643
Enable/disable the spherical joint spring
SphericalJoint_EnableTwistLimit ¶C · b3SphericalJoint_EnableTwistLimitSource · box3d.odin:1625
Enable/disable the spherical joint limit
SphericalJoint_GetConeAngle ¶C · b3SphericalJoint_GetConeAngleSource · box3d.odin:1622
Get the spherical joint current cone angle in radians.
SphericalJoint_GetConeLimit ¶C · b3SphericalJoint_GetConeLimitSource · box3d.odin:1616
Get the spherical joint cone limit in radians
SphericalJoint_GetLowerTwistLimit ¶C · b3SphericalJoint_GetLowerTwistLimitSource · box3d.odin:1631
Get the spherical joint lower limit in radians
SphericalJoint_GetMaxMotorTorque ¶C · b3SphericalJoint_GetMaxMotorTorqueSource · box3d.odin:1685
Get the spherical joint maximum motor torque, usually in newton-meters
SphericalJoint_GetMotorTorque ¶C · b3SphericalJoint_GetMotorTorqueSource · box3d.odin:1679
Get the spherical joint current motor torque, usually in newton-meters
SphericalJoint_GetMotorVelocity ¶C · b3SphericalJoint_GetMotorVelocitySource · box3d.odin:1676
Get the spherical joint motor velocity in radians per second
SphericalJoint_GetSpringDampingRatio ¶C · b3SphericalJoint_GetSpringDampingRatioSource · box3d.odin:1658
Get the spherical joint spring damping ratio, non-dimensional
SphericalJoint_GetSpringHertz ¶C · b3SphericalJoint_GetSpringHertzSource · box3d.odin:1652
Get the spherical joint spring stiffness in Hertz
SphericalJoint_GetTargetRotation ¶C · b3SphericalJoint_GetTargetRotationSource · box3d.odin:1664
SphericalJoint_GetTargetRotation :: proc "c" (jointId: JointId) -> quaternion128 ---
Get the spherical joint spring target rotation
SphericalJoint_GetTwistAngle ¶C · b3SphericalJoint_GetTwistAngleSource · box3d.odin:1640
Get the spherical joint current twist angle in radians.
SphericalJoint_GetUpperTwistLimit ¶C · b3SphericalJoint_GetUpperTwistLimitSource · box3d.odin:1634
Get the spherical joint upper limit in radians
SphericalJoint_IsConeLimitEnabled ¶C · b3SphericalJoint_IsConeLimitEnabledSource · box3d.odin:1613
Is the spherical joint cone limit enabled?
SphericalJoint_IsMotorEnabled ¶C · b3SphericalJoint_IsMotorEnabledSource · box3d.odin:1670
Is the spherical joint motor enabled?
SphericalJoint_IsSpringEnabled ¶C · b3SphericalJoint_IsSpringEnabledSource · box3d.odin:1646
Is the spherical angular spring enabled?
SphericalJoint_IsTwistLimitEnabled ¶C · b3SphericalJoint_IsTwistLimitEnabledSource · box3d.odin:1628
Is the spherical joint limit enabled?
SphericalJoint_SetConeLimit ¶C · b3SphericalJoint_SetConeLimitSource · box3d.odin:1619
Set the spherical joint limits in radians
SphericalJoint_SetMaxMotorTorque ¶C · b3SphericalJoint_SetMaxMotorTorqueSource · box3d.odin:1682
Set the spherical joint maximum motor torque, usually in newton-meters
SphericalJoint_SetMotorVelocity ¶C · b3SphericalJoint_SetMotorVelocitySource · box3d.odin:1673
Set the spherical joint motor velocity in radians per second
SphericalJoint_SetSpringDampingRatio ¶C · b3SphericalJoint_SetSpringDampingRatioSource · box3d.odin:1655
Set the spherical joint spring damping ratio, non-dimensional
SphericalJoint_SetSpringHertz ¶C · b3SphericalJoint_SetSpringHertzSource · box3d.odin:1649
Set the spherical joint spring stiffness in Hertz
SphericalJoint_SetTargetRotation ¶C · b3SphericalJoint_SetTargetRotationSource · box3d.odin:1661
SphericalJoint_SetTargetRotation :: proc "c" (jointId: JointId, targetRotation: quaternion128) ---
Set the spherical joint spring target rotation
SphericalJoint_SetTwistLimits ¶C · b3SphericalJoint_SetTwistLimitsSource · box3d.odin:1637
SphericalJoint_SetTwistLimits :: proc "c" ( jointId: JointId, lowerLimitRadians, upperLimitRadians: f32, ) ---
Set the spherical joint limits in radians
Steiner ¶C · b3SteinerSource · box3d_math.odin:143
Get the inertia tensor of an offset point. https://en.wikipedia.org/wiki/Parallel_axis_theorem
StoreBodyId ¶
/ Store a body id into a u64.
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 ¶C · b3TimeOfImpactSource · box3d_collision.odin:414
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.
ToPos ¶
Convert a vector to a world position.
ToRelativeTransform ¶
@(require_results) 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 ¶
@(require_results) 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 ¶
@(disabled=!ENABLE_VALIDATION) VALIDATE :: proc "c" ( condition: bool, message: string = #caller_expression(condition), loc := #caller_location, ) {…}
ValidateReplay ¶C · b3ValidateReplaySource · box3d.odin:473
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 ¶C · b3WeldJoint_GetAngularDampingRatioSource · box3d.odin:1726
Get the weld joint angular damping ratio, non-dimensional
WeldJoint_GetAngularHertz ¶C · b3WeldJoint_GetAngularHertzSource · box3d.odin:1720
Get the weld joint angular stiffness in Hertz
WeldJoint_GetLinearDampingRatio ¶C · b3WeldJoint_GetLinearDampingRatioSource · box3d.odin:1714
Get the weld joint linear damping ratio (non-dimensional)
WeldJoint_GetLinearHertz ¶C · b3WeldJoint_GetLinearHertzSource · box3d.odin:1708
Get the weld joint linear stiffness in Hertz
WeldJoint_SetAngularDampingRatio ¶C · b3WeldJoint_SetAngularDampingRatioSource · box3d.odin:1723
Set weld joint angular damping ratio, non-dimensional
WeldJoint_SetAngularHertz ¶C · b3WeldJoint_SetAngularHertzSource · box3d.odin:1717
Set the weld joint angular stiffness in Hertz. 0 is rigid.
WeldJoint_SetLinearDampingRatio ¶C · b3WeldJoint_SetLinearDampingRatioSource · box3d.odin:1711
Set the weld joint linear damping ratio (non-dimensional)
WeldJoint_SetLinearHertz ¶C · b3WeldJoint_SetLinearHertzSource · box3d.odin:1705
Set the weld joint linear stiffness in Hertz. 0 is rigid.
WheelJoint_EnableSpinMotor ¶C · b3WheelJoint_EnableSpinMotorSource · box3d.odin:1778
Enable/disable the wheel joint motor.
WheelJoint_EnableSteering ¶C · b3WheelJoint_EnableSteeringSource · box3d.odin:1802
Enable/disable wheel steering. Steering allows the wheel to rotate about the suspension axis.
WheelJoint_EnableSteeringLimit ¶C · b3WheelJoint_EnableSteeringLimitSource · box3d.odin:1826
Enable/disable the wheel joint steering limit.
WheelJoint_EnableSuspension ¶C · b3WheelJoint_EnableSuspensionSource · box3d.odin:1745
Enable/disable the wheel joint spring.
WheelJoint_EnableSuspensionLimit ¶C · b3WheelJoint_EnableSuspensionLimitSource · box3d.odin:1763
Enable/disable the wheel joint limit.
WheelJoint_GetLowerSteeringLimit ¶C · b3WheelJoint_GetLowerSteeringLimitSource · box3d.odin:1832
Get the wheel joint lower steering limit in radians.
WheelJoint_GetLowerSuspensionLimit ¶C · b3WheelJoint_GetLowerSuspensionLimitSource · box3d.odin:1769
Get the wheel joint lower limit.
WheelJoint_GetMaxSpinTorque ¶C · b3WheelJoint_GetMaxSpinTorqueSource · box3d.odin:1793
Get the wheel joint maximum motor torque, usually in newton-meters.
WheelJoint_GetMaxSteeringTorque ¶C · b3WheelJoint_GetMaxSteeringTorqueSource · box3d.odin:1823
Get the wheel joint maximum steering torque in N*m.
WheelJoint_GetSpinMotorSpeed ¶C · b3WheelJoint_GetSpinMotorSpeedSource · box3d.odin:1787
Get the wheel joint motor speed in radians per second.
WheelJoint_GetSpinSpeed ¶C · b3WheelJoint_GetSpinSpeedSource · box3d.odin:1796
Get the current spin speed in radians per second.
WheelJoint_GetSpinTorque ¶C · b3WheelJoint_GetSpinTorqueSource · box3d.odin:1799
Get the wheel joint current motor torque, usually in newton-meters.
WheelJoint_GetSteeringAngle ¶C · b3WheelJoint_GetSteeringAngleSource · box3d.odin:1847
Get the current steering angle in radians.
WheelJoint_GetSteeringDampingRatio ¶C · b3WheelJoint_GetSteeringDampingRatioSource · box3d.odin:1817
Get the wheel joint steering damping ratio, non-dimensional.
WheelJoint_GetSteeringHertz ¶C · b3WheelJoint_GetSteeringHertzSource · box3d.odin:1811
Get the wheel joint steering stiffness in Hertz.
WheelJoint_GetSteeringTorque ¶C · b3WheelJoint_GetSteeringTorqueSource · box3d.odin:1850
Get the current steering torque in N*m.
WheelJoint_GetSuspensionDampingRatio ¶C · b3WheelJoint_GetSuspensionDampingRatioSource · box3d.odin:1760
Get the wheel joint damping ratio, non-dimensional.
WheelJoint_GetSuspensionHertz ¶C · b3WheelJoint_GetSuspensionHertzSource · box3d.odin:1754
Get the wheel joint stiffness in Hertz.
WheelJoint_GetTargetSteeringAngle ¶C · b3WheelJoint_GetTargetSteeringAngleSource · box3d.odin:1844
Get the wheel joint target steering angle in radians.
WheelJoint_GetUpperSteeringLimit ¶C · b3WheelJoint_GetUpperSteeringLimitSource · box3d.odin:1835
Get the wheel joint upper steering limit in radians.
WheelJoint_GetUpperSuspensionLimit ¶C · b3WheelJoint_GetUpperSuspensionLimitSource · box3d.odin:1772
Get the wheel joint upper limit.
WheelJoint_IsSpinMotorEnabled ¶C · b3WheelJoint_IsSpinMotorEnabledSource · box3d.odin:1781
Is the wheel joint motor enabled?
WheelJoint_IsSteeringEnabled ¶C · b3WheelJoint_IsSteeringEnabledSource · box3d.odin:1805
Can the wheel steer?
WheelJoint_IsSteeringLimitEnabled ¶C · b3WheelJoint_IsSteeringLimitEnabledSource · box3d.odin:1829
Is the wheel joint steering limit enabled?
WheelJoint_IsSuspensionEnabled ¶C · b3WheelJoint_IsSuspensionEnabledSource · box3d.odin:1748
Is the wheel joint spring enabled?
WheelJoint_IsSuspensionLimitEnabled ¶C · b3WheelJoint_IsSuspensionLimitEnabledSource · box3d.odin:1766
Is the wheel joint limit enabled?
WheelJoint_SetMaxSpinTorque ¶C · b3WheelJoint_SetMaxSpinTorqueSource · box3d.odin:1790
Set the wheel joint maximum motor torque, usually in newton-meters.
WheelJoint_SetMaxSteeringTorque ¶C · b3WheelJoint_SetMaxSteeringTorqueSource · box3d.odin:1820
Set the wheel joint maximum steering torque in N*m.
WheelJoint_SetSpinMotorSpeed ¶C · b3WheelJoint_SetSpinMotorSpeedSource · box3d.odin:1784
Set the wheel joint motor speed in radians per second.
WheelJoint_SetSteeringDampingRatio ¶C · b3WheelJoint_SetSteeringDampingRatioSource · box3d.odin:1814
Set the wheel joint steering damping ratio, non-dimensional.
WheelJoint_SetSteeringHertz ¶C · b3WheelJoint_SetSteeringHertzSource · box3d.odin:1808
Set the wheel joint steering stiffness in Hertz.
WheelJoint_SetSteeringLimits ¶C · b3WheelJoint_SetSteeringLimitsSource · box3d.odin:1838
Set the wheel joint steering limits in radians.
WheelJoint_SetSuspensionDampingRatio ¶C · b3WheelJoint_SetSuspensionDampingRatioSource · box3d.odin:1757
Set the wheel joint damping ratio, non-dimensional.
WheelJoint_SetSuspensionHertz ¶C · b3WheelJoint_SetSuspensionHertzSource · box3d.odin:1751
Set the wheel joint stiffness in Hertz.
WheelJoint_SetSuspensionLimits ¶C · b3WheelJoint_SetSuspensionLimitsSource · box3d.odin:1775
Set the wheel joint limits.
WheelJoint_SetTargetSteeringAngle ¶C · b3WheelJoint_SetTargetSteeringAngleSource · box3d.odin:1841
Set the wheel joint target steering angle in radians.
World_CastMover ¶C · b3World_CastMoverSource · box3d.odin:286
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 ¶C · b3World_CastRaySource · box3d.odin:263
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 ¶C · b3World_CastRayClosestSource · box3d.odin:267
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 ¶C · b3World_CastShapeSource · box3d.odin:273
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 ¶C · b3World_CollideMoverSource · box3d.odin:290
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 ¶C · b3World_DrawSource · box3d.odin:228
Call this to draw shapes and other debug draw data
World_Dump ¶C · b3World_DumpSource · box3d.odin:419
World_Dump :: proc "c" (worldId: WorldId) ---
Dump world to a text file. Meshes are saved to binary m files.
World_DumpAwake ¶C · b3World_DumpAwakeSource · box3d.odin:416
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 ¶C · b3World_DumpMemoryStatsSource · box3d.odin:403
World_DumpMemoryStats :: proc "c" (worldId: WorldId) ---
Dump memory stats to log.
World_DumpShapeBounds ¶C · b3World_DumpShapeBoundsSource · box3d.odin:406
Dump shape bounds to box3d_bounds.txt
World_EnableContinuous ¶C · b3World_EnableContinuousSource · box3d.odin:304
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 ¶C · b3World_EnableSleepingSource · box3d.odin:295
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 ¶C · b3World_EnableSpeculativeSource · box3d.odin:412
This is for internal testing
World_EnableWarmStarting ¶C · b3World_EnableWarmStartingSource · box3d.odin:367
Enable/disable constraint warm starting. Advanced feature for testing. Disabling warm starting greatly reduces stability and provides no performance gain.
World_Explode ¶C · b3World_ExplodeSource · box3d.odin:342
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 ¶C · b3World_GetAwakeBodyCountSource · box3d.odin:373
Get the number of awake bodies
World_GetBodyEvents ¶C · b3World_GetBodyEventsSource · box3d.odin:235
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 ¶C · b3World_GetBoundsSource · box3d.odin:232
Get the world's bounds. This is the bounding box that covers the current simulation. May have a small amount of padding.
World_GetContactEvents ¶C · b3World_GetContactEventsSource · box3d.odin:241
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 ¶C · b3World_GetContactRecycleDistanceSource · box3d.odin:357
Get the contact point recycling distance. Usually in meters.
World_GetCounters ¶C · b3World_GetCountersSource · box3d.odin:379
Get world counters and sizes
World_GetGravity ¶C · b3World_GetGravitySource · box3d.odin:337
Get the gravity vector
World_GetHitEventThreshold ¶C · b3World_GetHitEventThresholdSource · box3d.odin:323
Get the hit event speed threshold. Usually in meters per second.
World_GetJointEvents ¶C · b3World_GetJointEventsSource · box3d.odin:244
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 ¶C · b3World_GetMaxCapacitySource · box3d.odin:382
Get max capacity. This can be used with WorldDef to avoid run-time allocations and copies
World_GetMaximumLinearSpeed ¶C · b3World_GetMaximumLinearSpeedSource · box3d.odin:363
Get the maximum linear speed. Usually in m/s.
World_GetProfile ¶C · b3World_GetProfileSource · box3d.odin:376
Get the current world performance profile
World_GetRestitutionThreshold ¶C · b3World_GetRestitutionThresholdSource · box3d.odin:315
Get the restitution speed threshold. Usually in meters per second.
World_GetSensorEvents ¶C · b3World_GetSensorEventsSource · box3d.odin:238
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_GetUserData ¶C · b3World_GetUserDataSource · box3d.odin:388
Get the user data pointer.
World_GetWorkerCount ¶C · b3World_GetWorkerCountSource · box3d.odin:400
Get the worker count.
World_IsContinuousEnabled ¶C · b3World_IsContinuousEnabledSource · box3d.odin:307
Is continuous collision enabled?
World_IsSleepingEnabled ¶C · b3World_IsSleepingEnabledSource · box3d.odin:298
Is body sleeping enabled?
World_IsValid ¶C · b3World_IsValidSource · box3d.odin:219
World id validation. Provides validation for up to 64K allocations.
World_IsWarmStartingEnabled ¶C · b3World_IsWarmStartingEnabledSource · box3d.odin:370
Is constraint warm starting enabled?
World_OverlapAABB ¶C · b3World_OverlapAABBSource · box3d.odin:247
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 ¶C · b3World_OverlapShapeSource · box3d.odin:251
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 ¶C · b3World_RebuildStaticTreeSource · box3d.odin:409
World_RebuildStaticTree :: proc "c" (worldId: WorldId) ---
This is for internal testing
World_SetContactRecycleDistance ¶C · b3World_SetContactRecycleDistanceSource · box3d.odin:354
Set the contact point recycling distance. Setting this to zero disables contact point recycling. Usually in meters.
World_SetContactTuning ¶C · b3World_SetContactTuningSource · box3d.odin:350
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 ¶C · b3World_SetCustomFilterCallbackSource · box3d.odin:326
World_SetCustomFilterCallback :: proc "c" ( worldId: WorldId, fcn: CustomFilterFcn, ctx: rawptr, ) ---
Register the custom filter callback. This is optional.
World_SetFrictionCallback ¶C · b3World_SetFrictionCallbackSource · box3d.odin:391
World_SetFrictionCallback :: proc "c" (worldId: WorldId, callback: FrictionCallback) ---
Set the friction callback. Passing NULL resets to default.
World_SetGravity ¶C · b3World_SetGravitySource · box3d.odin:334
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 ¶C · b3World_SetHitEventThresholdSource · box3d.odin:320
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 ¶C · b3World_SetMaximumLinearSpeedSource · box3d.odin:360
Set the maximum linear speed. Usually in m/s.
World_SetPreSolveCallback ¶C · b3World_SetPreSolveCallbackSource · box3d.odin:329
World_SetPreSolveCallback :: proc "c" (worldId: WorldId, fcn: PreSolveFcn, ctx: rawptr) ---
Register the pre-solve callback. This is optional.
World_SetRestitutionCallback ¶C · b3World_SetRestitutionCallbackSource · box3d.odin:394
World_SetRestitutionCallback :: proc "c" (worldId: WorldId, callback: RestitutionCallback) ---
Set the restitution callback. Passing NULL resets to default.
World_SetRestitutionThreshold ¶C · b3World_SetRestitutionThresholdSource · box3d.odin:312
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 ¶C · b3World_SetUserDataSource · box3d.odin:385
Set the user data pointer.
World_SetWorkerCount ¶C · b3World_SetWorkerCountSource · box3d.odin:397
Set the worker count. Must be in the range [1, B3_MAX_WORKERS]
World_StartRecording ¶C · b3World_StartRecordingSource · box3d.odin:450
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 ¶C · b3World_StepSource · box3d.odin:225
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.
External examples raylib/box3d
World_StopRecording ¶C · b3World_StopRecordingSource · box3d.odin:455
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
Procedure Groups
Cross ¶
Cross :: proc{ linalg.scalar_cross, linalg.vector_cross2, linalg.vector_cross3, linalg.quaternion_cross, }
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 ¶
@(require_results) 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.
`#config` values
- BOX3D_SHARED
-define:BOX3D_SHARED=false
Source Files
Generation Information
Generated with odin version dev-2026-10 (vendor "odin") Windows_amd64 @ 2026-10-14 23:35:37.403868600 +0000 UTC