#include <body.h>
Public Member Functions | |
Construction | |
| Body () | |
| Constructs a null instance. More... | |
| Body (PhysicsContext &pc, const BodyDescription &description) | |
| Constructs a Body. More... | |
| Body (PhysicsContext &pc, const std::string &resource_id, const XMLResourceDocument &resources) | |
| Constructs a Body. More... | |
| ~Body () | |
Attributes | |
| bool | is_null () const |
| Returns true if this object is invalid. More... | |
| void | throw_if_null () const |
| Throw an exception if this object is invalid. More... | |
| Vec2f | get_position () const |
| Get the position of the body. More... | |
| Angle | get_angle () const |
| Get the angle of the body. More... | |
| Vec2f | get_linear_velocity () const |
| Return the linear velocity of the body. More... | |
| Angle | get_angular_velocity () const |
| Return the angular velocity of the body. More... | |
| float | get_gravity_scale () |
| Get the gravity scale of the body. More... | |
| BodyType | get_type () const |
| Get the type of this body. More... | |
| bool | has_fixed_rotation () const |
| Returns true if the body has fixed rotation. More... | |
| float | get_linear_damping () const |
| Get the linear damping of the body. More... | |
| float | get_angular_damping () const |
| the angular damping of the body. More... | |
| int | get_id () const |
| Return the world's id of the body. More... | |
| bool | is_dummy () const |
| Returns true if this body is a dummy body. More... | |
| bool | is_awake () const |
| Returns true if this body is not sleeping. More... | |
| bool | is_active () const |
| Returns true if this body is active in the simulation. More... | |
| bool | is_bullet () const |
| Returns true if this body is a bullet. More... | |
| PhysicsObject * | get_data () |
| Returns the physics object data. More... | |
Operations | |
| Body & | operator= (const Body ©) |
| Copy operator. More... | |
| void | set_position (const Vec2f &pos) |
| add a fixture to the body. More... | |
| void | set_angle (const Angle &angle) |
| set the angle of the body More... | |
| void | set_linear_velocity (const Vec2f &velocity) |
| set the linear velocity of the body. More... | |
| void | set_angular_velocity (const Angle &velocity) |
| set the angular velocity of the body. More... | |
| void | apply_force (const Vec2f &force, const Vec2f &point) |
| Apply a force at a world point. More... | |
| void | apply_force_to_center (const Vec2f &force) |
| Apply a force to the center of mass. More... | |
| void | apply_torque (const float torque) |
| Apply a force to the center of mass. More... | |
| void | apply_linear_impulse (const Vec2f &impulse, const Vec2f &point) |
| Apply an impulse at a point. More... | |
| void | apply_angular_impulse (const float impulse) |
| Apply an angular impulse. More... | |
| void | set_gravity_scale (const float scale) |
| Set the gravity scale of the body. More... | |
| void | set_type (const BodyType type) |
| Set the type of this body. This may alter the mass and velocity. More... | |
| void | set_as_bullet (const bool value=true) |
| Set this body to be treated like a bullet for continuous collision detection. More... | |
| void | set_awake (const bool value=true) |
| Set this body to sleep. More... | |
| void | set_active (const bool value=true) |
| Set this body to be active in the simulation. More... | |
| void | set_fixed_rotation (const bool value=true) |
| Set this body to use fixed rotation. This causes the mass to be reset. More... | |
| void | set_linear_damping (const float damping) |
| Set the linear damping of the body. More... | |
| void | set_angular_damping (const float damping) |
| Set the angular damping of the body. More... | |
| void | reset_mass_data () |
| This resets the mass properties to the sum of the mass properties of the fixtures. More... | |
| void | kill () |
| Remove the body from the simulation. The body gets swapped with a dummy body. More... | |
| void | set_data (PhysicsObject *data) |
| Set the physics object object that is going to process collision events. More... | |
Signals | |
| Signal_v1< Body > & | sig_begin_collision () |
| Signal emitted when a collision with other body occurs. More... | |
| Signal_v1< Body > & | sig_end_collision () |
| Signal emitted when a collision with other body ends. More... | |
| Signal_v0 & | sig_body_deletion () |
| Signal emitted when the body is deleted. More... | |
Friends | |
| class | Body_Impl |
| class | DistanceJointDescription |
| class | Fixture |
| class | Fixture_Impl |
| class | MouseJointDescription |
| class | PhysicsContext |
| class | PhysicsContext_Impl |
| class | PhysicsListener |
| class | PrismaticJointDescription |
| class | RevoluteJointDescription |
Body class.