SCL
1.0
Standard Control Library : Control, dynamics, physics, and simulation
|
Compute Mass parameters. More...
#include <TaoDeMassProp.h>
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 | ||
deMatrix3 * | inertia () | ||
deMatrix3 const * | inertia () const | ||
deVector3 * | center () | ||
deVector3 const * | center () const | ||
updating methods | |||
set general mass/inertia parameters for a body defined in the current reference frame.
| |||
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.
| |||
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 |
Compute Mass parameters.
|
inline |
constructor
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.
mp | mass (density if dedensity(deFloat)) of block. |
a | width of base of block along the x-axis. |
b | length of base of block along the y-axis. |
c | height of base of block along the z-axis. |
f | new frame of reference. NULL (default) indicates the identity matrix. |
|
inline |
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
mp | mass (density if dedensity(deFloat)) of cone. |
h | total height of cone in z-axis. |
r | radius of the base of the cone. |
f | new 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.
mp | mass (surface density if dedensity(deFloat)). |
h | total height of cone shell h in z-axis. |
r | radius of the base of the cone shell. |
f | new 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.
mp | mass (density if dedensity(deFloat)) of cylinder. |
h | total height of cylinder in z-axis. |
r | radius of the cylinder. |
f | new 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.
mp | mass (surface density if dedensity(deFloat)). |
h | total height of cylinder shell in z-axis. |
r | radius of the cylinder shell. |
f | new 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.
mp | mass (surface density if dedensity(deFloat)). |
r | radius of disk. |
f | new 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.
mp | mass (density if dedensity(deFloat)) of ellipsoid. |
a | length of major axis along the x-axis, one half total width |
b | length of major axis along the y-axis, one half total length |
c | length of major axis along the z-axis, one half total height |
f | new frame of reference. NULL (default) indicates the identity matrix. |
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
mp | mass (density if dedensity(deFloat)) of hemisphere. |
r | radius of hemisphere. |
f | new 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.
mp | mass (surface density if dedensity(deFloat)). |
r | radius of the hemisphere. |
f | new frame of reference. NULL (default) indicates the identity matrix. |
|
inline |
add an inertia tensor inertia specified by a 3x3 matrix at the current frame of reference.
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).
|
inline |
indicates if m is a density.
0 | if m represents a mass |
1 | if m represents a density |
|
inline |
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.
m | mass to be added |
f | new 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.
mp | mass (surface density if dedensity(deFloat)). |
a | total width of the in the x-axis . |
b | total width of the in the y-axis . |
f | new 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
mp | mass (density if dedensity(deFloat)) of pyramid. |
a | width of base of pyramid along the x-axis. |
b | length of base of pyramid along the y-axis. |
h | total height of pyramid h in z-axis. |
f | new 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.
mp | mass (linear density if dedensity(deFloat)). |
l | total length of the rod along the z-axis. |
f | new 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.
|
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.
mp | mass (density if dedensity(deFloat)) of sphere. |
r | radius of sphere. |
f | new 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.
mp | mass (surface density if dedensity(deFloat)). |
r | radius of the sphere. |
f | new frame of reference. NULL (default) indicates the identity matrix. |
|
inline |
set members to zero