Shape class abstract

A shape is used for collision detection. You can create a shape however you like. Shapes used for simulation in World are created automatically when a Fixture is created. Shapes may encapsulate a one or more child shapes.

Implementers

Constructors

Shape(ShapeType shapeType)

Properties

childCount int
Get the number of child primitives
no setter
hashCode int
The hash code for this object.
no setterinherited
radius double
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shapeType ShapeType
final

Methods

clone() Shape
computeAABB(AABB aabb, Transform xf, int childIndex) → void
Given a transform, compute the associated axis aligned bounding box for a child shape.
computeDistanceToOut(Transform xf, Vector2 p, int childIndex, Vector2 normalOut) double
Compute the distance from the current shape to the specified point. This only works for convex shapes.
computeMass(MassData massData, double density) → void
Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin. density should be in kilograms per meter squared.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
raycast(RayCastOutput output, RayCastInput input, Transform transform, int childIndex) bool
Cast a ray against a child shape.
testPoint(Transform xf, Vector2 point) bool
Test a point for containment in this shape. This only works for convex shapes.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited