Box2D
view release on metacpan or search on metacpan
lib/pods/Box2D/b2Body.pod view on Meta::CPAN
Apply an angular impulse.
Parameters:
=over 4
=item * C<float32> C<$impulse> - the angular impulse in units of kg*m*m/s
=back
=head2 ApplyForce( $force, $point )
Apply a force at a world point. If the force is not applied at the center of mass, it will generate a torque and affect the angular velocity. This wakes up the body.
Parameters:
=over 4
=item * C<Box2D::b2Vec2> C<$force> - the world force vector, usually in Newtons (N).
=item * C<Box2D::b2Vec2> C<$point> - the world position of the point of application.
=back
=head2 ApplyLinearImpulse( $impulse, $point )
Apply an impulse at a point. This immediately modifies the velocity. It also modifies the angular velocity if the point of application is not at the center of mass. This wakes up the body.
Parameters:
=over 4
=item * C<Box2D::b2Vec2> C<$impulse> - the world impulse vector, usually in N-seconds or kg-m/s.
=item * C<Box2D::b2Vec2> C<$point> - the world position of the point of application.
=back
=head2 ApplyTorque( $torque )
Apply a torque. This affects the angular velocity without affecting the linear velocity of the center of mass. This wakes up the body.
Parameters:
=over 4
=item * C<float32> C<$torque> - about the z-axis (out of the screen), usually in N-m.
=back
=head2 CreateFixture( $shape, $density )
Creates a fixture from a shape and attach it to this body. This is a convenience function. Use b2FixtureDef if you need to set parameters like friction, restitution, user data, or filtering. If the density is non-zero, this function automatically upd...
Parameters:
=over 4
=item * C<Box2D::b2Shape> C<$shape> - the shape to be cloned.
=item * C<float32> C<$density> - the shape density (set to zero for static bodies). Warning:This function is locked during callbacks.
=back
Returns a C<Box2D::b2Fixture>
=head2 CreateFixtureDef( $def )
Creates a fixture and attach it to this body. Use this function if you need to set some fixture parameters, like friction. Otherwise you can create the fixture directly from a shape. If the density is non-zero, this function automatically updates the...
Parameters:
=over 4
=item * C<Box2D::b2FixtureDef> C<$def> - the fixture definition. Warning:This function is locked during callbacks.
=back
Returns a C<Box2D::b2Fixture>
=head2 DestroyFixture( $fixture )
Destroy a fixture. This removes the fixture from the broad-phase and destroys all contacts associated with this fixture. This will automatically adjust the mass of the body if the body is dynamic and the fixture has positive density. All fixtures att...
Parameters:
=over 4
=item * C<Box2D::b2Fixture> C<$fixture> - the fixture to be removed. Warning:This function is locked during callbacks.
=back
=head2 GetAngle()
Get the angle in radians.
Returns a C<float32> - the current world rotation angle in radians.
=head2 GetAngularDamping()
Get the angular damping of the body.
Returns a C<float32>
=head2 GetAngularVelocity()
Get the angular velocity.
Returns a C<float32> - the angular velocity in radians/second.
=head2 GetInertia()
Get the rotational inertia of the body about the local origin.
Returns a C<float32> - the rotational inertia, usually in kg-m^2.
=head2 GetLinearDamping()
Get the linear damping of the body.
Returns a C<float32>
=head2 GetLinearVelocity()
Get the linear velocity of the center of mass.
Returns a C<Box2D::b2Vec2> - the linear velocity of the center of mass.
=head2 GetLinearVelocityFromLocalPoint( $localPoint )
Get the world velocity of a local point.
Parameters:
=over 4
=item * C<Box2D::b2Vec2> C<$localPoint>
=back
Returns a C<Box2D::b2Vec2> - the world velocity of a point.
=head2 GetLinearVelocityFromWorldPoint( $worldPoint )
Get the world linear velocity of a world point attached to this body.
Parameters:
=over 4
( run in 2.188 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )