public interface Convex extends Shape, Transformable, DataContainer
Convex
Shape
.
A Convex
Shape
is a Shape
that given a line, the line will only
intersect at most 2 non-coincident non-colinear edges.
Working with convex shapes specifically allows collision detection algorithms to be very fast. If non-convex shapes are required, they are typically handled by attaching multiple convex shapes together.
Modifier and Type | Method and Description |
---|---|
Vector2[] |
getAxes(Vector2[] foci,
Transform transform)
Returns an array of separating axes to test for this
Shape . |
Feature |
getFarthestFeature(Vector2 vector,
Transform transform)
Returns the
Feature farthest in the direction of the given vector. |
Vector2 |
getFarthestPoint(Vector2 vector,
Transform transform)
Returns the point farthest in the direction of the given vector.
|
Vector2[] |
getFoci(Transform transform)
Returns an array of world space foci points for circular curved edges.
|
contains, contains, createAABB, createAABB, createMass, getCenter, getId, getRadius, getRadius, project, project, rotateAboutCenter
translate, translate
getUserData, setUserData
Vector2[] getAxes(Vector2[] foci, Transform transform)
Shape
.
The foci
parameter is an array of circular focal points of the other Shape
.
If foci points are given, this method will return the separating axes for this Shape
's voronoi regions
also. The points in the foci array are assumed to be in world space.
The returned axes are normalized and in world space.
Vector2[] getFoci(Transform transform)
This method returns null if the Shape
has zero curved edges.
The returned points are in world space.
Feature getFarthestFeature(Vector2 vector, Transform transform)
Feature
farthest in the direction of the given vector.
The returned feature is in world space.