CompositeCollider
Hierarchy
- Collider
- CompositeCollider
Index
Constructors
constructor
Parameters
colliders: Collider[]
Returns CompositeCollider
Properties
publiccomposite
Composite collider if any this collider is attached to
WARNING do not tamper with this property
publicevents
publicreadonlyid
offset
Pixel offset of the collision collider relative to the collider, by default (0, 0) meaning the collider is positioned on top of the collider.
publicowner
Accessors
axes
Return the axes of this particular collider
Returns Vector[]
bounds
Return the axis-aligned bounding box of the collision collider in world coordinates
Returns BoundingBox
center
The center point of the collision collider, for example if the collider is a circle it would be the center.
Returns Vector
publiccompositeStrategy
Returns separate | together
Treat composite collider's member colliders as either separate colliders for the purposes of onCollisionStart/onCollision or as a single collider together.
This property can be overridden on individual CompositeColliders.
For composites without gaps or small groups of colliders, you probably want 'together'
For composites with deliberate gaps, like a platforming level layout, you probably want 'separate'
Default is 'together' if unset
Parameters
value: separate | together
Returns void
localBounds
Return the axis-aligned bounding box of the collision collider in local coordinates
Returns BoundingBox
worldPos
Position of the collision collider in world coordinates
Returns Vector
Methods
addCollider
Parameters
collider: Collider
Returns void
clearColliders
Returns void
clone
Returns Collider
collide
Parameters
other: Collider
Returns CollisionContact[]
contains
Return wether the collider contains a point inclusive to it's border
Parameters
point: Vector
Returns boolean
publicdebug
Parameters
ex: ExcaliburGraphicsContext
color: Color
optionaloptions: { lineWidth: number; pointSize: number }
Returns void
getClosestLineBetween
Returns the closest line between the surfaces this collider and another
Parameters
other: Collider
Returns LineSegment
getColliders
Returns Collider[]
getFurthestPoint
getInertia
Parameters
mass: number
Returns number
project
Create a projection of this collider along an axis. Think of this as casting a "shadow" along an axis
Parameters
axis: Vector
Returns Projection
rayCast
Return the point on the border of the collision collider that intersects with a ray (if any).
Parameters
ray: Ray
optionalmax: number
Returns RayCastHit
removeCollider
Parameters
collider: Collider
Returns void
publictouching
update
Updates collider world space geometry
Parameters
transform: Transform
Returns void
A collision collider specifies the geometry that can detect when other collision colliders intersect for the purposes of colliding 2 objects in excalibur.