EdgeCollider
Hierarchy
- Collider
- EdgeCollider
Index
Constructors
constructor
Parameters
options: EdgeColliderOptions
Returns EdgeCollider
Properties
begin
publiccomposite
Composite collider if any this collider is attached to
WARNING do not tamper with this property
end
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
publicaxes
Get the axis associated with the edge
Returns Vector[]
publicbounds
Get the axis aligned bounding box for the edge collider in world space
Returns BoundingBox
publiccenter
Get the center of the collision area in world coordinates
Returns Vector
publiclocalBounds
Get the axis aligned bounding box for the edge collider in local space
Returns BoundingBox
publicworldPos
Position of the collision collider in world coordinates
Returns Vector
Methods
publicasLine
Returns this edge represented as a line in world coordinates
Returns LineSegment
publicasLocalLine
Return this edge as a line in local line coordinates (relative to the position)
Returns LineSegment
publicclone
Returns a clone of this Edge, not associated with any collider
Returns EdgeCollider
publiccollide
Parameters
shape: Collider
Returns CollisionContact[]
publiccontains
Tests if a point is contained in this collision area
Returns boolean
publicdebug
Parameters
ex: ExcaliburGraphicsContext
color: Color
Returns void
publicgetClosestLineBetween
Returns the closes line between this and another collider, from this -> collider
Parameters
shape: Collider
Returns LineSegment
publicgetFurthestPoint
publicgetInertia
Get the moment of inertia for an edge https://en.wikipedia.org/wiki/List_of_moments_of_inertia
Parameters
mass: number
Returns number
publicgetLength
Returns the length of the line segment in pixels
Returns number
publicgetSlope
Returns the slope of the line in the form of a vector
Returns Vector
publicproject
Project the edge along a specified axis
Parameters
axis: Vector
Returns Projection
publicrayCast
Return the point on the border of the collision collider that intersects with a ray (if any).
Parameters
ray: Ray
max: number = Infinity
Returns RayCastHit
publictouching
publicupdate
Updates collider world space geometry
Parameters
transform: Transform
Returns void
Edge is a single line collider to create collisions with a single line.