Pixel offset relative to a collider's body transform position.
Get the axis associated with the convex polygon
Get the axis aligned bounding box for the polygon collider in world coordinates
Get the center of the collider in world coordinates
Get the axis aligned bounding box for the polygon collider in local coordinates
Points in the polygon in order around the perimeter in local coordinates. These are relative from the body transform position. Excalibur stores these in counter-clockwise order
Points in the polygon in order around the perimeter in local coordinates. These are relative from the body transform position. Excalibur stores these in counter-clockwise order
Returns the world position of the collider, which is the current body transform plus any defined offset
Returns a clone of this ConvexPolygon, not associated with any collider
Returns a collision contact if the 2 colliders collide, otherwise collide will return null.
Tests if a point is contained in this collider in world space
Given a direction vector find the local space side that is most in that direction
Given a direction vector find the world space side that is most in that direction
Finds the closes face to the point using perpendicular distance
point to test against polygon
Returns the closest line between the surfaces this collider and another
Get the moment of inertia for an arbitrary polygon https://en.wikipedia.org/wiki/List_of_moments_of_inertia
Returns the local coordinate space sides
Gets the sides of the polygon in world space
Gets the points that make up the polygon in world space, from actor relative space (if specified)
Returns if the polygon collider is convex, Excalibur does not handle non-convex collision shapes. Call [[Polygon.triangulate]] to generate a CompositeCollider from this non-convex shape
Project the edges of the polygon along a specified axis
Tessellates the polygon into a triangle fan as a CompositeCollider of triangle polygons
Triangulate the polygon collider using the "Ear Clipping" algorithm. Returns a new CompositeCollider made up of smaller triangles.
Updates the transform for the collision geometry
Collision geometry (points/bounds) will not change until this is called.
Polygon collider for detecting collisions