Public Member Functions | Public Attributes

bl7::rigidbodies2::RigidBody Class Reference

#include <RigidBody.h>

List of all members.

Public Member Functions

 RigidBody (void)
 ~RigidBody (void)
 RigidBody (const RigidBody &rhs)
RigidBodyoperator= (const RigidBody &rhs)
ml7::Vector2 get_position () const
void get_position (ml7::Vector2 *p) const
float get_orientation () const
void get_orientation (float *phi) const
ml7::Vector2 get_velocity () const
void get_velocity (ml7::Vector2 *v) const
float get_rotation () const
void get_rotation (float *omega) const
ml7::Vector2 get_linear_acceleration () const
void get_linear_acceleration (ml7::Vector2 *a) const
float get_angular_acceleration () const
void get_angular_acceleration (float *alpha) const
ml7::Vector2 get_force () const
void get_force (ml7::Vector2 *f) const
float get_torque () const
void get_torque (float *tau) const
float get_linear_damping () const
void get_linear_damping (float *d) const
float get_angular_damping () const
void get_angular_damping (float *d) const
float get_inverse_mass () const
void get_inverse_mass (float *im) const
float get_inverse_inertia () const
void get_inverse_inertia (float *imoi) const
float get_mass () const
void get_mass (float *m) const
float get_inertia () const
void get_inertia (float *moi) const
bool has_finite_mass () const
bool has_finite_inertia () const
float get_density () const
void get_density (float *rho) const
float get_restitution () const
float get_static_friction () const
float get_kinetic_friction () const
void get_friction (float *fs, float *fk) const
unsigned get_id () const
unsigned long get_category_groups_flags () const
unsigned long get_category_group_flag (unsigned i) const
unsigned long get_collision_groups_flags () const
unsigned long get_collision_group_flag (unsigned i) const
const ml7::Vector2get_last_linear_acceleration () const
float get_last_angular_acceleration () const
float get_tiredness () const
bool is_active () const
bool can_sleep () const
const CollisionSpaceget_collision_space () const
const ml7::Matrix2x3get_transform_matrix () const
const ml7::Matrix2x3get_transform_matrix_inverted () const
void * get_user_data () const
void set_position (const ml7::Vector2 &p)
void set_orientation (const float phi)
void set_velocity (const ml7::Vector2 &v)
void set_rotation (const float omega)
void set_linear_acceleration (const ml7::Vector2 &a)
void set_angular_acceleration (const float alpha)
void reset_force ()
void reset_torque ()
void add_force (const ml7::Vector2 &f)
void add_torque (const float tau)
void set_linear_damping (const float d)
void set_angular_damping (const float d)
void set_inverse_mass (const float im)
void set_inverse_inertia (const float imoi)
void set_mass (const float m)
void set_inertia (const float moi)
void set_density (const float rho)
void set_restitution (const float e)
void set_static_friction (const float fs)
void set_kinetic_friction (const float fk)
void set_friction (const float fs, const float fk)
void set_friction (const float f_)
void set_category_groups_flags (const unsigned long flags)
void set_category_group_flag (unsigned i)
void unset_category_group_flag (unsigned i)
void flip_category_group_flag (unsigned i)
void set_collision_groups_flags (const unsigned long flags)
void set_collision_group_flag (unsigned i)
void unset_collision_group_flag (unsigned i)
void flip_collision_group_flag (unsigned i)
void set_tiredness (const float tiredness)
void set_active (const bool b=true)
void can_sleep (const bool b)
CollisionSpaceget_collision_space ()
void set_user_data (void *user_data)
void add_force_to_point (const ml7::Vector2 &f, const ml7::Vector2 &point)
ml7::Vector2 get_point_in_world_space (const ml7::Vector2 &point_on_body)
ml7::Vector2 get_point_in_body_space (const ml7::Vector2 &point_in_world)

Public Attributes

ml7::Vector2 position
float orientation
ml7::Vector2 velocity
float rotation
ml7::Vector2 linear_acceleration
float angular_acceleration
ml7::Vector2 force
float torque
float linear_damping
float angular_damping
float inverse_mass
float inverse_inertia
float density
float restitution
float static_friction
float kinetic_friction
friend Dynamics

Constructor & Destructor Documentation

bl7::rigidbodies2::RigidBody::RigidBody ( void   )  [inline]

Default constructor.

bl7::rigidbodies2::RigidBody::~RigidBody ( void   )  [inline]

Destructor.

bl7::rigidbodies2::RigidBody::RigidBody ( const RigidBody rhs  )  [inline]

Copy constructor.


Member Function Documentation

void bl7::rigidbodies2::RigidBody::add_force ( const ml7::Vector2 f  )  [inline]

Adds a given force to this rigid body to be applied during next integration.

void bl7::rigidbodies2::RigidBody::add_force_to_point ( const ml7::Vector2 f,
const ml7::Vector2 point 
)

Adds a given force to the given point on the rigid body. The force is given in world coordinates, but the application point is given in body space.

void bl7::rigidbodies2::RigidBody::add_torque ( const float  tau  )  [inline]

Adds a given torque to this rigid body to be applied during next integration.

void bl7::rigidbodies2::RigidBody::can_sleep ( const bool  b  )  [inline]

Sets the flag specifying whether the rigid body can fall asleep.

bool bl7::rigidbodies2::RigidBody::can_sleep (  )  const [inline]

Returns the flag specifying whether this rigid body can fall asleep.

void bl7::rigidbodies2::RigidBody::flip_category_group_flag ( unsigned  i  )  [inline]

Flips the i-th bit (0 to 31) of the category groups flags.

void bl7::rigidbodies2::RigidBody::flip_collision_group_flag ( unsigned  i  )  [inline]

Flips the i-th bit (0 to 31) of the collision groups flags.

float bl7::rigidbodies2::RigidBody::get_angular_acceleration (  )  const [inline]

Returns the angular acceleration of this rigid body.

void bl7::rigidbodies2::RigidBody::get_angular_acceleration ( float *  alpha  )  const [inline]

Stores the angular acceleration of this paricle in the given float.

float bl7::rigidbodies2::RigidBody::get_angular_damping (  )  const [inline]

Returns the angular damping of this rigid body.

void bl7::rigidbodies2::RigidBody::get_angular_damping ( float *  d  )  const [inline]

Stores the angular damping of this paricle in the given float.

unsigned long bl7::rigidbodies2::RigidBody::get_category_group_flag ( unsigned  i  )  const [inline]

Returns the i-th bit (0 to 31) of the category groups flags.

unsigned long bl7::rigidbodies2::RigidBody::get_category_groups_flags (  )  const [inline]

Returns the category groups flags (default: all bits set).

unsigned long bl7::rigidbodies2::RigidBody::get_collision_group_flag ( unsigned  i  )  const [inline]

Returns the i-th bit (0 to 31) of the collision groups flags.

unsigned long bl7::rigidbodies2::RigidBody::get_collision_groups_flags (  )  const [inline]

Returns the collision groups flags (default: all bits set).

CollisionSpace& bl7::rigidbodies2::RigidBody::get_collision_space (  )  [inline]

Returns the collision space specifying the underlying geometry.

const CollisionSpace& bl7::rigidbodies2::RigidBody::get_collision_space (  )  const [inline]

Returns the collision space specifying the underlying geometry.

void bl7::rigidbodies2::RigidBody::get_density ( float *  rho  )  const [inline]

Stores the density (mass per unit volume) of this rigid body in the given float.

float bl7::rigidbodies2::RigidBody::get_density (  )  const [inline]

Returns the density (mass per unit volume) of this rigid body.

ml7::Vector2 bl7::rigidbodies2::RigidBody::get_force (  )  const [inline]

Returns the linear force of this rigid body.

void bl7::rigidbodies2::RigidBody::get_force ( ml7::Vector2 f  )  const [inline]

Stores the linear force of this paricle in the given vector.

void bl7::rigidbodies2::RigidBody::get_friction ( float *  fs,
float *  fk 
) const [inline]

Stores the lateral static and kinetic friction in the given floats.

unsigned bl7::rigidbodies2::RigidBody::get_id (  )  const [inline]

Returns the individual order ID of this rigid body.

float bl7::rigidbodies2::RigidBody::get_inertia (  )  const [inline]

Returns the moment of inertia of this rigid body.

void bl7::rigidbodies2::RigidBody::get_inertia ( float *  moi  )  const [inline]

Stores the moment of inertia of this paricle in the given float.

float bl7::rigidbodies2::RigidBody::get_inverse_inertia (  )  const [inline]

Returns the inverse moment of inertia of this rigid body.

void bl7::rigidbodies2::RigidBody::get_inverse_inertia ( float *  imoi  )  const [inline]

Stores the inverse moment of inertia of this paricle in the given float.

float bl7::rigidbodies2::RigidBody::get_inverse_mass (  )  const [inline]

Returns the inverse mass of this rigid body.

void bl7::rigidbodies2::RigidBody::get_inverse_mass ( float *  im  )  const [inline]

Stores the inverse mass of this paricle in the given float.

float bl7::rigidbodies2::RigidBody::get_kinetic_friction (  )  const [inline]

Returns the lateral kinetic friction (-1: use default value).

float bl7::rigidbodies2::RigidBody::get_last_angular_acceleration (  )  const [inline]

Returns the angular acceleration of the last frame.

const ml7::Vector2& bl7::rigidbodies2::RigidBody::get_last_linear_acceleration (  )  const [inline]

Returns the linear acceleration of the last frame.

void bl7::rigidbodies2::RigidBody::get_linear_acceleration ( ml7::Vector2 a  )  const [inline]

Stores the linear acceleration of this paricle in the given vector.

ml7::Vector2 bl7::rigidbodies2::RigidBody::get_linear_acceleration (  )  const [inline]

Returns the linear acceleration of this rigid body.

float bl7::rigidbodies2::RigidBody::get_linear_damping (  )  const [inline]

Returns the linear damping of this rigid body.

void bl7::rigidbodies2::RigidBody::get_linear_damping ( float *  d  )  const [inline]

Stores the linear damping of this paricle in the given float.

float bl7::rigidbodies2::RigidBody::get_mass (  )  const [inline]

Returns the mass of this rigid body.

void bl7::rigidbodies2::RigidBody::get_mass ( float *  m  )  const [inline]

Stores the mass of this paricle in the given float.

float bl7::rigidbodies2::RigidBody::get_orientation (  )  const [inline]

Returns the angular orientation of this rigid body.

void bl7::rigidbodies2::RigidBody::get_orientation ( float *  phi  )  const [inline]

Stores the angular orientation of this rigid body in the given float.

ml7::Vector2 bl7::rigidbodies2::RigidBody::get_point_in_body_space ( const ml7::Vector2 point_in_world  ) 

Transforms a given point in world space to body coordinates.

ml7::Vector2 bl7::rigidbodies2::RigidBody::get_point_in_world_space ( const ml7::Vector2 point_on_body  ) 

Transforms a given point in body space to world coordinates.

ml7::Vector2 bl7::rigidbodies2::RigidBody::get_position (  )  const [inline]

Returns the linear position of this rigid body.

void bl7::rigidbodies2::RigidBody::get_position ( ml7::Vector2 p  )  const [inline]

Stores the linear position of this rigid body in the given float.

float bl7::rigidbodies2::RigidBody::get_restitution (  )  const [inline]

Returns the coefficient of restitution.

void bl7::rigidbodies2::RigidBody::get_rotation ( float *  omega  )  const [inline]

Stores the angular velocity of this paricle in the given float.

float bl7::rigidbodies2::RigidBody::get_rotation (  )  const [inline]

Returns the angular velocity of this rigid body.

float bl7::rigidbodies2::RigidBody::get_static_friction (  )  const [inline]

Returns the lateral static friction (-1: use default value).

float bl7::rigidbodies2::RigidBody::get_tiredness (  )  const [inline]

Returns the tiredness of this rigid body.

float bl7::rigidbodies2::RigidBody::get_torque (  )  const [inline]

Returns the angular torque of this rigid body.

void bl7::rigidbodies2::RigidBody::get_torque ( float *  tau  )  const [inline]

Stores the angular torque of this paricle in the given float.

const ml7::Matrix2x3& bl7::rigidbodies2::RigidBody::get_transform_matrix (  )  const [inline]

Returns the transform matrix derived from position and orientation.

const ml7::Matrix2x3& bl7::rigidbodies2::RigidBody::get_transform_matrix_inverted (  )  const [inline]

Returns the inverted transform matrix derived from position and orientation.

void* bl7::rigidbodies2::RigidBody::get_user_data (  )  const [inline]

Returns the pointer to any user data structure (or NULL).

ml7::Vector2 bl7::rigidbodies2::RigidBody::get_velocity (  )  const [inline]

Returns the linear velocity of this rigid body.

void bl7::rigidbodies2::RigidBody::get_velocity ( ml7::Vector2 v  )  const [inline]

Stores the linear velocity of this paricle in the given vector.

bool bl7::rigidbodies2::RigidBody::has_finite_inertia (  )  const [inline]

Determines whether this rigid body has finite moment of inertia (inverse moment of inertia > 0).

bool bl7::rigidbodies2::RigidBody::has_finite_mass (  )  const [inline]

Determines whether this rigid body has finite mass (inverse mass > 0).

bool bl7::rigidbodies2::RigidBody::is_active (  )  const [inline]

Returns the flag specifying whether this rigid body is active or asleep.

RigidBody& bl7::rigidbodies2::RigidBody::operator= ( const RigidBody rhs  )  [inline]

Copy assignment operator.

void bl7::rigidbodies2::RigidBody::reset_force (  )  [inline]

Resets the accumulated force of this rigid body to zero.

void bl7::rigidbodies2::RigidBody::reset_torque (  )  [inline]

Resets the accumulated torque of this rigid body to zero.

void bl7::rigidbodies2::RigidBody::set_active ( const bool  b = true  )  [inline]

Sets the flag specifying whether the rigid body is active or asleep.

void bl7::rigidbodies2::RigidBody::set_angular_acceleration ( const float  alpha  )  [inline]

Sets the angular acceleration of this rigid body.

void bl7::rigidbodies2::RigidBody::set_angular_damping ( const float  d  )  [inline]

Sets the angular damping of this rigid body.

void bl7::rigidbodies2::RigidBody::set_category_group_flag ( unsigned  i  )  [inline]

Sets the i-th bit (0 to 31) of the category groups flags.

void bl7::rigidbodies2::RigidBody::set_category_groups_flags ( const unsigned long  flags  )  [inline]

Sets the category groups flags (default: all bits set).

void bl7::rigidbodies2::RigidBody::set_collision_group_flag ( unsigned  i  )  [inline]

Sets the i-th bit (0 to 31) of the collision groups flags.

void bl7::rigidbodies2::RigidBody::set_collision_groups_flags ( const unsigned long  flags  )  [inline]

Sets the collision groups flags (default: all bits set).

void bl7::rigidbodies2::RigidBody::set_density ( const float  rho  )  [inline]

Sets the density (mass per unit volume) of this rigid body.

void bl7::rigidbodies2::RigidBody::set_friction ( const float  fs,
const float  fk 
) [inline]

Sets the lateral static and kinetic friction.

void bl7::rigidbodies2::RigidBody::set_friction ( const float  f_  )  [inline]

Sets the lateral static and kinetic friction.

void bl7::rigidbodies2::RigidBody::set_inertia ( const float  moi  )  [inline]

Sets the moment of inertia of this rigid body.

void bl7::rigidbodies2::RigidBody::set_inverse_inertia ( const float  imoi  )  [inline]

Sets the inverse moment of inertia of this rigid body.

void bl7::rigidbodies2::RigidBody::set_inverse_mass ( const float  im  )  [inline]

Sets the inverse mass of this rigid body.

void bl7::rigidbodies2::RigidBody::set_kinetic_friction ( const float  fk  )  [inline]

Sets the lateral kinetic friction.

void bl7::rigidbodies2::RigidBody::set_linear_acceleration ( const ml7::Vector2 a  )  [inline]

Sets the linear acceleration of this rigid body.

void bl7::rigidbodies2::RigidBody::set_linear_damping ( const float  d  )  [inline]

Sets the linear damping of this rigid body.

void bl7::rigidbodies2::RigidBody::set_mass ( const float  m  )  [inline]

Sets the mass of this rigid body.

void bl7::rigidbodies2::RigidBody::set_orientation ( const float  phi  )  [inline]

Sets the angular orientation of this rigid body.

void bl7::rigidbodies2::RigidBody::set_position ( const ml7::Vector2 p  )  [inline]

Sets the linear position of this rigid body.

void bl7::rigidbodies2::RigidBody::set_restitution ( const float  e  )  [inline]

Sets the coefficient of restitution.

void bl7::rigidbodies2::RigidBody::set_rotation ( const float  omega  )  [inline]

Sets the angular velocity of this rigid body.

void bl7::rigidbodies2::RigidBody::set_static_friction ( const float  fs  )  [inline]

Sets the lateral static friction.

void bl7::rigidbodies2::RigidBody::set_tiredness ( const float  tiredness  )  [inline]

Sets the tiredness of this rigid body.

void bl7::rigidbodies2::RigidBody::set_user_data ( void *  user_data  )  [inline]

Sets the pointer to any user data structure (or NULL).

void bl7::rigidbodies2::RigidBody::set_velocity ( const ml7::Vector2 v  )  [inline]

Sets the linear velocity of this rigid body.

void bl7::rigidbodies2::RigidBody::unset_category_group_flag ( unsigned  i  )  [inline]

Unsets the i-th bit (0 to 31) of the category groups flags.

void bl7::rigidbodies2::RigidBody::unset_collision_group_flag ( unsigned  i  )  [inline]

Unsets the i-th bit (0 to 31) of the collision groups flags.


Member Data Documentation

The angular acceleration of this rigid body.

The amount of damping applied to angular motion of this rigid body. It is required to remove energy added through numerical instability during integration.

The density (mass per unit volume) of this rigid body.

The linear force (accumulated) to be applied at the next integration only.

The inverse of the moment of inertia of this rigid body. It is more useful than holding the actual moment of inertia because zero makes no sense (completely unstable in numerical simulation) and infinite (unrotatable) now is easily represented by 0. Moreover most of the computations use the inverse moment of intertia and not the actual moment of inertia so the needless division slips.

The inverse of the mass of this rigid body. It is more useful than holding the actual mass because zero mass makes no sense (completely unstable in numerical simulation) and infinite mass (immovable) now is easily represented by 0. Moreover most of the computations use the inverse mass and not the actual mass so the needless division slips.

The lateral kinetic friction (-1: use default value).

The linear acceleration of this rigid body. Can be set due to gravity (or the like).

The amount of damping applied to linear motion of this rigid body. It is required to remove energy added through numerical instability during integration.

The angular orientation of this rigid body in world space.

The linear position of this rigid body in world space.

The coefficient of restitution (-1: use default value).

The angular velocity of this rigid body in world space.

The lateral static friction (-1: use default value).

The angular torque (accumulated) to be applied at the next integration only.

The linear velocity of this rigid body in world space.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines