Box2D::b2Fixture - Used to attach a shape to a body for collision detection.
my $fixture = $body->CreateFixture( $shape, $density );
A fixture is used to attach a shape to a body for collision detection. A fixture inherits its transform from its parent. Fixtures hold additional non-geometric data such as friction, collision filters, etc. Fixtures are created via Box2D::b2Body::CreateFixture.
Box2D::b2Body::CreateFixture
Warning: you cannot reuse fixtures.
Get the parent body of this fixture. This is NULL if the fixture is not attached.
Returns a Box2D::b2Body - the parent body.
Box2D::b2Body
Get the density of this fixture.
Returns a float32
float32
Get the coefficient of friction.
Get the next fixture in the parent body's fixture list.
Returns a Box2D::b2Fixture - the next shape.
Box2D::b2Fixture
Get the coefficient of restitution.
Get the child shape. You can modify the child shape, however you should not change the number of vertices because this will crash some collision caching mechanisms. Manipulating the shape may lead to non-physical behavior.
Returns a Box2D::b2Shape
Box2D::b2Shape
Get the user data that was assigned in the fixture definition. Use this to store your application specific data.
Returns a scalar
scalar
Is this fixture a sensor (non-solid)?
Returns a bool - the true if the shape is a sensor.
bool
Set the density of this fixture. This will _not_ automatically adjust the mass of the body. You must call Box2D::b2Body::ResetMassData to update the body's mass.
Box2D::b2Body::ResetMassData
Parameters:
float32 $density
$density
Set the coefficient of friction.
float32 $friction
$friction
Set the coefficient of restitution.
float32 $restitution
$restitution
Set if this fixture is a sensor.
bool $sensor
$sensor
Set the user data. Use this to store your application specific data.
scalar $data
$data
Test a point for containment in this fixture.
Box2D::b2Vec2 $p - a point in world coordinates.
Box2D::b2Vec2
$p
Returns a bool
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.