clanPhysics Dynamics

Classes

class  clan::Body
 Body class. More...
 
class  clan::BodyDescription
 BodyDescription class. More...
 
class  clan::DistanceJoint
 DistanceJoint class. More...
 
class  clan::DistanceJointDescription
 DistanceJointDescription class. More...
 
class  clan::Fixture
 Fixture class. More...
 
class  clan::FixtureDescription
 FixtureDescription class. More...
 
class  clan::Joint
 Joint class. More...
 
class  clan::MouseJoint
 MouseJoint class. More...
 
class  clan::MouseJointDescription
 MouseJointDescription class. More...
 
class  clan::PrismaticJoint
 PrismaticJoint class. More...
 
class  clan::PrismaticJointDescription
 PrismaticJointDescription class. More...
 
class  clan::QueryResult
 Used by physics query assistant. More...
 
class  clan::RevoluteJoint
 RevoluteJoint class. More...
 
class  clan::RevoluteJointDescription
 RevoluteJointDescription class. More...
 

Enumerations

enum  clan::BodyType { clan::body_static = 0, clan::body_kinematic = 1, clan::body_dynamic = 2 }
 Body types. More...
 
enum  clan::JointType {
  clan::Joint_Distance = 0, clan::Joint_Friction = 1, clan::Joint_Gear = 2, clan::Joint_Mouse = 3,
  clan::Joint_Prismatic = 4, clan::Joint_Pulley = 5, clan::Joint_Revolute = 6, clan::Joint_Rope = 7,
  clan::Joint_Weld = 8, clan::Joint_Wheel = 9, clan::Joint_None = 1337
}
 Joint types. More...
 
enum  clan::QueryResultType { clan::query_raycast, clan::query_aabb }
 Query types. More...
 

Functions

 clan::Fixture::Fixture ()
 Constructs a null instance. More...
 
 clan::Fixture::Fixture (PhysicsContext &pc, Body &body, const FixtureDescription &description)
 Constructs a World. More...
 
 clan::Fixture::~Fixture ()
 

Friends

class clan::FixtureDescription::Body
 
class clan::BodyDescription::Body
 
class clan::BodyDescription::Body_Impl
 
class clan::Body::Body_Impl
 
class clan::DistanceJointDescription::DistanceJoint
 
class clan::Body::DistanceJointDescription
 
class clan::FixtureDescription::Fixture
 
class clan::Body::Fixture
 
class clan::FixtureDescription::Fixture_Impl
 
class clan::Body::Fixture_Impl
 
class clan::MouseJointDescription::MouseJoint
 
class clan::Body::MouseJointDescription
 
class clan::Joint::PhysicsContext
 
class clan::Body::PhysicsContext
 
class clan::Joint::PhysicsContext_Impl
 
class clan::Body::PhysicsContext_Impl
 
class clan::Body::PhysicsListener
 
class clan::PrismaticJointDescription::PrismaticJoint
 
class clan::Body::PrismaticJointDescription
 
class clan::RevoluteJointDescription::RevoluteJoint
 
class clan::Body::RevoluteJointDescription
 

Construction

 clan::Body::Body ()
 Constructs a null instance. More...
 
 clan::Body::Body (PhysicsContext &pc, const BodyDescription &description)
 Constructs a Body. More...
 
 clan::Body::Body (PhysicsContext &pc, const std::string &resource_id, const XMLResourceDocument &resources)
 Constructs a Body. More...
 
 clan::Body::~Body ()
 

Attributes

bool clan::Body::is_null () const
 Returns true if this object is invalid. More...
 
void clan::Body::throw_if_null () const
 Throw an exception if this object is invalid. More...
 
Vec2f clan::Body::get_position () const
 Get the position of the body. More...
 
Angle clan::Body::get_angle () const
 Get the angle of the body. More...
 
Vec2f clan::Body::get_linear_velocity () const
 Return the linear velocity of the body. More...
 
Angle clan::Body::get_angular_velocity () const
 Return the angular velocity of the body. More...
 
float clan::Body::get_gravity_scale ()
 Get the gravity scale of the body. More...
 
BodyType clan::Body::get_type () const
 Get the type of this body. More...
 
bool clan::Body::has_fixed_rotation () const
 Returns true if the body has fixed rotation. More...
 
float clan::Body::get_linear_damping () const
 Get the linear damping of the body. More...
 
float clan::Body::get_angular_damping () const
 the angular damping of the body. More...
 
int clan::Body::get_id () const
 Return the world's id of the body. More...
 
bool clan::Body::is_dummy () const
 Returns true if this body is a dummy body. More...
 
bool clan::Body::is_awake () const
 Returns true if this body is not sleeping. More...
 
bool clan::Body::is_active () const
 Returns true if this body is active in the simulation. More...
 
bool clan::Body::is_bullet () const
 Returns true if this body is a bullet. More...
 
PhysicsObjectclan::Body::get_data ()
 Returns the physics object data. More...
 

Operations

Bodyclan::Body::operator= (const Body &copy)
 Copy operator. More...
 
void clan::Body::set_position (const Vec2f &pos)
 add a fixture to the body. More...
 
void clan::Body::set_angle (const Angle &angle)
 set the angle of the body More...
 
void clan::Body::set_linear_velocity (const Vec2f &velocity)
 set the linear velocity of the body. More...
 
void clan::Body::set_angular_velocity (const Angle &velocity)
 set the angular velocity of the body. More...
 
void clan::Body::apply_force (const Vec2f &force, const Vec2f &point)
 Apply a force at a world point. More...
 
void clan::Body::apply_force_to_center (const Vec2f &force)
 Apply a force to the center of mass. More...
 
void clan::Body::apply_torque (const float torque)
 Apply a force to the center of mass. More...
 
void clan::Body::apply_linear_impulse (const Vec2f &impulse, const Vec2f &point)
 Apply an impulse at a point. More...
 
void clan::Body::apply_angular_impulse (const float impulse)
 Apply an angular impulse. More...
 
void clan::Body::set_gravity_scale (const float scale)
 Set the gravity scale of the body. More...
 
void clan::Body::set_type (const BodyType type)
 Set the type of this body. This may alter the mass and velocity. More...
 
void clan::Body::set_as_bullet (const bool value=true)
 Set this body to be treated like a bullet for continuous collision detection. More...
 
void clan::Body::set_awake (const bool value=true)
 Set this body to sleep. More...
 
void clan::Body::set_active (const bool value=true)
 Set this body to be active in the simulation. More...
 
void clan::Body::set_fixed_rotation (const bool value=true)
 Set this body to use fixed rotation. This causes the mass to be reset. More...
 
void clan::Body::set_linear_damping (const float damping)
 Set the linear damping of the body. More...
 
void clan::Body::set_angular_damping (const float damping)
 Set the angular damping of the body. More...
 
void clan::Body::reset_mass_data ()
 This resets the mass properties to the sum of the mass properties of the fixtures. More...
 
void clan::Body::kill ()
 Remove the body from the simulation. The body gets swapped with a dummy body. More...
 
void clan::Body::set_data (PhysicsObject *data)
 Set the physics object object that is going to process collision events. More...
 

Signals

Signal_v1< Body > & clan::Body::sig_begin_collision ()
 Signal emitted when a collision with other body occurs. More...
 
Signal_v1< Body > & clan::Body::sig_end_collision ()
 Signal emitted when a collision with other body ends. More...
 
Signal_v0clan::Body::sig_body_deletion ()
 Signal emitted when the body is deleted. More...
 

Construction

 clan::BodyDescription::BodyDescription ()
 Constructs a null instance. More...
 
 clan::BodyDescription::BodyDescription (const PhysicsWorld &pw)
 Constructs a BodyDescription. More...
 
 clan::BodyDescription::BodyDescription (const PhysicsContext &pc)
 Constructs a BodyDescription. More...
 
 clan::BodyDescription::BodyDescription (const PhysicsContext &pc, const std::string &resource_id, const XMLResourceDocument &resources)
 Constructs a BodyDescription. More...
 
 clan::BodyDescription::BodyDescription (const BodyDescription &copy)
 Constructs a BodyDescription. More...
 
virtual clan::BodyDescription::~BodyDescription ()
 

Attributes

bool clan::BodyDescription::is_null () const
 Returns true if this object is invalid. More...
 
void clan::BodyDescription::throw_if_null () const
 Throw an exception if this object is invalid. More...
 

Operations

BodyDescriptionclan::BodyDescription::operator= (const BodyDescription &copy)
 Copy assignment operator. More...
 
void clan::BodyDescription::set_type (const BodyType type)
 
void clan::BodyDescription::set_position (const Vec2f &position)
 
void clan::BodyDescription::set_position (const Pointf &position)
 
void clan::BodyDescription::set_position (const int x, const int y)
 
void clan::BodyDescription::set_position (const float x, const float y)
 
void clan::BodyDescription::set_angle (const Angle &angle)
 Set the Physics World angle of the body. More...
 
void clan::BodyDescription::set_linear_velocity (const Vec2f &velocity)
 Set the linear velocity of the body's origin in Physics World co-ordinates. More...
 
void clan::BodyDescription::set_angular_velocity (const Angle &velocity)
 Set the angular velocity of the body. More...
 
void clan::BodyDescription::set_linear_damping (const float damping)
 
void clan::BodyDescription::set_angular_damping (const float damping)
 
void clan::BodyDescription::allow_sleep (const bool value=true)
 
void clan::BodyDescription::set_awake (const bool value=true)
 Should body initially be awake or sleep? More...
 
void clan::BodyDescription::set_fixed_rotation (const bool value)
 Should this body be prevented from rotating? Useful for characters. More...
 
void clan::BodyDescription::set_as_bullet (const bool value=true)
 Set the body to act like a bullet. Gives more accuracy for fast moving bodies. More...
 
void clan::BodyDescription::set_active (const bool value=true)
 Does the body start out active? More...
 
void clan::BodyDescription::set_gravity_scale (const float scale)
 Scale the gravity applied to this body. More...
 

Construction

 clan::FixtureDescription::FixtureDescription ()
 Constructs a null instance. More...
 
 clan::FixtureDescription::FixtureDescription (const PhysicsWorld &pw)
 Constructs a Fixture Description. More...
 
 clan::FixtureDescription::FixtureDescription (const PhysicsContext &pc)
 Constructs a Fixture Description. More...
 
 clan::FixtureDescription::FixtureDescription (const FixtureDescription &copy)
 Copy operator. More...
 
virtual clan::FixtureDescription::~FixtureDescription ()
 

Attributes

bool clan::FixtureDescription::is_null () const
 Returns true if this object is invalid. More...
 
void clan::FixtureDescription::throw_if_null () const
 Throw an exception if this object is invalid. More...
 

Operations

void clan::FixtureDescription::set_shape (const Shape &shape)
 Set the shape of the Fixture. More...
 
void clan::FixtureDescription::set_friction (const float friction)
 The friction coefficient, usually in the range [0,1]. More...
 
void clan::FixtureDescription::set_restitution (const float restitution)
 The restitution (elasticity) usually in the range [0,1]. More...
 
void clan::FixtureDescription::set_density (const float density)
 The density, usually in kg/m^2. More...
 
void clan::FixtureDescription::set_as_sensor (const bool value=true)
 
void clan::FixtureDescription::set_filter ()
 Contact filtering data. More...
 
FixtureDescriptionclan::FixtureDescription::operator= (const FixtureDescription &copy)
 

Construction

 clan::DistanceJoint::DistanceJoint ()
 Constructs a null instance. More...
 
 clan::DistanceJoint::DistanceJoint (PhysicsContext &pc, const DistanceJointDescription &description)
 Constructs a DistanceJoint object. More...
 
virtual clan::DistanceJoint::~DistanceJoint ()
 

Attributes

bool clan::DistanceJoint::is_null () const
 Returns true if this object is invalid. More...
 
void clan::DistanceJoint::throw_if_null () const
 Throw an exception if this object is invalid. More...
 
bool clan::DistanceJoint::is_active () const
 Short-cut function to determine if either body is inactive. More...
 

Operations

DistanceJointclan::DistanceJoint::operator= (const DistanceJoint &copy)
 

Construction

 clan::DistanceJointDescription::DistanceJointDescription ()
 Constructs a null instance. More...
 
 clan::DistanceJointDescription::DistanceJointDescription (const PhysicsWorld &pw)
 Constructs a DistanceJointDescription object. More...
 
virtual clan::DistanceJointDescription::~DistanceJointDescription ()
 

Attributes

bool clan::DistanceJointDescription::is_null () const
 Returns true if this object is invalid. More...
 
void clan::DistanceJointDescription::throw_if_null () const
 Throw an exception if this object is invalid. More...
 
bool clan::DistanceJointDescription::is_active () const
 Short-cut function to determine if either body is inactive. More...
 

Operations

DistanceJointDescriptionclan::DistanceJointDescription::operator= (const DistanceJointDescription &copy)
 Copy assignment operator. More...
 
void clan::DistanceJointDescription::set_bodies (const Body &bodyA, const Body &bodyB, const Vec2f &anchorA, const Vec2f &anchorB)
 Sets two bodies to be connected by the joint. More...
 
void clan::DistanceJointDescription::set_body_a (const Body &body, const Vec2f &anchor)
 Sets first body to be connected by the joint. More...
 
void clan::DistanceJointDescription::set_body_b (const Body &body, const Vec2f &anchor)
 Sets second body to be connected by the joint. More...
 
void clan::DistanceJointDescription::set_damping_ratio (const float damping)
 Sets the damping ratio. 0 = no damping, 1 = critical damping. More...
 
void clan::DistanceJointDescription::set_length (const float length)
 Sets the natural length between the anchor points. More...
 

Implementation

std::shared_ptr< DistanceJointDescription_Impl > clan::DistanceJointDescription::impl
 

Construction

 clan::Joint::Joint ()
 Constructs a null instance. More...
 
virtual clan::Joint::~Joint ()
 

Attributes

JointType clan::Joint::get_Joint_type () const
 
virtual bool clan::Joint::is_null () const
 Returns true if this object is invalid. More...
 
virtual void clan::Joint::throw_if_null () const
 Throw an exception if this object is invalid. More...
 
virtual bool clan::Joint::is_active () const
 Short-cut function to determine if either body is inactive. More...
 
virtual Vec2f clan::Joint::get_reaction_force (float dt)
 Get the reaction force on bodyB at the joint anchor in Newtons. More...
 
virtual float clan::Joint::get_reaction_torque (float dt)
 Get the reaction torque on bodyB in N*m. More...
 
virtual Bodyclan::Joint::get_body_a ()
 Return the first body attached to this joint. More...
 
virtual Bodyclan::Joint::get_body_b ()
 Return the second body attached to this joint. More...
 
virtual Vec2f clan::Joint::get_anchor_a ()
 Return the anchor point on first body in world coordinates. More...
 
virtual Vec2f clan::Joint::get_anchor_b ()
 Return the second body attached to this joint. More...
 
virtual int clan::Joint::get_id () const
 Return the world's id of the joint. More...
 
bool clan::Joint::is_dummy () const
 Returns true if this joint is a dummy joint. More...
 

Operations

Jointclan::Joint::operator= (const Joint &copy)
 

Implementation

std::shared_ptr< Joint_Impl > clan::Joint::impl
 

Construction

 clan::MouseJoint::MouseJoint ()
 Constructs a null instance. More...
 
 clan::MouseJoint::MouseJoint (PhysicsContext &pc, const MouseJointDescription &description)
 Constructs a MouseJoint object. More...
 
virtual clan::MouseJoint::~MouseJoint ()
 

Attributes

bool clan::MouseJoint::is_null () const
 Returns true if this object is invalid. More...
 
void clan::MouseJoint::throw_if_null () const
 Throw an exception if this object is invalid. More...
 
bool clan::MouseJoint::is_active () const
 Short-cut function to determine if either body is inactive. More...
 

Operations

MouseJointclan::MouseJoint::operator= (const MouseJoint &copy)
 
bool clan::MouseJoint::grab (const Vec2f &target) const
 
bool clan::MouseJoint::grab (const Pointf &target) const
 
bool clan::MouseJoint::grab (const float x, const float y) const
 
bool clan::MouseJoint::grab (const int x, const int y) const
 
void clan::MouseJoint::release ()
 

Construction

 clan::MouseJointDescription::MouseJointDescription ()
 Constructs a null instance. More...
 
 clan::MouseJointDescription::MouseJointDescription (const PhysicsWorld &pw)
 Constructs a MouseJointDescription object. More...
 
virtual clan::MouseJointDescription::~MouseJointDescription ()
 

Attributes

bool clan::MouseJointDescription::is_null () const
 Returns true if this object is invalid. More...
 
void clan::MouseJointDescription::throw_if_null () const
 Throw an exception if this object is invalid. More...
 
bool clan::MouseJointDescription::is_active () const
 Short-cut function to determine if either body is inactive. More...
 

Operations

MouseJointDescriptionclan::MouseJointDescription::operator= (const MouseJointDescription &copy)
 Copy assignment operator. More...
 
void clan::MouseJointDescription::set_bodies (const Body &bodyA, const Body &bodyB)
 Sets two bodies to be connected by the joint. More...
 
void clan::MouseJointDescription::set_body_a (const Body &body)
 Sets first body to be connected by the joint. More...
 
void clan::MouseJointDescription::set_body_b (const Body &body)
 Sets second body to be connected by the joint. More...
 
void clan::MouseJointDescription::set_target (const Vec2f &target)
 Sets the target position of the mouse. More...
 
void clan::MouseJointDescription::set_max_force (const float value)
 Sets the maximum force the mouse joint is allowed to have. More...
 
void clan::MouseJointDescription::set_damping_ratio (const float damping)
 Sets the damping ratio. 0 = no damping, 1 = critical damping. More...
 
void clan::MouseJointDescription::set_frequency (const float frequency)
 Sets the response speed in Hz. More...
 

Implementation

std::shared_ptr< MouseJointDescription_Impl > clan::MouseJointDescription::impl
 

Construction

 clan::PrismaticJoint::PrismaticJoint ()
 Constructs a null instance. More...
 
 clan::PrismaticJoint::PrismaticJoint (PhysicsContext &pc, const PrismaticJointDescription &description)
 Constructs a PrismaticJoint object. More...
 
virtual clan::PrismaticJoint::~PrismaticJoint ()
 

Attributes

bool clan::PrismaticJoint::is_null () const
 Returns true if this object is invalid. More...
 
void clan::PrismaticJoint::throw_if_null () const
 Throw an exception if this object is invalid. More...
 
bool clan::PrismaticJoint::is_active () const
 Short-cut function to determine if either body is inactive. More...
 

Operations

PrismaticJointclan::PrismaticJoint::operator= (const PrismaticJoint &copy)
 

Construction

 clan::PrismaticJointDescription::PrismaticJointDescription ()
 Constructs a null instance. More...
 
 clan::PrismaticJointDescription::PrismaticJointDescription (const PhysicsWorld &pw)
 Constructs a PrismaticJointDescription object. More...
 
virtual clan::PrismaticJointDescription::~PrismaticJointDescription ()
 

Attributes

bool clan::PrismaticJointDescription::is_null () const
 Returns true if this object is invalid. More...
 
void clan::PrismaticJointDescription::throw_if_null () const
 Throw an exception if this object is invalid. More...
 
bool clan::PrismaticJointDescription::is_active () const
 Short-cut function to determine if either body is inactive. More...
 

Operations

PrismaticJointDescriptionclan::PrismaticJointDescription::operator= (const PrismaticJointDescription &copy)
 Copy assignment operator. More...
 
void clan::PrismaticJointDescription::set_bodies (const Body &bodyA, const Body &bodyB, const Vec2f &anchorA, const Vec2f &anchorB)
 Sets two bodies to be connected by the joint. More...
 
void clan::PrismaticJointDescription::set_body_a (const Body &body, const Vec2f &anchor)
 Sets first body to be connected by the joint. More...
 
void clan::PrismaticJointDescription::set_body_b (const Body &body, const Vec2f &anchor)
 Sets second body to be connected by the joint. More...
 
void clan::PrismaticJointDescription::set_axis_a (const Vec2f &axis)
 Sets the local translation unit axis in bodyA. More...
 
void clan::PrismaticJointDescription::set_reference_angle (const Angle &angle)
 Sets The constrained angle between the bodies: bodyB_angle - bodyA_angle. More...
 
void clan::PrismaticJointDescription::enable_limit (const bool value=true)
 Enable/disable the joint limit. More...
 
void clan::PrismaticJointDescription::set_translation_limits (const float min, const float max)
 Sets the translation limits for the prismatic joint. Usually in meters. More...
 
void clan::PrismaticJointDescription::set_translation_min (const float value)
 Sets The lower translation limit, usually in meters. More...
 
void clan::PrismaticJointDescription::set_translation_max (const float value)
 Sets The upper translation limit, usually in meters. More...
 
void clan::PrismaticJointDescription::set_as_motor (const bool value=true)
 Enable/disable the joint motor. More...
 
void clan::PrismaticJointDescription::set_max_motor_force (const float value)
 Sets The maximum motor torque, usually in N-m. More...
 
void clan::PrismaticJointDescription::set_motor_speed (const Angle &angle)
 Sets the desired motor speed. More...
 

Implementation

std::shared_ptr< PrismaticJointDescription_Impl > clan::PrismaticJointDescription::impl
 

Construction

 clan::RevoluteJoint::RevoluteJoint ()
 Constructs a null instance. More...
 
 clan::RevoluteJoint::RevoluteJoint (PhysicsContext &pc, const RevoluteJointDescription &description)
 Constructs a RevoluteJoint object. More...
 
virtual clan::RevoluteJoint::~RevoluteJoint ()
 

Attributes

bool clan::RevoluteJoint::is_null () const
 Returns true if this object is invalid. More...
 
void clan::RevoluteJoint::throw_if_null () const
 Throw an exception if this object is invalid. More...
 
bool clan::RevoluteJoint::is_active () const
 Short-cut function to determine if either body is inactive. More...
 

Operations

RevoluteJointclan::RevoluteJoint::operator= (const RevoluteJoint &copy)
 

Construction

 clan::RevoluteJointDescription::RevoluteJointDescription ()
 Constructs a null instance. More...
 
 clan::RevoluteJointDescription::RevoluteJointDescription (const PhysicsWorld &pw)
 Constructs a RevoluteJointDescription object. More...
 
virtual clan::RevoluteJointDescription::~RevoluteJointDescription ()
 

Attributes

bool clan::RevoluteJointDescription::is_null () const
 Returns true if this object is invalid. More...
 
void clan::RevoluteJointDescription::throw_if_null () const
 Throw an exception if this object is invalid. More...
 
bool clan::RevoluteJointDescription::is_active () const
 Short-cut function to determine if either body is inactive. More...
 
bool clan::RevoluteJointDescription::is_motor () const
 
float clan::RevoluteJointDescription::get_motor_speed () const
 
Angle clan::RevoluteJointDescription::get_reference_angle () const
 
Angle clan::RevoluteJointDescription::get_lower_angle () const
 
Angle clan::RevoluteJointDescription::get_upper_angle () const
 

Operations

RevoluteJointDescriptionclan::RevoluteJointDescription::operator= (const RevoluteJointDescription &copy)
 Copy assignment operator. More...
 
void clan::RevoluteJointDescription::set_bodies (const Body &bodyA, const Body &bodyB, const Vec2f &anchor)
 Sets two bodies to be connected by the joint. More...
 
void clan::RevoluteJointDescription::set_body_a (const Body &body, const Vec2f &anchor)
 Sets first body to be connected by the joint. More...
 
void clan::RevoluteJointDescription::set_body_b (const Body &body, const Vec2f &anchor)
 Sets second body to be connected by the joint. More...
 
void clan::RevoluteJointDescription::set_as_motor (const bool value=true)
 Enables the joint motor. More...
 
void clan::RevoluteJointDescription::set_motor_speed (const Angle speed)
 Apply the desired motor speed. More...
 
void clan::RevoluteJointDescription::set_reference_angle (const Angle angle)
 The bodyB angle minus bodyA angle in the reference state. More...
 
void clan::RevoluteJointDescription::set_max_motor_torque (const float value)
 Set the maximum motor torque used to achieve the desired motor speed. Usually in N-m. More...
 
void clan::RevoluteJointDescription::set_angle_limit (const Angle lower, const Angle upper)
 Set limits for the angle of the joint. More...
 
void clan::RevoluteJointDescription::set_lower_angle (const Angle angle)
 The lower angle for the joint limit. More...
 
void clan::RevoluteJointDescription::set_upper_angle (const Angle angle)
 The upper angle for the joint limit. More...
 

Implementation

std::shared_ptr< RevoluteJointDescription_Impl > clan::RevoluteJointDescription::impl
 

Detailed Description

Enumeration Type Documentation

◆ BodyType

Body types.

Enumerator
body_static 
body_kinematic 
body_dynamic 

◆ JointType

Joint types.

Enumerator
Joint_Distance 
Joint_Friction 
Joint_Gear 
Joint_Mouse 
Joint_Prismatic 
Joint_Pulley 
Joint_Revolute 
Joint_Rope 
Joint_Weld 
Joint_Wheel 
Joint_None 

◆ QueryResultType

Query types.

Enumerator
query_raycast 
query_aabb 

Function Documentation

◆ Body() [1/3]

clan::Body::Body ( )

Constructs a null instance.

◆ Body() [2/3]

clan::Body::Body ( PhysicsContext pc,
const BodyDescription description 
)

Constructs a Body.

Parameters
pc= Physics Context
description= Body Description

◆ Body() [3/3]

clan::Body::Body ( PhysicsContext pc,
const std::string &  resource_id,
const XMLResourceDocument resources 
)

Constructs a Body.

Parameters
pc= Physics Context
resource_id= String Ref
resources= Resource Manager

◆ BodyDescription() [1/5]

clan::BodyDescription::BodyDescription ( )

Constructs a null instance.

◆ BodyDescription() [2/5]

clan::BodyDescription::BodyDescription ( const PhysicsWorld pw)

Constructs a BodyDescription.

Parameters
pw= Physics World

◆ BodyDescription() [3/5]

clan::BodyDescription::BodyDescription ( const PhysicsContext pc)

Constructs a BodyDescription.

Parameters
pc= Physics Context

◆ BodyDescription() [4/5]

clan::BodyDescription::BodyDescription ( const PhysicsContext pc,
const std::string &  resource_id,
const XMLResourceDocument resources 
)

Constructs a BodyDescription.

Parameters
pc= Physics Context
resource_id= String Ref
resources= Resource Manager

◆ BodyDescription() [5/5]

clan::BodyDescription::BodyDescription ( const BodyDescription copy)

Constructs a BodyDescription.

Parameters
copy= Body Description

◆ DistanceJoint() [1/2]

clan::DistanceJoint::DistanceJoint ( )

Constructs a null instance.

◆ DistanceJoint() [2/2]

clan::DistanceJoint::DistanceJoint ( PhysicsContext pc,
const DistanceJointDescription description 
)

Constructs a DistanceJoint object.

Parameters
description= a DistanceJoint Description object.

◆ DistanceJointDescription() [1/2]

clan::DistanceJointDescription::DistanceJointDescription ( )

Constructs a null instance.

◆ DistanceJointDescription() [2/2]

clan::DistanceJointDescription::DistanceJointDescription ( const PhysicsWorld pw)

Constructs a DistanceJointDescription object.

Parameters
pw= Physics World.

◆ Fixture() [1/2]

clan::Fixture::Fixture ( )

Constructs a null instance.

◆ Fixture() [2/2]

clan::Fixture::Fixture ( PhysicsContext pc,
Body body,
const FixtureDescription description 
)

Constructs a World.

Parameters
pc= Physics Context of the physics world.
body= Body
description= Fixture Description

◆ FixtureDescription() [1/4]

clan::FixtureDescription::FixtureDescription ( )

Constructs a null instance.

◆ FixtureDescription() [2/4]

clan::FixtureDescription::FixtureDescription ( const PhysicsWorld pw)

Constructs a Fixture Description.

Parameters
pw= Physics World

◆ FixtureDescription() [3/4]

clan::FixtureDescription::FixtureDescription ( const PhysicsContext pc)

Constructs a Fixture Description.

Parameters
pc= Physics Context

◆ FixtureDescription() [4/4]

clan::FixtureDescription::FixtureDescription ( const FixtureDescription copy)

Copy operator.

◆ Joint()

clan::Joint::Joint ( )

Constructs a null instance.

◆ MouseJoint() [1/2]

clan::MouseJoint::MouseJoint ( )

Constructs a null instance.

◆ MouseJoint() [2/2]

clan::MouseJoint::MouseJoint ( PhysicsContext pc,
const MouseJointDescription description 
)

Constructs a MouseJoint object.

Parameters
description= a MouseJoint Description object.

◆ MouseJointDescription() [1/2]

clan::MouseJointDescription::MouseJointDescription ( )

Constructs a null instance.

◆ MouseJointDescription() [2/2]

clan::MouseJointDescription::MouseJointDescription ( const PhysicsWorld pw)

Constructs a MouseJointDescription object.

Parameters
pw= Physics World.

◆ PrismaticJoint() [1/2]

clan::PrismaticJoint::PrismaticJoint ( )

Constructs a null instance.

◆ PrismaticJoint() [2/2]

clan::PrismaticJoint::PrismaticJoint ( PhysicsContext pc,
const PrismaticJointDescription description 
)

Constructs a PrismaticJoint object.

Parameters
description= a PrismaticJoint Description object.

◆ PrismaticJointDescription() [1/2]

clan::PrismaticJointDescription::PrismaticJointDescription ( )

Constructs a null instance.

◆ PrismaticJointDescription() [2/2]

clan::PrismaticJointDescription::PrismaticJointDescription ( const PhysicsWorld pw)

Constructs a PrismaticJointDescription object.

Parameters
pw= Physics World.

◆ RevoluteJoint() [1/2]

clan::RevoluteJoint::RevoluteJoint ( )

Constructs a null instance.

◆ RevoluteJoint() [2/2]

clan::RevoluteJoint::RevoluteJoint ( PhysicsContext pc,
const RevoluteJointDescription description 
)

Constructs a RevoluteJoint object.

Parameters
description= a RevoluteJoint Description object.

◆ RevoluteJointDescription() [1/2]

clan::RevoluteJointDescription::RevoluteJointDescription ( )

Constructs a null instance.

◆ RevoluteJointDescription() [2/2]

clan::RevoluteJointDescription::RevoluteJointDescription ( const PhysicsWorld pw)

Constructs a RevoluteJointDescription object.

Parameters
pw= Physics World.

◆ ~Body()

clan::Body::~Body ( )

◆ ~BodyDescription()

virtual clan::BodyDescription::~BodyDescription ( )
virtual

◆ ~DistanceJoint()

virtual clan::DistanceJoint::~DistanceJoint ( )
virtual

◆ ~DistanceJointDescription()

virtual clan::DistanceJointDescription::~DistanceJointDescription ( )
virtual

◆ ~Fixture()

clan::Fixture::~Fixture ( )

◆ ~FixtureDescription()

virtual clan::FixtureDescription::~FixtureDescription ( )
virtual

◆ ~Joint()

virtual clan::Joint::~Joint ( )
virtual

◆ ~MouseJoint()

virtual clan::MouseJoint::~MouseJoint ( )
virtual

◆ ~MouseJointDescription()

virtual clan::MouseJointDescription::~MouseJointDescription ( )
virtual

◆ ~PrismaticJoint()

virtual clan::PrismaticJoint::~PrismaticJoint ( )
virtual

◆ ~PrismaticJointDescription()

virtual clan::PrismaticJointDescription::~PrismaticJointDescription ( )
virtual

◆ ~RevoluteJoint()

virtual clan::RevoluteJoint::~RevoluteJoint ( )
virtual

◆ ~RevoluteJointDescription()

virtual clan::RevoluteJointDescription::~RevoluteJointDescription ( )
virtual

◆ allow_sleep()

void clan::BodyDescription::allow_sleep ( const bool  value = true)

◆ apply_angular_impulse()

void clan::Body::apply_angular_impulse ( const float  impulse)

Apply an angular impulse.

Parameters
impulse= the angular impulse in units of kg*m*m/s

◆ apply_force()

void clan::Body::apply_force ( const Vec2f force,
const Vec2f 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
force= the world force vector, usually in Newtons (N).
point= the world position of the point of application.

◆ apply_force_to_center()

void clan::Body::apply_force_to_center ( const Vec2f force)

Apply a force to the center of mass.

This wakes up the body.

◆ apply_linear_impulse()

void clan::Body::apply_linear_impulse ( const Vec2f impulse,
const Vec2f 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.

◆ apply_torque()

void clan::Body::apply_torque ( const float  torque)

Apply a force to the center of mass.

This wakes up the body.

Parameters
force= the world force vector, usually in Newtons (N).

◆ enable_limit()

void clan::PrismaticJointDescription::enable_limit ( const bool  value = true)

Enable/disable the joint limit.

◆ get_anchor_a()

virtual Vec2f clan::Joint::get_anchor_a ( )
virtual

Return the anchor point on first body in world coordinates.

◆ get_anchor_b()

virtual Vec2f clan::Joint::get_anchor_b ( )
virtual

Return the second body attached to this joint.

◆ get_angle()

Angle clan::Body::get_angle ( ) const

Get the angle of the body.

◆ get_angular_damping()

float clan::Body::get_angular_damping ( ) const

the angular damping of the body.

◆ get_angular_velocity()

Angle clan::Body::get_angular_velocity ( ) const

Return the angular velocity of the body.

◆ get_body_a()

virtual Body* clan::Joint::get_body_a ( )
virtual

Return the first body attached to this joint.

◆ get_body_b()

virtual Body* clan::Joint::get_body_b ( )
virtual

Return the second body attached to this joint.

◆ get_data()

PhysicsObject* clan::Body::get_data ( )

Returns the physics object data.

◆ get_gravity_scale()

float clan::Body::get_gravity_scale ( )

Get the gravity scale of the body.

◆ get_id() [1/2]

virtual int clan::Joint::get_id ( ) const
virtual

Return the world's id of the joint.

◆ get_id() [2/2]

int clan::Body::get_id ( ) const

Return the world's id of the body.

◆ get_Joint_type()

JointType clan::Joint::get_Joint_type ( ) const

◆ get_linear_damping()

float clan::Body::get_linear_damping ( ) const

Get the linear damping of the body.

◆ get_linear_velocity()

Vec2f clan::Body::get_linear_velocity ( ) const

Return the linear velocity of the body.

◆ get_lower_angle()

Angle clan::RevoluteJointDescription::get_lower_angle ( ) const

◆ get_motor_speed()

float clan::RevoluteJointDescription::get_motor_speed ( ) const

◆ get_position()

Vec2f clan::Body::get_position ( ) const

Get the position of the body.

◆ get_reaction_force()

virtual Vec2f clan::Joint::get_reaction_force ( float  dt)
virtual

Get the reaction force on bodyB at the joint anchor in Newtons.

◆ get_reaction_torque()

virtual float clan::Joint::get_reaction_torque ( float  dt)
virtual

Get the reaction torque on bodyB in N*m.

◆ get_reference_angle()

Angle clan::RevoluteJointDescription::get_reference_angle ( ) const

◆ get_type()

BodyType clan::Body::get_type ( ) const

Get the type of this body.

◆ get_upper_angle()

Angle clan::RevoluteJointDescription::get_upper_angle ( ) const

◆ grab() [1/4]

bool clan::MouseJoint::grab ( const Vec2f target) const

◆ grab() [2/4]

bool clan::MouseJoint::grab ( const Pointf target) const

◆ grab() [3/4]

bool clan::MouseJoint::grab ( const float  x,
const float  y 
) const

◆ grab() [4/4]

bool clan::MouseJoint::grab ( const int  x,
const int  y 
) const

◆ has_fixed_rotation()

bool clan::Body::has_fixed_rotation ( ) const

Returns true if the body has fixed rotation.

◆ is_active() [1/10]

bool clan::MouseJointDescription::is_active ( ) const

Short-cut function to determine if either body is inactive.

◆ is_active() [2/10]

bool clan::PrismaticJoint::is_active ( ) const
virtual

Short-cut function to determine if either body is inactive.

Reimplemented from clan::Joint.

◆ is_active() [3/10]

bool clan::PrismaticJointDescription::is_active ( ) const

Short-cut function to determine if either body is inactive.

◆ is_active() [4/10]

bool clan::RevoluteJoint::is_active ( ) const
virtual

Short-cut function to determine if either body is inactive.

Reimplemented from clan::Joint.

◆ is_active() [5/10]

bool clan::DistanceJoint::is_active ( ) const
virtual

Short-cut function to determine if either body is inactive.

Reimplemented from clan::Joint.

◆ is_active() [6/10]

bool clan::RevoluteJointDescription::is_active ( ) const

Short-cut function to determine if either body is inactive.

◆ is_active() [7/10]

bool clan::DistanceJointDescription::is_active ( ) const

Short-cut function to determine if either body is inactive.

◆ is_active() [8/10]

bool clan::MouseJoint::is_active ( ) const
virtual

Short-cut function to determine if either body is inactive.

Reimplemented from clan::Joint.

◆ is_active() [9/10]

virtual bool clan::Joint::is_active ( ) const
virtual

Short-cut function to determine if either body is inactive.

Reimplemented in clan::MouseJoint, clan::DistanceJoint, clan::PrismaticJoint, and clan::RevoluteJoint.

◆ is_active() [10/10]

bool clan::Body::is_active ( ) const

Returns true if this body is active in the simulation.

◆ is_awake()

bool clan::Body::is_awake ( ) const

Returns true if this body is not sleeping.

◆ is_bullet()

bool clan::Body::is_bullet ( ) const

Returns true if this body is a bullet.

◆ is_dummy() [1/2]

bool clan::Joint::is_dummy ( ) const

Returns true if this joint is a dummy joint.

◆ is_dummy() [2/2]

bool clan::Body::is_dummy ( ) const

Returns true if this body is a dummy body.

◆ is_motor()

bool clan::RevoluteJointDescription::is_motor ( ) const

◆ is_null() [1/12]

bool clan::MouseJointDescription::is_null ( ) const
inline

Returns true if this object is invalid.

◆ is_null() [2/12]

bool clan::DistanceJoint::is_null ( ) const
inlinevirtual

Returns true if this object is invalid.

Reimplemented from clan::Joint.

◆ is_null() [3/12]

bool clan::PrismaticJoint::is_null ( ) const
inlinevirtual

Returns true if this object is invalid.

Reimplemented from clan::Joint.

◆ is_null() [4/12]

bool clan::FixtureDescription::is_null ( ) const
inline

Returns true if this object is invalid.

◆ is_null() [5/12]

bool clan::PrismaticJointDescription::is_null ( ) const
inline

Returns true if this object is invalid.

References clan::max(), and clan::min().

◆ is_null() [6/12]

bool clan::RevoluteJoint::is_null ( ) const
inlinevirtual

Returns true if this object is invalid.

Reimplemented from clan::Joint.

◆ is_null() [7/12]

bool clan::RevoluteJointDescription::is_null ( ) const
inline

Returns true if this object is invalid.

◆ is_null() [8/12]

bool clan::DistanceJointDescription::is_null ( ) const
inline

Returns true if this object is invalid.

◆ is_null() [9/12]

bool clan::MouseJoint::is_null ( ) const
inlinevirtual

Returns true if this object is invalid.

Reimplemented from clan::Joint.

◆ is_null() [10/12]

bool clan::Body::is_null ( ) const
inline

Returns true if this object is invalid.

◆ is_null() [11/12]

virtual bool clan::Joint::is_null ( ) const
inlinevirtual

Returns true if this object is invalid.

Reimplemented in clan::MouseJoint, clan::DistanceJoint, clan::PrismaticJoint, and clan::RevoluteJoint.

◆ is_null() [12/12]

bool clan::BodyDescription::is_null ( ) const
inline

Returns true if this object is invalid.

◆ kill()

void clan::Body::kill ( )

Remove the body from the simulation. The body gets swapped with a dummy body.

◆ operator=() [1/12]

DistanceJoint& clan::DistanceJoint::operator= ( const DistanceJoint copy)

◆ operator=() [2/12]

RevoluteJoint& clan::RevoluteJoint::operator= ( const RevoluteJoint copy)

◆ operator=() [3/12]

PrismaticJoint& clan::PrismaticJoint::operator= ( const PrismaticJoint copy)

◆ operator=() [4/12]

MouseJoint& clan::MouseJoint::operator= ( const MouseJoint copy)

◆ operator=() [5/12]

MouseJointDescription& clan::MouseJointDescription::operator= ( const MouseJointDescription copy)

Copy assignment operator.

◆ operator=() [6/12]

PrismaticJointDescription& clan::PrismaticJointDescription::operator= ( const PrismaticJointDescription copy)

Copy assignment operator.

◆ operator=() [7/12]

DistanceJointDescription& clan::DistanceJointDescription::operator= ( const DistanceJointDescription copy)

Copy assignment operator.

◆ operator=() [8/12]

FixtureDescription& clan::FixtureDescription::operator= ( const FixtureDescription copy)

◆ operator=() [9/12]

RevoluteJointDescription& clan::RevoluteJointDescription::operator= ( const RevoluteJointDescription copy)

Copy assignment operator.

◆ operator=() [10/12]

BodyDescription& clan::BodyDescription::operator= ( const BodyDescription copy)

Copy assignment operator.

◆ operator=() [11/12]

Joint& clan::Joint::operator= ( const Joint copy)

◆ operator=() [12/12]

Body& clan::Body::operator= ( const Body copy)

Copy operator.

◆ release()

void clan::MouseJoint::release ( )

◆ reset_mass_data()

void clan::Body::reset_mass_data ( )

This resets the mass properties to the sum of the mass properties of the fixtures.

Normally it does not need to be called unless you called set_mass_data to override the mass and you later want to reset the mass.

◆ set_active() [1/2]

void clan::BodyDescription::set_active ( const bool  value = true)

Does the body start out active?

◆ set_active() [2/2]

void clan::Body::set_active ( const bool  value = true)

Set this body to be active in the simulation.

◆ set_angle() [1/2]

void clan::BodyDescription::set_angle ( const Angle angle)

Set the Physics World angle of the body.

◆ set_angle() [2/2]

void clan::Body::set_angle ( const Angle angle)

set the angle of the body

◆ set_angle_limit()

void clan::RevoluteJointDescription::set_angle_limit ( const Angle  lower,
const Angle  upper 
)

Set limits for the angle of the joint.

◆ set_angular_damping() [1/2]

void clan::BodyDescription::set_angular_damping ( const float  damping)

◆ set_angular_damping() [2/2]

void clan::Body::set_angular_damping ( const float  damping)

Set the angular damping of the body.

◆ set_angular_velocity() [1/2]

void clan::BodyDescription::set_angular_velocity ( const Angle velocity)

Set the angular velocity of the body.

◆ set_angular_velocity() [2/2]

void clan::Body::set_angular_velocity ( const Angle velocity)

set the angular velocity of the body.

◆ set_as_bullet() [1/2]

void clan::BodyDescription::set_as_bullet ( const bool  value = true)

Set the body to act like a bullet. Gives more accuracy for fast moving bodies.

◆ set_as_bullet() [2/2]

void clan::Body::set_as_bullet ( const bool  value = true)

Set this body to be treated like a bullet for continuous collision detection.

◆ set_as_motor() [1/2]

void clan::RevoluteJointDescription::set_as_motor ( const bool  value = true)

Enables the joint motor.

◆ set_as_motor() [2/2]

void clan::PrismaticJointDescription::set_as_motor ( const bool  value = true)

Enable/disable the joint motor.

◆ set_as_sensor()

void clan::FixtureDescription::set_as_sensor ( const bool  value = true)

◆ set_awake() [1/2]

void clan::BodyDescription::set_awake ( const bool  value = true)

Should body initially be awake or sleep?

◆ set_awake() [2/2]

void clan::Body::set_awake ( const bool  value = true)

Set this body to sleep.

◆ set_axis_a()

void clan::PrismaticJointDescription::set_axis_a ( const Vec2f axis)

Sets the local translation unit axis in bodyA.

Parameters
axis= vector representing the translation unit axis.

◆ set_bodies() [1/4]

void clan::MouseJointDescription::set_bodies ( const Body bodyA,
const Body bodyB 
)

Sets two bodies to be connected by the joint.

Parameters
bodyA= First body to be connected.
bodyB= Second body to be connected.

◆ set_bodies() [2/4]

void clan::PrismaticJointDescription::set_bodies ( const Body bodyA,
const Body bodyB,
const Vec2f anchorA,
const Vec2f anchorB 
)

Sets two bodies to be connected by the joint.

Parameters
bodyA= First body to be connected.
bodyB= Second body to be connected.
anchorA= The local anchor point relative to bodyA's origin.
anchorB= The local anchor point relative to bodyB's origin.

◆ set_bodies() [3/4]

void clan::DistanceJointDescription::set_bodies ( const Body bodyA,
const Body bodyB,
const Vec2f anchorA,
const Vec2f anchorB 
)

Sets two bodies to be connected by the joint.

Parameters
bodyA= First body to be connected.
bodyB= Second body to be connected.
anchorA= The local anchor point relative to bodyA's origin.
anchorB= The local anchor point relative to bodyB's origin.

◆ set_bodies() [4/4]

void clan::RevoluteJointDescription::set_bodies ( const Body bodyA,
const Body bodyB,
const Vec2f anchor 
)

Sets two bodies to be connected by the joint.

Parameters
bodyA= First body to be connected.
bodyB= Second body to be connected.
anchor= The anchor point relative to world.

◆ set_body_a() [1/4]

void clan::MouseJointDescription::set_body_a ( const Body body)

Sets first body to be connected by the joint.

Parameters
body= body to be connected.

◆ set_body_a() [2/4]

void clan::PrismaticJointDescription::set_body_a ( const Body body,
const Vec2f anchor 
)

Sets first body to be connected by the joint.

Parameters
body= body to be connected.
anchor= The local anchor point relative to body's origin.

◆ set_body_a() [3/4]

void clan::DistanceJointDescription::set_body_a ( const Body body,
const Vec2f anchor 
)

Sets first body to be connected by the joint.

Parameters
body= body to be connected.
anchor= The local anchor point relative to body's origin.

◆ set_body_a() [4/4]

void clan::RevoluteJointDescription::set_body_a ( const Body body,
const Vec2f anchor 
)

Sets first body to be connected by the joint.

Parameters
body= body to be connected.
anchor= The local anchor point relative to body's origin.

◆ set_body_b() [1/4]

void clan::MouseJointDescription::set_body_b ( const Body body)

Sets second body to be connected by the joint.

Parameters
body= body to be connected.

◆ set_body_b() [2/4]

void clan::DistanceJointDescription::set_body_b ( const Body body,
const Vec2f anchor 
)

Sets second body to be connected by the joint.

Parameters
body= body to be connected.
anchor= The local anchor point relative to body's origin.

◆ set_body_b() [3/4]

void clan::PrismaticJointDescription::set_body_b ( const Body body,
const Vec2f anchor 
)

Sets second body to be connected by the joint.

Parameters
body= body to be connected.
anchor= The local anchor point relative to body's origin.

◆ set_body_b() [4/4]

void clan::RevoluteJointDescription::set_body_b ( const Body body,
const Vec2f anchor 
)

Sets second body to be connected by the joint.

Parameters
body= body to be connected.
anchor= The local anchor point relative to body's origin.

◆ set_damping_ratio() [1/2]

void clan::MouseJointDescription::set_damping_ratio ( const float  damping)

Sets the damping ratio. 0 = no damping, 1 = critical damping.

◆ set_damping_ratio() [2/2]

void clan::DistanceJointDescription::set_damping_ratio ( const float  damping)

Sets the damping ratio. 0 = no damping, 1 = critical damping.

◆ set_data()

void clan::Body::set_data ( PhysicsObject data)

Set the physics object object that is going to process collision events.

◆ set_density()

void clan::FixtureDescription::set_density ( const float  density)

The density, usually in kg/m^2.

◆ set_filter()

void clan::FixtureDescription::set_filter ( )

Contact filtering data.

◆ set_fixed_rotation() [1/2]

void clan::BodyDescription::set_fixed_rotation ( const bool  value)

Should this body be prevented from rotating? Useful for characters.

◆ set_fixed_rotation() [2/2]

void clan::Body::set_fixed_rotation ( const bool  value = true)

Set this body to use fixed rotation. This causes the mass to be reset.

◆ set_frequency()

void clan::MouseJointDescription::set_frequency ( const float  frequency)

Sets the response speed in Hz.

◆ set_friction()

void clan::FixtureDescription::set_friction ( const float  friction)

The friction coefficient, usually in the range [0,1].

◆ set_gravity_scale() [1/2]

void clan::BodyDescription::set_gravity_scale ( const float  scale)

Scale the gravity applied to this body.

◆ set_gravity_scale() [2/2]

void clan::Body::set_gravity_scale ( const float  scale)

Set the gravity scale of the body.

◆ set_length()

void clan::DistanceJointDescription::set_length ( const float  length)

Sets the natural length between the anchor points.

◆ set_linear_damping() [1/2]

void clan::BodyDescription::set_linear_damping ( const float  damping)

◆ set_linear_damping() [2/2]

void clan::Body::set_linear_damping ( const float  damping)

Set the linear damping of the body.

◆ set_linear_velocity() [1/2]

void clan::BodyDescription::set_linear_velocity ( const Vec2f velocity)

Set the linear velocity of the body's origin in Physics World co-ordinates.

◆ set_linear_velocity() [2/2]

void clan::Body::set_linear_velocity ( const Vec2f velocity)

set the linear velocity of the body.

◆ set_lower_angle()

void clan::RevoluteJointDescription::set_lower_angle ( const Angle  angle)

The lower angle for the joint limit.

◆ set_max_force()

void clan::MouseJointDescription::set_max_force ( const float  value)

Sets the maximum force the mouse joint is allowed to have.

◆ set_max_motor_force()

void clan::PrismaticJointDescription::set_max_motor_force ( const float  value)

Sets The maximum motor torque, usually in N-m.

◆ set_max_motor_torque()

void clan::RevoluteJointDescription::set_max_motor_torque ( const float  value)

Set the maximum motor torque used to achieve the desired motor speed. Usually in N-m.

◆ set_motor_speed() [1/2]

void clan::RevoluteJointDescription::set_motor_speed ( const Angle  speed)

Apply the desired motor speed.

◆ set_motor_speed() [2/2]

void clan::PrismaticJointDescription::set_motor_speed ( const Angle angle)

Sets the desired motor speed.

◆ set_position() [1/5]

void clan::BodyDescription::set_position ( const Vec2f position)

◆ set_position() [2/5]

void clan::BodyDescription::set_position ( const Pointf position)

◆ set_position() [3/5]

void clan::BodyDescription::set_position ( const int  x,
const int  y 
)

◆ set_position() [4/5]

void clan::BodyDescription::set_position ( const float  x,
const float  y 
)

◆ set_position() [5/5]

void clan::Body::set_position ( const Vec2f pos)

add a fixture to the body.

set the position of the body.

◆ set_reference_angle() [1/2]

void clan::PrismaticJointDescription::set_reference_angle ( const Angle angle)

Sets The constrained angle between the bodies: bodyB_angle - bodyA_angle.

Parameters
angle= angle between the bodies.

◆ set_reference_angle() [2/2]

void clan::RevoluteJointDescription::set_reference_angle ( const Angle  angle)

The bodyB angle minus bodyA angle in the reference state.

◆ set_restitution()

void clan::FixtureDescription::set_restitution ( const float  restitution)

The restitution (elasticity) usually in the range [0,1].

◆ set_shape()

void clan::FixtureDescription::set_shape ( const Shape shape)

Set the shape of the Fixture.

◆ set_target()

void clan::MouseJointDescription::set_target ( const Vec2f target)

Sets the target position of the mouse.

◆ set_translation_limits()

void clan::PrismaticJointDescription::set_translation_limits ( const float  min,
const float  max 
)

Sets the translation limits for the prismatic joint. Usually in meters.

◆ set_translation_max()

void clan::PrismaticJointDescription::set_translation_max ( const float  value)

Sets The upper translation limit, usually in meters.

◆ set_translation_min()

void clan::PrismaticJointDescription::set_translation_min ( const float  value)

Sets The lower translation limit, usually in meters.

◆ set_type() [1/2]

void clan::BodyDescription::set_type ( const BodyType  type)

◆ set_type() [2/2]

void clan::Body::set_type ( const BodyType  type)

Set the type of this body. This may alter the mass and velocity.

◆ set_upper_angle()

void clan::RevoluteJointDescription::set_upper_angle ( const Angle  angle)

The upper angle for the joint limit.

◆ sig_begin_collision()

Signal_v1<Body>& clan::Body::sig_begin_collision ( )

Signal emitted when a collision with other body occurs.

Returns
Signal_v1<Body>

◆ sig_body_deletion()

Signal_v0& clan::Body::sig_body_deletion ( )

Signal emitted when the body is deleted.

Returns
Signal_v0

◆ sig_end_collision()

Signal_v1<Body>& clan::Body::sig_end_collision ( )

Signal emitted when a collision with other body ends.

Returns
Signal_v1<Body>

◆ throw_if_null() [1/12]

void clan::DistanceJoint::throw_if_null ( ) const
virtual

Throw an exception if this object is invalid.

Reimplemented from clan::Joint.

◆ throw_if_null() [2/12]

void clan::FixtureDescription::throw_if_null ( ) const

Throw an exception if this object is invalid.

◆ throw_if_null() [3/12]

void clan::RevoluteJoint::throw_if_null ( ) const
virtual

Throw an exception if this object is invalid.

Reimplemented from clan::Joint.

◆ throw_if_null() [4/12]

void clan::MouseJointDescription::throw_if_null ( ) const

Throw an exception if this object is invalid.

◆ throw_if_null() [5/12]

void clan::RevoluteJointDescription::throw_if_null ( ) const

Throw an exception if this object is invalid.

◆ throw_if_null() [6/12]

void clan::PrismaticJoint::throw_if_null ( ) const
virtual

Throw an exception if this object is invalid.

Reimplemented from clan::Joint.

◆ throw_if_null() [7/12]

void clan::DistanceJointDescription::throw_if_null ( ) const

Throw an exception if this object is invalid.

◆ throw_if_null() [8/12]

void clan::PrismaticJointDescription::throw_if_null ( ) const

Throw an exception if this object is invalid.

◆ throw_if_null() [9/12]

void clan::MouseJoint::throw_if_null ( ) const
virtual

Throw an exception if this object is invalid.

Reimplemented from clan::Joint.

◆ throw_if_null() [10/12]

void clan::Body::throw_if_null ( ) const

Throw an exception if this object is invalid.

◆ throw_if_null() [11/12]

virtual void clan::Joint::throw_if_null ( ) const
virtual

Throw an exception if this object is invalid.

Reimplemented in clan::MouseJoint, clan::DistanceJoint, clan::PrismaticJoint, and clan::RevoluteJoint.

◆ throw_if_null() [12/12]

void clan::BodyDescription::throw_if_null ( ) const

Throw an exception if this object is invalid.

Variable Documentation

◆ impl [1/5]

std::shared_ptr<MouseJointDescription_Impl> clan::MouseJointDescription::impl
protected

◆ impl [2/5]

std::shared_ptr<DistanceJointDescription_Impl> clan::DistanceJointDescription::impl
protected

◆ impl [3/5]

std::shared_ptr<Joint_Impl> clan::Joint::impl
protected

◆ impl [4/5]

std::shared_ptr<RevoluteJointDescription_Impl> clan::RevoluteJointDescription::impl
protected

◆ impl [5/5]

std::shared_ptr<PrismaticJointDescription_Impl> clan::PrismaticJointDescription::impl
protected

Friends

◆ Body [1/2]

friend class Body
friend

◆ Body [2/2]

friend class Body
friend

◆ Body_Impl [1/2]

friend class Body_Impl
friend

◆ Body_Impl [2/2]

friend class Body_Impl
friend

◆ DistanceJoint

friend class DistanceJoint
friend

◆ DistanceJointDescription

friend class DistanceJointDescription
friend

◆ Fixture [1/2]

friend class Fixture
friend

◆ Fixture [2/2]

friend class Fixture
friend

◆ Fixture_Impl [1/2]

friend class Fixture_Impl
friend

◆ Fixture_Impl [2/2]

friend class Fixture_Impl
friend

◆ MouseJoint

friend class MouseJoint
friend

◆ MouseJointDescription

friend class MouseJointDescription
friend

◆ PhysicsContext [1/2]

friend class PhysicsContext
friend

◆ PhysicsContext [2/2]

friend class PhysicsContext
friend

◆ PhysicsContext_Impl [1/2]

friend class PhysicsContext_Impl
friend

◆ PhysicsContext_Impl [2/2]

friend class PhysicsContext_Impl
friend

◆ PhysicsListener

friend class PhysicsListener
friend

◆ PrismaticJoint

friend class PrismaticJoint
friend

◆ PrismaticJointDescription

friend class PrismaticJointDescription
friend

◆ RevoluteJoint

friend class RevoluteJoint
friend

◆ RevoluteJointDescription

friend class RevoluteJointDescription
friend