Physics Namespace Reference

Physics computations and wraping functionalities. More...


Namespaces

namespace  Materials
 Contains constants defining physical materials.

Classes

class  AbstractGeom
 Abstract geom is a base class for two geom types : standard geoms (Geom) and spaces (Space). More...
class  Mass
 Wrapper for mass parameters. More...
class  Body
 Wrapper representnig physical bodies (roughly a mass with coordinates and velocity). More...
class  Contact
 Represents data of a contact between two geoms (special joint data). More...
class  Geom
 Enhanced wrapper for physical geometries. More...
class  GHChangeCallback
 Callback for GeometryHandler, used on property change. More...
class  GeometryHandler
 Abstract class for creation and manipulation of physical geometries (Spheres, boxes, etc. More...
class  UserGeomsInitializer
 Inizializes all user classes (Singleton). More...
class  SphereHandler
 GeometryHandler for spheres. More...
class  BoxHandler
 GeometryHandler for boxes. More...
class  PlaneHandler
 GeometryHandler for infinite planes. More...
class  CylinderHandler
 GeometryHandler for flat-ended cylinders aligned along Z-axis. More...
class  CapsuleHandler
 GeometryHandler for capsules (Capped cylinders) aligned along Z-axis. More...
class  RayHandler
 GeometryHandler for finite rays (Defines a ray aligned with the Z axis (up), starting at (0,0,0)). More...
class  HeightFieldHandler
 GeometryHandler for height fields. More...
class  MeshHandler
 GeometryHandler for meshes - Somewhat tested, quite stable, but still experimental. More...
class  JointFeedback
 Wrapper for force applied on joints. More...
class  Joint
 Wrapper for joints between bodies. More...
class  JointGroup
 Manages a set of joints. More...
class  SpaceTypeInfo
 Describes the type of a space (Simple, hash-map based, or quad-tree based), with specific parameters. More...
class  Space
 Space is a group of owned geoms, and a level of collision. More...
class  SurfaceParams
 Surface parameters can define a surface or the way two surfaces interact when in contact. More...
class  Visitor
 Visitor for physics that traverses hierarchies. More...
class  VisitorSmart
 Version of Visitor that includes methods to ensures that traversed bodies & joints will be visited only once. More...
class  NearCallback
 Callback for collisions, used by World, wrapping ODE functionalities. More...
class  World
 Wrapper representnig the physical world. More...

Typedefs

typedef std::map< const Body
*, Body * > 
TDuplicatedBodiesMap
typedef std::pair< const Body
*, Body * > 
TDuplicatedBody

Functions

void dBodySetFiniteRotationAxis (dBodyID id, const osg::Vec3f &axis)
osg::Vec3 dBodyGetFiniteRotationAxisV (dBodyID id)
void dBodySetPosition (dBodyID id, const osg::Vec3 &pos)
osg::Vec3 dBodyGetPositionV (dBodyID id)
void dBodySetQuaternion (dBodyID id, const osg::Quat &quat)
osg::Quat dBodyGetQuaternionV (dBodyID id)
void dBodySetRotation (dBodyID id, const osg::Matrix &matrix)
osg::Matrix dBodyGetRotationV (dBodyID id, const osg::Matrix &matrix)
void dBodySetLinearVel (dBodyID id, const osg::Vec3 &vel)
osg::Vec3 dBodyGetLinearVelV (dBodyID id)
void dBodySetAngularVel (dBodyID id, const osg::Vec3 &angularVel)
osg::Vec3 dBodyGetAngularVelV (dBodyID id)
void dBodySetForce (dBodyID id, const osg::Vec3 &f)
void dBodySetTorque (dBodyID id, const osg::Vec3 &f)
osg::Vec3 dBodyGetForceV (dBodyID id)
osg::Vec3 dBodyGetTorqueV (dBodyID id)
void dBodyAddForce (dBodyID id, const osg::Vec3 &f)
void dBodyAddTorque (dBodyID id, const osg::Vec3 &f)
void dBodyAddRelForce (dBodyID id, const osg::Vec3 &f)
void dBodyAddRelTorque (dBodyID id, const osg::Vec3 &f)
void dBodyAddForceAtPos (dBodyID id, const osg::Vec3 &f, const osg::Vec3 &pos)
void dBodyAddForceAtRelPos (dBodyID id, const osg::Vec3 &f, const osg::Vec3 &pos)
void dBodyAddRelForceAtPos (dBodyID id, const osg::Vec3 &f, const osg::Vec3 &pos)
void dBodyAddRelForceAtRelPos (dBodyID id, const osg::Vec3 &f, const osg::Vec3 &pos)
osg::Vec3 dBodyGetRelPointPosV (dBodyID id, const osg::Vec3 &p)
osg::Vec3 dBodyGetPosRelPointV (dBodyID id, const osg::Vec3 &p)
osg::Vec3 dBodyVectorToWorldV (dBodyID id, const osg::Vec3 &p)
osg::Vec3 dBodyVectorFromWorldV (dBodyID id, const osg::Vec3 &p)
osg::Vec3 dBodyGetRelPointVelV (dBodyID id, const osg::Vec3 &p)
osg::Vec3 dBodyGetPointVelV (dBodyID id, const osg::Vec3 &p)
template<typename _Pred >
void combinedTraversal (AbstractGeom &a, AbstractGeom &b, _Pred &pred)
 Traverse all children of two AbstractGeom's simultaneously (Abstract geoms must have the same structure - ie.
template<typename _Pred >
void combinedTraversal (const AbstractGeom &a, const AbstractGeom &b, _Pred &pred)
graphVec3 toGraphVec3 (const dReal *v)
graphVec4 toGraphVec4 (const dVector4 &v)
void toPhyVec3 (const graphVec3 &v, dVector3 out_ret)
void toPhyVec3 (const dReal &x, const dReal &y, const dReal &z, dVector3 out_ret)
void toPhyVec4 (const graphVec4 &v, dVector4 out_ret)
void toPhyVec4 (const dReal &x, const dReal &y, const dReal &z, const dReal &w, dVector3 out_ret)
graphQuat toGraphQuat (const dReal *v)
void toPhyQuat (const graphQuat &quat, dQuaternion &out_q)
PVLE_EXPORT graphMat toGraphMatInertia (const dReal *m)
PVLE_EXPORT graphMat toGraphMatRotation (const dReal *m)
PVLE_EXPORT graphMat toGraphMatRotationPosition (const dReal *m, const dReal *p)
PVLE_EXPORT void toPhyMatRotation (const graphMat &matrix, dMatrix3 &out_matrix)
graphBB toGraphBB (dReal *bb)
void toPhyBB (const graphBB &bb, dReal *out_bb)
dReal kmhToms (dReal v)
 Converts km/h to m/s.
dReal msTokmh (dReal v)
 Converts m/s to km/h.
PVLE_EXPORT GeomcreateCanonicalBox (World *pPhyWorld, const osg::Vec3 &size=osg::Vec3(1, 1, 1), const float mass=1, const SurfaceParams &surfaceParam=Materials::DEFAULT)
 Creates a "standard" box geom with a body.
PVLE_EXPORT GeomcreateCanonicalSphere (World *pPhyWorld, const float radius=1, const float mass=1, const SurfaceParams &surfaceParam=Materials::DEFAULT)
 Creates a "standard" sphere geom with a body.
PVLE_EXPORT GeomcreateCanonicalCapsule (World *pPhyWorld, const float radius=1, const float length=1, const float mass=1, const SurfaceParams &surfaceParam=Materials::DEFAULT)
 Creates a "standard" capsule geom with a body.
PVLE_EXPORT GeomcreateCanonicalCylinder (World *pPhyWorld, const float radius=1, const float length=1, const float mass=1, const SurfaceParams &surfaceParam=Materials::DEFAULT)
 Creates a "standard" cylinder geom with a body.
PVLE_EXPORT GeomcreateCanonicalBoxGeom (const osg::Vec3 &size=osg::Vec3(1, 1, 1), const SurfaceParams &surfaceParam=Materials::DEFAULT)
 Creates a "standard" box geom.
PVLE_EXPORT GeomcreateCanonicalSphereGeom (const float radius=1, const SurfaceParams &surfaceParam=Materials::DEFAULT)
 Creates a "standard" sphere geom.
PVLE_EXPORT GeomcreateCanonicalCapsuleGeom (const float radius=1, const float length=1, const SurfaceParams &surfaceParam=Materials::DEFAULT)
 Creates a "standard" capsule geom.
PVLE_EXPORT GeomcreateCanonicalCylinderGeom (const float radius=1, const float length=1, const SurfaceParams &surfaceParam=Materials::DEFAULT)
 Creates a "standard" cylinder geom.
void dWorldSetGravity (dWorldID id, const osg::Vec3 &force)
osg::Vec3 dWorldGetGravityV (dWorldID id)

Variables

static const dReal PHY_INFINITY = dInfinity


Detailed Description

Physics computations and wraping functionalities.


Typedef Documentation

typedef std::map<const Body *, Body *> Physics::TDuplicatedBodiesMap

Definition at line 60 of file AbstractGeom.h.

typedef std::pair<const Body *, Body *> Physics::TDuplicatedBody

Definition at line 63 of file AbstractGeom.h.


Function Documentation

template<typename _Pred >
void Physics::combinedTraversal ( const AbstractGeom &  a,
const AbstractGeom &  b,
_Pred &  pred 
) [inline]

template<typename _Pred >
void Physics::combinedTraversal ( AbstractGeom &  a,
AbstractGeom &  b,
_Pred &  pred 
) [inline]

Traverse all children of two AbstractGeom's simultaneously (Abstract geoms must have the same structure - ie.

number of children recursively), and calls a predicate for all Geom's encountered. Predicate must have two "Geom *" as arguments, and must return a bool (indicating if the loop must continue).

Definition at line 38 of file CombinedTraversal.h.

References Physics::AbstractGeom::asGeom(), ASSERT, Physics::AbstractGeom::asSpace(), Physics::Space::getGeomsBegin(), Physics::Space::getGeomsEnd(), and Physics::AbstractGeom::isSpace().

Referenced by C3DPhy::attachBodies(), combinedTraversal(), and C3DPhy::findGeomCopy().

Geom * Physics::createCanonicalBox ( World *  pPhyWorld,
const osg::Vec3 &  size = osg::Vec3(1,1,1),
const float  mass = 1,
const SurfaceParams &  surfaceParam = Materials::DEFAULT 
)

Creates a "standard" box geom with a body.

Definition at line 40 of file Physics/Utility.cpp.

References Physics::Body::getMassData(), Physics::Geom::setBody(), and Physics::Mass::setBoxTotal().

Referenced by createBox3DPhy().

Geom * Physics::createCanonicalBoxGeom ( const osg::Vec3 &  size = osg::Vec3(1,1,1),
const SurfaceParams &  surfaceParam = Materials::DEFAULT 
)

Creates a "standard" box geom.

Definition at line 36 of file Physics/Utility.cpp.

Referenced by createFixedBox3DPhy().

Geom * Physics::createCanonicalCapsule ( World *  pPhyWorld,
const float  radius = 1,
const float  length = 1,
const float  mass = 1,
const SurfaceParams &  surfaceParam = Materials::DEFAULT 
)

Creates a "standard" capsule geom with a body.

Definition at line 66 of file Physics/Utility.cpp.

References Physics::Body::getMassData(), Physics::Geom::setBody(), Physics::Mass::setCapsuleTotal(), and Physics::Mass::Z_AXIS.

Referenced by createCapsule3DPhy().

Geom * Physics::createCanonicalCapsuleGeom ( const float  radius = 1,
const float  length = 1,
const SurfaceParams &  surfaceParam = Materials::DEFAULT 
)

Creates a "standard" capsule geom.

Definition at line 62 of file Physics/Utility.cpp.

Referenced by createFixedCapsule3DPhy().

Geom * Physics::createCanonicalCylinder ( World *  pPhyWorld,
const float  radius = 1,
const float  length = 1,
const float  mass = 1,
const SurfaceParams &  surfaceParam = Materials::DEFAULT 
)

Creates a "standard" cylinder geom with a body.

Definition at line 79 of file Physics/Utility.cpp.

References Physics::Body::getMassData(), Physics::Geom::setBody(), Physics::Mass::setCylinderTotal(), and Physics::Mass::Z_AXIS.

Referenced by createCylinder3DPhy().

Geom * Physics::createCanonicalCylinderGeom ( const float  radius = 1,
const float  length = 1,
const SurfaceParams &  surfaceParam = Materials::DEFAULT 
)

Creates a "standard" cylinder geom.

Definition at line 75 of file Physics/Utility.cpp.

Referenced by createFixedCylinder3DPhy().

Geom * Physics::createCanonicalSphere ( World *  pPhyWorld,
const float  radius = 1,
const float  mass = 1,
const SurfaceParams &  surfaceParam = Materials::DEFAULT 
)

Creates a "standard" sphere geom with a body.

Definition at line 53 of file Physics/Utility.cpp.

References Physics::Body::getMassData(), Physics::Geom::setBody(), and Physics::Mass::setSphereTotal().

Referenced by createSphere3DPhy().

Geom * Physics::createCanonicalSphereGeom ( const float  radius = 1,
const SurfaceParams &  surfaceParam = Materials::DEFAULT 
)

Creates a "standard" sphere geom.

Definition at line 49 of file Physics/Utility.cpp.

Referenced by createFixedSphere3DPhy(), and Explosion::init().

void Physics::dBodyAddForce ( dBodyID  id,
const osg::Vec3 &  f 
) [inline]

Definition at line 153 of file Body.h.

void Physics::dBodyAddForceAtPos ( dBodyID  id,
const osg::Vec3 &  f,
const osg::Vec3 &  pos 
) [inline]

Definition at line 157 of file Body.h.

Referenced by Explosion::hitBefore().

void Physics::dBodyAddForceAtRelPos ( dBodyID  id,
const osg::Vec3 &  f,
const osg::Vec3 &  pos 
) [inline]

Definition at line 158 of file Body.h.

void Physics::dBodyAddRelForce ( dBodyID  id,
const osg::Vec3 &  f 
) [inline]

Definition at line 155 of file Body.h.

void Physics::dBodyAddRelForceAtPos ( dBodyID  id,
const osg::Vec3 &  f,
const osg::Vec3 &  pos 
) [inline]

Definition at line 159 of file Body.h.

void Physics::dBodyAddRelForceAtRelPos ( dBodyID  id,
const osg::Vec3 &  f,
const osg::Vec3 &  pos 
) [inline]

Definition at line 160 of file Body.h.

void Physics::dBodyAddRelTorque ( dBodyID  id,
const osg::Vec3 &  f 
) [inline]

Definition at line 156 of file Body.h.

void Physics::dBodyAddTorque ( dBodyID  id,
const osg::Vec3 &  f 
) [inline]

Definition at line 154 of file Body.h.

osg::Vec3 Physics::dBodyGetAngularVelV ( dBodyID  id  )  [inline]

Definition at line 147 of file Body.h.

References toGraphVec3().

osg::Vec3 Physics::dBodyGetFiniteRotationAxisV ( dBodyID  id  )  [inline]

Definition at line 136 of file Body.h.

References toGraphVec3().

osg::Vec3 Physics::dBodyGetForceV ( dBodyID  id  )  [inline]

Definition at line 151 of file Body.h.

References toGraphVec3().

osg::Vec3 Physics::dBodyGetLinearVelV ( dBodyID  id  )  [inline]

Definition at line 145 of file Body.h.

References toGraphVec3().

Referenced by Ammo::hitBefore(), and Ammo::step().

osg::Vec3 Physics::dBodyGetPointVelV ( dBodyID  id,
const osg::Vec3 &  p 
) [inline]

Definition at line 167 of file Body.h.

References toGraphVec3().

Referenced by Physics::NearCallback::operator()().

osg::Vec3 Physics::dBodyGetPositionV ( dBodyID  id  )  [inline]

Definition at line 138 of file Body.h.

References toGraphVec3().

Referenced by C3DPhy::getPos(), and C3DPhy::getReferenceFrame().

osg::Vec3 Physics::dBodyGetPosRelPointV ( dBodyID  id,
const osg::Vec3 &  p 
) [inline]

Definition at line 163 of file Body.h.

References toGraphVec3().

osg::Quat Physics::dBodyGetQuaternionV ( dBodyID  id  )  [inline]

Definition at line 140 of file Body.h.

References toGraphQuat().

Referenced by C3DPhy::getQuaternion(), C3DPhy::getReferenceFrame(), and Physics::Body::rotate().

osg::Vec3 Physics::dBodyGetRelPointPosV ( dBodyID  id,
const osg::Vec3 &  p 
) [inline]

Definition at line 162 of file Body.h.

References toGraphVec3().

osg::Vec3 Physics::dBodyGetRelPointVelV ( dBodyID  id,
const osg::Vec3 &  p 
) [inline]

Definition at line 166 of file Body.h.

References toGraphVec3().

osg::Matrix Physics::dBodyGetRotationV ( dBodyID  id,
const osg::Matrix &  matrix 
) [inline]

Definition at line 142 of file Body.h.

References toGraphMatRotation().

osg::Vec3 Physics::dBodyGetTorqueV ( dBodyID  id  )  [inline]

Definition at line 152 of file Body.h.

References toGraphVec3().

void Physics::dBodySetAngularVel ( dBodyID  id,
const osg::Vec3 &  angularVel 
) [inline]

Definition at line 146 of file Body.h.

Referenced by Physics::Body::Body().

void Physics::dBodySetFiniteRotationAxis ( dBodyID  id,
const osg::Vec3f &  axis 
) [inline]

Definition at line 135 of file Body.h.

Referenced by Physics::Body::Body().

void Physics::dBodySetForce ( dBodyID  id,
const osg::Vec3 &  f 
) [inline]

Definition at line 149 of file Body.h.

Referenced by Physics::Body::Body().

void Physics::dBodySetLinearVel ( dBodyID  id,
const osg::Vec3 &  vel 
) [inline]

Definition at line 144 of file Body.h.

Referenced by Physics::Body::Body(), and Ammo::hitBefore().

void Physics::dBodySetPosition ( dBodyID  id,
const osg::Vec3 &  pos 
) [inline]

Definition at line 137 of file Body.h.

Referenced by Physics::Body::Body(), Physics::Body::setMatrix(), and Physics::Body::translate().

void Physics::dBodySetQuaternion ( dBodyID  id,
const osg::Quat &  quat 
) [inline]

Definition at line 139 of file Body.h.

References toPhyQuat().

Referenced by Physics::Body::Body(), and Physics::Body::rotate().

void Physics::dBodySetRotation ( dBodyID  id,
const osg::Matrix &  matrix 
) [inline]

Definition at line 141 of file Body.h.

References toPhyMatRotation().

Referenced by Physics::Body::setMatrix().

void Physics::dBodySetTorque ( dBodyID  id,
const osg::Vec3 &  f 
) [inline]

Definition at line 150 of file Body.h.

Referenced by Physics::Body::Body().

osg::Vec3 Physics::dBodyVectorFromWorldV ( dBodyID  id,
const osg::Vec3 &  p 
) [inline]

Definition at line 165 of file Body.h.

References toGraphVec3().

osg::Vec3 Physics::dBodyVectorToWorldV ( dBodyID  id,
const osg::Vec3 &  p 
) [inline]

Definition at line 164 of file Body.h.

References toGraphVec3().

osg::Vec3 Physics::dWorldGetGravityV ( dWorldID  id  )  [inline]

Definition at line 88 of file World.h.

References toGraphVec3().

void Physics::dWorldSetGravity ( dWorldID  id,
const osg::Vec3 &  force 
) [inline]

Definition at line 87 of file World.h.

Referenced by Physics::World::init().

dReal Physics::kmhToms ( dReal  v  )  [inline]

Converts km/h to m/s.

Definition at line 103 of file Converters.h.

dReal Physics::msTokmh ( dReal  v  )  [inline]

Converts m/s to km/h.

Definition at line 105 of file Converters.h.

graphBB Physics::toGraphBB ( dReal *  bb  )  [inline]

Definition at line 98 of file Converters.h.

References graphBB, and graphVec3.

Referenced by Physics::AbstractGeom::getAABB().

graphMat Physics::toGraphMatInertia ( const dReal *  m  ) 

Definition at line 31 of file Converters.cpp.

References graphMat.

Referenced by Physics::Mass::getInertiaTensor().

graphMat Physics::toGraphMatRotation ( const dReal *  m  ) 

Definition at line 40 of file Converters.cpp.

References graphMat, and graphQuat.

Referenced by dBodyGetRotationV(), dGeomGetOffsetRotationV(), and dGeomGetRotationV().

graphMat Physics::toGraphMatRotationPosition ( const dReal *  m,
const dReal *  p 
)

graphQuat Physics::toGraphQuat ( const dReal *  v  )  [inline]

graphVec3 Physics::toGraphVec3 ( const dReal *  v  )  [inline]

graphVec4 Physics::toGraphVec4 ( const dVector4 &  v  )  [inline]

Definition at line 80 of file Converters.h.

References graphVec4.

Referenced by Physics::PlaneHandler::getParams().

void Physics::toPhyBB ( const graphBB &  bb,
dReal *  out_bb 
) [inline]

Definition at line 99 of file Converters.h.

void Physics::toPhyMatRotation ( const graphMat &  matrix,
dMatrix3 &  out_matrix 
)

void Physics::toPhyQuat ( const graphQuat &  quat,
dQuaternion &  out_q 
) [inline]

void Physics::toPhyVec3 ( const dReal &  x,
const dReal &  y,
const dReal &  z,
dVector3  out_ret 
) [inline]

Definition at line 83 of file Converters.h.

void Physics::toPhyVec3 ( const graphVec3 &  v,
dVector3  out_ret 
) [inline]

void Physics::toPhyVec4 ( const dReal &  x,
const dReal &  y,
const dReal &  z,
const dReal &  w,
dVector3  out_ret 
) [inline]

Definition at line 85 of file Converters.h.

void Physics::toPhyVec4 ( const graphVec4 &  v,
dVector4  out_ret 
) [inline]

Definition at line 84 of file Converters.h.


Variable Documentation

const dReal Physics::PHY_INFINITY = dInfinity [static]


Generated on Sun Jan 17 11:39:35 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9