Box2D::b2Shape - Used for collision detection.
# Don't use this class directly, use a subclass.
A shape is used for collision detection. You can create a shape however you like. Shapes used for simulation in Box2D::b2World are created automatically when a Box2D::b2Fixture is created.
Box2D::b2World
Box2D::b2Fixture
Given a transform, compute the associated axis aligned bounding box for this shape.
Parameters:
Box2D::b2AABB $aabb - returns the axis aligned box.
Box2D::b2AABB
$aabb
Box2D::b2Transform $xf - the world transform of the shape.
Box2D::b2Transform
$xf
Implemented in Box2D::b2CircleShape, and Box2D::b2PolygonShape.
Box2D::b2CircleShape
Box2D::b2PolygonShape
Compute the mass properties of this shape using its dimensions and density. The inertia tensor is computed about the local origin.
Box2D::b2MassData $massData - returns the mass data for this shape.
Box2D::b2MassData
$massData
float32 $density - the density in kilograms per meter squared.
float32
$density
Get the type of this shape. You can use this to down cast to the concrete shape.
Returns a int
int
Cast a ray against this shape.
Box2D::b2RayCastOutput $output - the ray-cast results.
Box2D::b2RayCastOutput
$output
Box2D::b2RayCastInput $input - the ray-cast input parameters.
Box2D::b2RayCastInput
$input
Box2D::b2Transform $transform - the transform to be applied to the shape.
$transform
Returns a bool
bool
Test a point for containment in this shape. This only works for convex shapes.
Box2D::b2Transform $xf - the shape world transform.
Box2D::b2Vec2 $p - a point in world coordinates.
Box2D::b2Vec2
$p
float32 $m_radius (optional)
$m_radius
Returns a float32
int $m_type (optional)
$m_type
Box2D
See "BUGS" in Box2D
See "AUTHORS" in Box2D
See "COPYRIGHT & LICENSE" in Box2D
To install Box2D, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Box2D
CPAN shell
perl -MCPAN -e shell install Box2D
For more information on module installation, please visit the detailed CPAN module installation guide.