Versions in this module Expand all Collapse all v0 v0.1.11 Nov 26, 2026 v0.1.10 Nov 23, 2026 v0.1.9 Nov 21, 2026 Changes in this version type StepStatistics + CandidatePairs int + WritebackBodies int type World3D + func (world *World3D) Statistics() StepStatistics v0.1.8 Nov 20, 2026 v0.1.7 Nov 14, 2026 v0.1.6 Nov 13, 2026 v0.1.5 Nov 12, 2026 v0.1.4 Nov 11, 2026 v0.1.3 Nov 9, 2026 v0.1.2 Nov 9, 2026 Changes in this version + var FilterAll = Filter + func StepSystem2D(name string) ecs.SystemConfig + func StepSystem3D(name string) ecs.SystemConfig + func TaskCount2D(world *ecs.World) int + func TaskCount3D(world *ecs.World) int + func ValidateBodyTransform(matrix mgl32.Mat4, planar bool) error + type Body struct + func (body Body) AngularVelocity() float64 + func (body Body) ApplyForce(force Vector) + func (body Body) ApplyImpulse(impulse, worldPoint Vector) + func (body Body) ApplyTorque(torque float64) + func (body Body) ClearForces() + func (body Body) ID() BodyID + func (body Body) IsSleeping() bool + func (body Body) Position() Vector + func (body Body) Rotation() float64 + func (body Body) SetAngularVelocity(value float64) + func (body Body) SetGravityScale(value float64) + func (body Body) SetPosition(value Vector) + func (body Body) SetRotation(value float64) + func (body Body) SetType(value BodyType) + func (body Body) SetVelocity(value Vector) + func (body Body) Type() BodyType + func (body Body) UserData() uint64 + func (body Body) Valid() bool + func (body Body) Velocity() Vector + func (body Body) Wake() + type Body3D struct + func (body Body3D) AngularVelocity() Vector3D + func (body Body3D) ApplyForce(force Vector3D) + func (body Body3D) ApplyImpulse(impulse, worldPoint Vector3D) + func (body Body3D) ApplyTorque(torque Vector3D) + func (body Body3D) ClearForces() + func (body Body3D) ID() BodyID3D + func (body Body3D) Position() Vector3D + func (body Body3D) Rotation() Quaternion + func (body Body3D) SetAngularVelocity(value Vector3D) + func (body Body3D) SetGravityScale(value float64) + func (body Body3D) SetPosition(value Vector3D) + func (body Body3D) SetRotation(value Quaternion) + func (body Body3D) SetType(value BodyType) + func (body Body3D) SetVelocity(value Vector3D) + func (body Body3D) Type() BodyType + func (body Body3D) UserData() uint64 + func (body Body3D) Valid() bool + func (body Body3D) Velocity() Vector3D + type BodyDef struct + AngularDamping float64 + AngularVelocity float64 + FixedRotation bool + GravityScale float64 + Inertia float64 + LinearDamping float64 + Mass float64 + Position Vector + Rotation float64 + Type BodyType + UserData uint64 + Velocity Vector + func NewBodyDef(bodyType BodyType) BodyDef + type BodyDef3D struct + AngularDamping float64 + AngularVelocity Vector3D + FixedRotation bool + GravityScale float64 + Inertia float64 + LinearDamping float64 + Mass float64 + Position Vector3D + Rotation Quaternion + Type BodyType + UserData uint64 + Velocity Vector3D + func NewBodyDef3D(bodyType BodyType) BodyDef3D + type BodyID uint64 + type BodyID3D uint64 + type BodyType uint8 + const BodyDynamic + const BodyKinematic + const BodyStatic + type Bounds3D struct + Max Vector3D + Min Vector3D + func (bounds Bounds3D) Center() Vector3D + func (bounds Bounds3D) Size() Vector3D + func (bounds Bounds3D) Valid() bool + type Box struct + Center Vector + HalfExtents Vector + Rotation float64 + func NewBox(width, height float64) Box + type Box3D struct + Center Vector3D + HalfExtents Vector3D + Rotation Quaternion + func NewBox3D(width, height, depth float64) Box3D + type BoxCollider2D = Collider2D[Box] + type BoxCollider3D = Collider3D[Box3D] + type Capsule struct + Center Vector3D + HalfHeight float64 + Radius float64 + Rotation Quaternion + func NewCapsule(height, radius float64) Capsule + type CapsuleCollider3D = Collider3D[Capsule] + type Circle struct + Center Vector + Radius float64 + type CircleCollider2D = Collider2D[Circle] + type Collider2D struct + CollisionType uint32 + Filter Filter + Friction float64 + Restitution float64 + Sensor bool + Shape S + func NewCollider2D[S Shape2D](shape S) Collider2D[S] + func (collider *Collider2D[S]) Handle() ColliderHandle[S] + type Collider3D struct + CollisionType uint32 + Filter Filter + Friction float64 + Restitution float64 + Sensor bool + Shape S + func NewCollider3D[S Shape3D](shape S) Collider3D[S] + func (collider *Collider3D[S]) Handle() ColliderHandle3D[S] + type ColliderDef struct + CollisionType uint32 + Filter Filter + Friction float64 + Restitution float64 + Sensor bool + Shape S + func NewColliderDef[S Shape](shape S) ColliderDef[S] + type ColliderHandle struct + func (collider ColliderHandle[S]) CollisionType() uint32 + func (collider ColliderHandle[S]) Filter() Filter + func (collider ColliderHandle[S]) ID() ColliderID + func (collider ColliderHandle[S]) Sensor() bool + func (collider ColliderHandle[S]) SetCollisionType(value uint32) + func (collider ColliderHandle[S]) SetFilter(value Filter) + func (collider ColliderHandle[S]) SetMaterial(friction, restitution float64) + func (collider ColliderHandle[S]) SetSensor(value bool) + func (collider ColliderHandle[S]) SetShape(shape S) + func (collider ColliderHandle[S]) Shape() S + func (collider ColliderHandle[S]) Valid() bool + type ColliderHandle3D struct + func (collider ColliderHandle3D[S]) CollisionType() uint32 + func (collider ColliderHandle3D[S]) Filter() Filter + func (collider ColliderHandle3D[S]) ID() ColliderID3D + func (collider ColliderHandle3D[S]) Sensor() bool + func (collider ColliderHandle3D[S]) SetCollisionType(value uint32) + func (collider ColliderHandle3D[S]) SetFilter(value Filter) + func (collider ColliderHandle3D[S]) SetMaterial(friction, restitution float64) + func (collider ColliderHandle3D[S]) SetSensor(value bool) + func (collider ColliderHandle3D[S]) SetShape(shape S) + func (collider ColliderHandle3D[S]) Shape() S + func (collider ColliderHandle3D[S]) Valid() bool + type ColliderID uint64 + type ColliderID3D uint64 + type CollisionEvent struct + BodyA BodyID + BodyB BodyID + ColliderA ColliderID + ColliderB ColliderID + CollisionTypeA uint32 + CollisionTypeB uint32 + Normal Vector + Penetration float64 + Phase CollisionPhase + Point Vector + UserDataA uint64 + UserDataB uint64 + type CollisionEvent3D struct + BodyA BodyID3D + BodyB BodyID3D + ColliderA ColliderID3D + ColliderB ColliderID3D + CollisionTypeA uint32 + CollisionTypeB uint32 + Normal Vector3D + Penetration float64 + Phase CollisionPhase + Point Vector3D + UserDataA uint64 + UserDataB uint64 + type CollisionMessage2D struct + Collider ColliderID + CollisionType uint32 + Entity ecs.Entity + Normal Vector + Other ecs.Entity + OtherCollider ColliderID + OtherType uint32 + Penetration float64 + Phase CollisionPhase + Point Vector + type CollisionMessage3D struct + Collider ColliderID3D + CollisionType uint32 + Entity ecs.Entity + Normal Vector3D + Other ecs.Entity + OtherCollider ColliderID3D + OtherType uint32 + Penetration float64 + Phase CollisionPhase + Point Vector3D + type CollisionMode string + const CollisionModeConvexDecomposition + const CollisionModeSingleConvex + const CollisionModeTriangleMesh + func ParseCollisionMode(value string) (CollisionMode, error) + func (mode CollisionMode) String() string + type CollisionPhase uint8 + const CollisionBegin + const CollisionEnd + const CollisionStay + type Compound struct + Bounds Bounds3D + Children []CompoundChild + func ConvexDecomposition(pieces []ConvexHull) (Compound, error) + func NewCompound(children []CompoundChild) (Compound, error) + func NewCompoundFromHulls(pieces []ConvexHull) (Compound, error) + func (compound Compound) ChildCount() int + func (compound Compound) Cooked() bool + type CompoundChild struct + Position Vector3D + Rotation Quaternion + Shape ConvexHull + type CompoundCollider3D = Collider3D[Compound] + type ConvexFace struct + Indices [3]uint32 + Normal Vector3D + type ConvexHull struct + Bounds Bounds3D + Edges [][2]uint32 + Faces []ConvexFace + Vertices []Vector3D + func NewConvexHull(vertices []Vector3D) (ConvexHull, error) + func QuickHull(vertices []Vector3D) (ConvexHull, error) + func (hull ConvexHull) Cooked() bool + func (hull ConvexHull) FaceCount() int + func (hull ConvexHull) VertexCount() int + type ConvexHullCollider3D = Collider3D[ConvexHull] + type CookedCollision struct + Compound Compound + ConvexHull ConvexHull + Mode CollisionMode + TriangleMesh TriangleMesh + func CookCollision(vertices []Vector3D, indices []uint32, mode CollisionMode) (CookedCollision, error) + type Filter struct + Categories uint64 + Group int32 + Mask uint64 + func NewFilter(group int32, categories, mask uint64) Filter + func (filter Filter) Reject(other Filter) bool + type MeshRayHit struct + Distance float64 + Normal Vector3D + Point Vector3D + Triangle uint32 + type Quaternion struct + W float64 + X float64 + Y float64 + Z float64 + func Q(x, y, z, w float64) Quaternion + func QuaternionFromAxisAngle(axis Vector3D, angle float64) Quaternion + func QuaternionIdentity() Quaternion + func (q Quaternion) Conjugate() Quaternion + func (q Quaternion) Mul(other Quaternion) Quaternion + func (q Quaternion) Normalize() Quaternion + func (q Quaternion) Rotate(vector Vector3D) Vector3D + type RigidBody2D struct + AngularDamping float64 + AngularVelocity float64 + FixedRotation bool + Force Vector + GravityScale float64 + Impulse Vector + Inertia float64 + LinearDamping float64 + Mass float64 + Torque float64 + Type BodyType + Velocity Vector + func NewRigidBody2D(bodyType BodyType) RigidBody2D + func (body *RigidBody2D) ApplyForce(force Vector) + func (body *RigidBody2D) ApplyImpulse(impulse Vector) + func (body *RigidBody2D) ApplyTorque(torque float64) + func (body *RigidBody2D) Handle() Body + type RigidBody3D struct + AngularDamping float64 + AngularVelocity Vector3D + FixedRotation bool + Force Vector3D + GravityScale float64 + Impulse Vector3D + Inertia float64 + LinearDamping float64 + Mass float64 + Torque Vector3D + Type BodyType + Velocity Vector3D + func NewRigidBody3D(bodyType BodyType) RigidBody3D + func (body *RigidBody3D) ApplyForce(force Vector3D) + func (body *RigidBody3D) ApplyImpulse(impulse Vector3D) + func (body *RigidBody3D) ApplyTorque(torque Vector3D) + func (body *RigidBody3D) Handle() Body3D + type Runtime2D struct + Simulation *World + func NewRuntime2D() *Runtime2D + type Runtime3D struct + Simulation *World3D + func NewRuntime3D() *Runtime3D + type Segment struct + End Vector + Radius float64 + Start Vector + type SegmentCollider2D = Collider2D[Segment] + type Shape interface + type Shape2D interface + type Shape3D interface + type SleepConfig struct + AngularThreshold float64 + Enabled bool + LinearThreshold float64 + TimeThreshold float64 + type Sphere struct + Center Vector3D + Radius float64 + type SphereCollider3D = Collider3D[Sphere] + type StepStatistics struct + BoundsUpdates int + ContactBuilds int + IndexUpdates int + PairQueries int + SleepingBodies int + type TriangleMesh struct + BVH []TriangleMeshNode + Bounds Bounds3D + Indices []uint32 + TriangleIndices []uint32 + Vertices []Vector3D + func CookTriangleMesh(vertices []Vector3D, indices []uint32) (TriangleMesh, error) + func NewTriangleMesh(vertices []Vector3D, indices []uint32) (TriangleMesh, error) + func (mesh TriangleMesh) Cooked() bool + func (mesh TriangleMesh) OverlapsCapsule(start, end Vector3D, radius float64) bool + func (mesh TriangleMesh) Raycast(origin, direction Vector3D, limit float64) (MeshRayHit, bool) + func (mesh TriangleMesh) TriangleCount() int + type TriangleMeshCollider3D = Collider3D[TriangleMesh] + type TriangleMeshNode struct + Bounds Bounds3D + Count uint32 + First uint32 + Left int32 + Right int32 + type Vector struct + X float64 + Y float64 + func V(x, y float64) Vector + func (v Vector) Add(other Vector) Vector + func (v Vector) Dot(other Vector) float64 + func (v Vector) Length() float64 + func (v Vector) LengthSquared() float64 + func (v Vector) Mul(scalar float64) Vector + func (v Vector) Normalize() Vector + func (v Vector) Perpendicular() Vector + func (v Vector) Sub(other Vector) Vector + type Vector3D struct + X float64 + Y float64 + Z float64 + func V3(x, y, z float64) Vector3D + func (v Vector3D) Add(other Vector3D) Vector3D + func (v Vector3D) Cross(other Vector3D) Vector3D + func (v Vector3D) Dot(other Vector3D) float64 + func (v Vector3D) Length() float64 + func (v Vector3D) LengthSquared() float64 + func (v Vector3D) Mul(scalar float64) Vector3D + func (v Vector3D) Normalize() Vector3D + func (v Vector3D) Sub(other Vector3D) Vector3D + type World struct + CellSize float64 + CollisionSlop float64 + Damping float64 + Gravity Vector + Iterations int + Sleep SleepConfig + func NewWorld() *World + func (world *World) AddCollider[S Shape2D](body Body, def ColliderDef[S]) ColliderHandle[S] + func (world *World) Body(id BodyID) Body + func (world *World) CreateBody(def BodyDef) Body + func (world *World) Events() []CollisionEvent + func (world *World) RemoveBody(body Body) bool + func (world *World) RemoveCollider[S Shape2D](collider ColliderHandle[S]) bool + func (world *World) Reserve(bodyCount, colliderCount int) + func (world *World) Statistics() StepStatistics + func (world *World) Step(delta float64) + type World3D struct + CellSize float64 + CollisionSlop float64 + Damping float64 + Gravity Vector3D + Iterations int + func NewWorld3D() *World3D + func (world *World3D) AddCollider[S Shape3D](body Body3D, def ColliderDef[S]) ColliderHandle3D[S] + func (world *World3D) Body3D(id BodyID3D) Body3D + func (world *World3D) CreateBody(def BodyDef3D) Body3D + func (world *World3D) Events() []CollisionEvent3D + func (world *World3D) RemoveBody(body Body3D) bool + func (world *World3D) RemoveCollider[S Shape3D](collider ColliderHandle3D[S]) bool + func (world *World3D) Reserve(bodyCount, colliderCount int) + func (world *World3D) Step(delta float64)