Box2D::b2FixtureDef - Used to create a fixture.
my $fixture_def = Box2D::b2FixtureDef->new(); $fixture_def->shape( $shape ); $fixture_def->density( $density ) $fixture_def->friction( $friction ); $fixture_def->restitution( $restitution ); my $fixture = $body->CreateFixtureDef( $fixture_def );
A fixture definition is used to create a fixture. This class defines an abstract fixture definition. You can reuse fixture definitions safely.
The constructor sets the default fixture definition values.
Returns a Box2D::b2FixtureDef
Box2D::b2FixtureDef
The density, usually in kg/m^2.
Parameters:
float32 $density (optional)
float32
$density
Returns a float32
Contact filtering data.
Box2D::b2Filter $filter (optional)
Box2D::b2Filter
$filter
Returns a Box2D::b2Filter
The friction coefficient, usually in the range [0,1].
float32 $friction (optional)
$friction
The restitution (elasticity) usually in the range [0,1].
float32 $restitution (optional)
$restitution
The shape, this must be set. The shape will be cloned, so you can create the shape on the stack.
Box2D::b2Shape $shape (optional)
Box2D::b2Shape
$shape
Returns a Box2D::b2Shape
Box2D
Box2D::b2Fixture
Box2D::b2Body
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.