Capsule2D
Last updated
Last updated
A Capsule2D is a PositionedObject which can be used to perform collision tests. Since Capsule2Ds provide the same collision interface as other shapes, it is also considered a "shape". A Capsule2D is a shape that can be any length, but has rounded edges and a straight segment connecting the two points.
Capsules are often used to determine if a collision has occurred between a moving Circle and another object. Since capsules use rounded edges, they can represent the area that a Circle occupies during and between two subsequent frames.
Capsule size is controlled by two variables:
Scale
EndpointRadius
The following diagram shows hwo these values are used in a Capsule2D:
Did this article leave any questions unanswered? Post any question in our forums for a rapid response.