- SEE ALSO
- COPYRIGHT & LICENSE
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
Warning: you cannot reuse fixtures.
Get the parent body of this fixture. This is NULL if the fixture is not attached.
Box2D::b2Body - the parent body.
Get the density of this fixture.
Get the coefficient of friction.
Get the next fixture in the parent body's fixture list.
Box2D::b2Fixture - the next shape.
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.
Get the user data that was assigned in the fixture definition. Use this to store your application specific data.
Is this fixture a sensor (non-solid)?
bool - the true if the shape is a sensor.
SetDensity( $density )
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.
SetFriction( $friction )
Set the coefficient of friction.
SetRestitution( $restitution )
Set the coefficient of restitution.
SetSensor( $sensor )
Set if this fixture is a sensor.
SetUserData( $data )
Set the user data. Use this to store your application specific data.
TestPoint( $p )
Test a point for containment in this fixture.
$p- a point in world coordinates.
See "BUGS" in Box2D