A shape is used for collision detection. Shapes are created in b2Body. You can use shape for collision detection before they are attached to the world. Warning: you cannot reuse shapes.
Creates a new b2Shape.
Return value for TestSegment indicating a hit.
Return value for TestSegment indicating a miss.
Return value for TestSegment indicating that the segment starting point, p1, is already inside the shape.
Given a transform, compute the associated axis aligned bounding box for this shape.
Calculated AABB, this argument is out
.
Transform to calculate the AABB.
Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin, not the centroid.
Calculate the mass, this argument is out
.
Density.
Compute the volume and centroid of this shape intersected with a half plane
The surface normal.
The surface offset along the normal.
The shape transform.
The centroid, this argument is out
.
number
Clone the shape.
Get the type of this shape. You can use this to down cast to the concrete shape.
number
Cast a ray against this shape.
Ray cast results, this argument is out
.
Ray cast input parameters.
The transform to be applied to the shape.
boolean
Set the shape values from another shape.
The other shape to copy values from.
Test if two shapes overlap with the applied transforms.
shape to test for overlap with shape2.
shape1 transform to apply.
shape to test for overlap with shape1.
shape2 transform to apply.
boolean
True if shape1 and shape2 overlap, otherwise false.
Test a point for containment in this shape. This only works for convex shapes.
Shape world transform.
Point to test against, in world coordinates.
boolean
True if the point is in this shape, otherwise false.