Shape abstract class
abstract class Shape { /** The type of shape. Either circle or polygon. */ int type; /** Shape radius. */ num radius; /** * Constructs a new shape of unknown type. */ Shape([int type = ShapeType.UNKNOWN, num radius = 0]) : type = type, radius = radius { } /** * Test a point for containment in this shape. This only works for convex * shapes. * transform: the shape world transform. * point: a point in world coordinates. */ bool testPoint(Transform transform, Vector point); /** * Computes the associated axis aligned bounding box for a child shape * given a transform. Returns through the given out paramater. */ void computeAxisAlignedBox(AxisAlignedBox box, Transform transform); /** * Computes (and returns through the given out parameter massData) the mass * properties of this shape using its dimensions and the * given density. The inertia tensor is computed about the local origin. */ void computeMass(MassData massData, num density); /** Returns a clone of this shape. */ Shape clone(); }
Subclasses
Constructors
new Shape([int type = ShapeType.UNKNOWN, num radius = 0]) #
Constructs a new shape of unknown type.
Shape([int type = ShapeType.UNKNOWN, num radius = 0]) : type = type, radius = radius { }
Properties
num radius #
Shape radius.
num radius
int type #
The type of shape. Either circle or polygon.
int type
Methods
abstract void computeAxisAlignedBox(AxisAlignedBox box, Transform transform) #
Computes the associated axis aligned bounding box for a child shape given a transform. Returns through the given out paramater.