SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
deMassProp Class Reference

Compute Mass parameters. More...

#include <TaoDeMassProp.h>

Collaboration diagram for deMassProp:
Collaboration graph
[legend]

Public Member Functions

 deMassProp ()
 constructor More...
 
 deMassProp (deMassProp const &orig)
 
void zero ()
 set members to zero More...
 
void set (const deFloat *mass, const deVector3 *center, const deMatrix3 *inertia)
 set members with given values More...
 
void get (deFloat *mass, deVector3 *center, deMatrix3 *inertia) const
 get member values More...
 
deInt isDensity (deFloat m)
 indicates if m is a density. More...
 
fetching methods

return current mass parameters.

deFloat * mass ()
 
deFloat const * mass () const
 
deMatrix3inertia ()
 
deMatrix3 const * inertia () const
 
deVector3center ()
 
deVector3 const * center () const
 
updating methods

set general mass/inertia parameters for a body defined in the current reference frame.

Remarks
Calls are accumulative.
void mass (const deFloat m, const deFrame *f=NULL)
 
void inertia (const deMatrix3 *inertia, const deFrame *f=NULL)
 
void inertia (const deVector3 *diag, const deFrame *f=NULL)
 
void inertia (const deFloat Ixx, const deFloat Iyy, const deFloat Izz, const deFrame *f=NULL)
 
mass/inertia definitions of homogeneous bodies

specify mass parameters for various homogeneous bodies. With the center of mass located at the current reference frame.

Remarks
Calls are accumulative.
Parameters
fnew frame of reference. NULL indicates the identity matrix..
void cylinder (const deFloat mp, const deFloat h, const deFloat r, const deFrame *f=NULL)
 
void cone (const deFloat mp, const deFloat h, const deFloat r, const deFrame *f=NULL)
 
void pyramid (const deFloat mp, const deFloat a, const deFloat b, const deFloat h, const deFrame *f=NULL)
 
void block (const deFloat mp, const deFloat a, const deFloat b, const deFloat c, const deFrame *f=NULL)
 
void sphere (const deFloat mp, const deFloat r, const deFrame *f=NULL)
 
void hemisphere (const deFloat mp, const deFloat r, const deFrame *f=NULL)
 
void ellipsoid (const deFloat mp, const deFloat a, const deFloat b, const deFloat c, const deFrame *f=NULL)
 
void rod (const deFloat mp, const deFloat l, const deFrame *f=NULL)
 
void disk (const deFloat mp, const deFloat r, const deFrame *f=NULL)
 
void plate (const deFloat mp, const deFloat a, const deFloat b, const deFrame *f=NULL)
 
void cylinderShell (const deFloat mp, const deFloat h, const deFloat r, const deFrame *f=NULL)
 
void coneShell (const deFloat mp, const deFloat h, const deFloat r, const deFrame *f=NULL)
 
void sphereShell (const deFloat mp, const deFloat r, const deFrame *f=NULL)
 
void hemisphereShell (const deFloat mp, const deFloat r, const deFrame *f=NULL)
 
resetting methods

reset mass properties

void scale (const deFloat m)
 

Private Attributes

deFloat _m
 
deVector3 _center
 
deMatrix3 _inertia
 

Detailed Description

Compute Mass parameters.

Constructor & Destructor Documentation

deMassProp::deMassProp ( )
inline

constructor

Member Function Documentation

void deMassProp::block ( const deFloat  mp,
const deFloat  a,
const deFloat  b,
const deFloat  c,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous block with center of mass at the current frame.

Parameters
mpmass (density if dedensity(deFloat)) of block.
awidth of base of block along the x-axis.
blength of base of block along the y-axis.
cheight of base of block along the z-axis.
fnew frame of reference. NULL (default) indicates the identity matrix.
deVector3* deMassProp::center ( )
inline
Returns
center of mass of object as seen from objects local frame.
void deMassProp::cone ( const deFloat  mp,
const deFloat  h,
const deFloat  r,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous cone with center of mass at the current frame. The center of mass of a cone is located h/4 from base in z

Parameters
mpmass (density if dedensity(deFloat)) of cone.
htotal height of cone in z-axis.
rradius of the base of the cone.
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::coneShell ( const deFloat  mp,
const deFloat  h,
const deFloat  r,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous infinitely thin cone with no base. The center of mass located at the current frame is (1/3)*h from base in z.

Parameters
mpmass (surface density if dedensity(deFloat)).
htotal height of cone shell h in z-axis.
rradius of the base of the cone shell.
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::cylinder ( const deFloat  mp,
const deFloat  h,
const deFloat  r,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous cylinder with center of mass at the current frame.

Parameters
mpmass (density if dedensity(deFloat)) of cylinder.
htotal height of cylinder in z-axis.
rradius of the cylinder.
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::cylinderShell ( const deFloat  mp,
const deFloat  h,
const deFloat  r,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous infinitely thin cylinder with no caps, with center of mass at the current frame.

Parameters
mpmass (surface density if dedensity(deFloat)).
htotal height of cylinder shell in z-axis.
rradius of the cylinder shell.
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::disk ( const deFloat  mp,
const deFloat  r,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous two dimensional flat disk with center of mass at the current frame. The disk has zero height in the z-axis.

Parameters
mpmass (surface density if dedensity(deFloat)).
rradius of disk.
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::ellipsoid ( const deFloat  mp,
const deFloat  a,
const deFloat  b,
const deFloat  c,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous ellipsoid with center of mass at the current frame.

Parameters
mpmass (density if dedensity(deFloat)) of ellipsoid.
alength of major axis along the x-axis, one half total width
blength of major axis along the y-axis, one half total length
clength of major axis along the z-axis, one half total height
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::get ( deFloat *  mass,
deVector3 center,
deMatrix3 inertia 
) const
inline

get member values

void deMassProp::hemisphere ( const deFloat  mp,
const deFloat  r,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous half sphere (hemisphere) with center of mass at the current frame. The center of mass of a hemisphere is located (3/8)*r from base in z

Parameters
mpmass (density if dedensity(deFloat)) of hemisphere.
rradius of hemisphere.
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::hemisphereShell ( const deFloat  mp,
const deFloat  r,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous infinitely thin half sphere (hemisphere) with no base. The center of mass located at the current frame is r/2 from the base of the hemisphere in the z-axis.

Parameters
mpmass (surface density if dedensity(deFloat)).
rradius of the hemisphere.
fnew frame of reference. NULL (default) indicates the identity matrix.
deMatrix3* deMassProp::inertia ( )
inline
Returns
inertia of object as seen from objects local frame.
void deMassProp::inertia ( const deMatrix3 inertia,
const deFrame f = NULL 
)

add an inertia tensor inertia specified by a 3x3 matrix at the current frame of reference.

void deMassProp::inertia ( const deVector3 diag,
const deFrame f = NULL 
)

add an inertia tensor specified by its diagonal diag = (Ixx, Iyy, Izz).

void deMassProp::inertia ( const deFloat  Ixx,
const deFloat  Iyy,
const deFloat  Izz,
const deFrame f = NULL 
)

add an inertia tensor specified by its diagonal (Ixx, Iyy, Izz).

deInt deMassProp::isDensity ( deFloat  m)
inline

indicates if m is a density.

Remarks
negative m indicates m is a density.
Return values
0if m represents a mass
1if m represents a density
deFloat* deMassProp::mass ( )
inline
Returns
mass of object.
void deMassProp::mass ( const deFloat  m,
const deFrame f = NULL 
)

add a point mass of mass m at a point at the origin of the reference frame. Set frame of reference to be used when specifying a objects mass/inertial properties.

Parameters
mmass to be added
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::plate ( const deFloat  mp,
const deFloat  a,
const deFloat  b,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous two dimensional flat square plate with center of mass at the current frame. The plate has zero height in the z-axis.

Parameters
mpmass (surface density if dedensity(deFloat)).
atotal width of the in the x-axis .
btotal width of the in the y-axis .
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::pyramid ( const deFloat  mp,
const deFloat  a,
const deFloat  b,
const deFloat  h,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous four sided pyramid with center of mass at the current frame. The center of mass of a pyramid is located h/4 from base in z

Parameters
mpmass (density if dedensity(deFloat)) of pyramid.
awidth of base of pyramid along the x-axis.
blength of base of pyramid along the y-axis.
htotal height of pyramid h in z-axis.
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::rod ( const deFloat  mp,
const deFloat  l,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous one dimensional rod having total length l with center of mass at the current frame. The center of mass of a rod is located half way along its length.

Parameters
mpmass (linear density if dedensity(deFloat)).
ltotal length of the rod along the z-axis.
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::scale ( const deFloat  m)

homogenously scale the mass properities of a given object until total mass equals m.

void deMassProp::set ( const deFloat *  mass,
const deVector3 center,
const deMatrix3 inertia 
)
inline

set members with given values

void deMassProp::sphere ( const deFloat  mp,
const deFloat  r,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous sphere with center of mass at the current frame.

Parameters
mpmass (density if dedensity(deFloat)) of sphere.
rradius of sphere.
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::sphereShell ( const deFloat  mp,
const deFloat  r,
const deFrame f = NULL 
)

Specify the mass parameters to a homogeneous infinitely thin sphere, with center of mass at the current frame.

Parameters
mpmass (surface density if dedensity(deFloat)).
rradius of the sphere.
fnew frame of reference. NULL (default) indicates the identity matrix.
void deMassProp::zero ( )
inline

set members to zero


The documentation for this class was generated from the following files: