Physics::GeometryHandler Class Reference

Abstract class for creation and manipulation of physical geometries (Spheres, boxes, etc. More...

#include <GeometryHandlers.h>

Inheritance diagram for Physics::GeometryHandler:

Inheritance graph
[legend]

List of all members.

Public Types

enum  EGeomType {
  SPHERE = dSphereClass, BOX = dBoxClass, CAPSULE = dCapsuleClass, CYLINDER = dCylinderClass,
  PLANE = dPlaneClass, RAY = dRayClass, CONVEX = dConvexClass, TRANSFORM = dGeomTransformClass,
  MESH = dTriMeshClass, HEIGHT_FIELD = dHeightfieldClass, USER1 = dFirstUserClass
}
 Geom types (builtin or user classes). More...
enum  EBodyADOverride {
  AD_NO_OVERRIDE = 0, AD_FLAG = 0x01, AD_LINEAR = 0x02, AD_ANGULAR = 0x04,
  AD_STEPS = 0x08, AD_TIME = 0x10, AD_SAMPLES_COUNT = 0x20
}
 Flags to say which param to override when attaching a body to a geom. More...

Public Member Functions

 GeometryHandler ()
virtual EGeomType type () const =0
virtual GeometryHandlerclone () const =0
Auto-disable hints
The reason for auto-disable override hints is that some geoms need different parameters.

For exemple, when the body has remained a disable candidate for a certain number of steps (AutoDisableSteps), it is disabled. This is almost completely for boxes, which like to land and bounce up on two points, and teeter motionless for a few steps before falling back down. Round items generally need a much lower (like 1) AutoDisableSteps than boxes do (10+), 10 is the default.

virtual UINT getADOverrideFlag ()
 Gets the auto-disable override flag (default is no override - can be overloaded in derivates). The method returns which parameters can be overriden by the geometry.
virtual bool getADFlag ()
 Returns true if the geometry can be auto-disabled.
virtual dReal getADLinearThreshold ()
virtual dReal getADAngularThreshold ()
virtual UINT getADSteps ()
virtual dReal getADTime ()
virtual UINT getADSamplesCount ()

Protected Member Functions

virtual dGeomID create (dSpaceID spaceId)=0
virtual ~GeometryHandler ()
 Protected destructor forces the object to be deleted by being dereferenced.

Protected Attributes

dGeomID id

Friends

class Geom

On-change callback

The geometry handler can call functions on property change (Like the radius of the sphere, the length of the box, etc.

).

osg::ref_ptr< GHChangeCallbackpChangeCallback
void addOrSetChangeCallback (GHChangeCallback *callback)


Detailed Description

Abstract class for creation and manipulation of physical geometries (Spheres, boxes, etc.

) Geometry handlers are responsible for the geom creation (create() method), not their destruction ! They're a kind of factory. They also contain hints for body auto-disable feature (when a geom is attached to a body).

Version:
0.2.0
Author:
Sukender

Definition at line 73 of file GeometryHandlers.h.


Member Enumeration Documentation

Flags to say which param to override when attaching a body to a geom.

Enumerator:
AD_NO_OVERRIDE  Do not overwrite any auto-disable default parameter.
AD_FLAG  Overwrite default auto-disable state (Body::setAutoDisableFlag()).
AD_LINEAR  Overwrite default linear velocity for auto-disable feature (Body::setAutoDisableLinearThreshold()).
AD_ANGULAR  Overwrite default angular velocity for auto-disable feature (Body::setAutoDisableAngularThreshold()).
AD_STEPS  Overwrite default number of steps for auto-disable feature (Body::setAutoDisableSteps()).
AD_TIME  Overwrite default time for auto-disable feature (Body::setAutoDisableTime()).
AD_SAMPLES_COUNT  Overwrite default samples count for auto-disable feature (Body::setAutoDisableAverageSamplesCount()).

Definition at line 80 of file GeometryHandlers.h.

Geom types (builtin or user classes).

Dev note : be careful about not defining too much classes. See dLastUserClass.

Enumerator:
SPHERE 
BOX 
CAPSULE 
CYLINDER 
PLANE 
RAY 
CONVEX 
TRANSFORM 
MESH 
HEIGHT_FIELD 
USER1 

Definition at line 77 of file GeometryHandlers.h.


Constructor & Destructor Documentation

Physics::GeometryHandler::GeometryHandler (  )  [inline]

Definition at line 90 of file GeometryHandlers.h.

virtual Physics::GeometryHandler::~GeometryHandler (  )  [inline, protected, virtual]

Protected destructor forces the object to be deleted by being dereferenced.

Also avoids the object from beeing created on the stack.

Definition at line 124 of file GeometryHandlers.h.


Member Function Documentation

void Physics::GeometryHandler::addOrSetChangeCallback ( GHChangeCallback callback  )  [inline]

Definition at line 113 of file GeometryHandlers.h.

Referenced by C3DPhy::createPhysicsDebugView().

virtual GeometryHandler* Physics::GeometryHandler::clone (  )  const [pure virtual]

virtual dGeomID Physics::GeometryHandler::create ( dSpaceID  spaceId  )  [protected, pure virtual]

virtual dReal Physics::GeometryHandler::getADAngularThreshold (  )  [inline, virtual]

Reimplemented in Physics::MeshHandler.

Definition at line 101 of file GeometryHandlers.h.

virtual bool Physics::GeometryHandler::getADFlag (  )  [inline, virtual]

Returns true if the geometry can be auto-disabled.

Definition at line 99 of file GeometryHandlers.h.

virtual dReal Physics::GeometryHandler::getADLinearThreshold (  )  [inline, virtual]

Reimplemented in Physics::MeshHandler.

Definition at line 100 of file GeometryHandlers.h.

virtual UINT Physics::GeometryHandler::getADOverrideFlag (  )  [inline, virtual]

Gets the auto-disable override flag (default is no override - can be overloaded in derivates). The method returns which parameters can be overriden by the geometry.

Reimplemented in Physics::SphereHandler, and Physics::MeshHandler.

Definition at line 98 of file GeometryHandlers.h.

virtual UINT Physics::GeometryHandler::getADSamplesCount (  )  [inline, virtual]

Reimplemented in Physics::MeshHandler.

Definition at line 104 of file GeometryHandlers.h.

virtual UINT Physics::GeometryHandler::getADSteps (  )  [inline, virtual]

Reimplemented in Physics::SphereHandler, and Physics::MeshHandler.

Definition at line 102 of file GeometryHandlers.h.

virtual dReal Physics::GeometryHandler::getADTime (  )  [inline, virtual]

Definition at line 103 of file GeometryHandlers.h.

virtual EGeomType Physics::GeometryHandler::type (  )  const [pure virtual]


Friends And Related Function Documentation

friend class Geom [friend]

Definition at line 118 of file GeometryHandlers.h.


Member Data Documentation

dGeomID Physics::GeometryHandler::id [mutable, protected]

Definition at line 120 of file GeometryHandlers.h.

Referenced by Physics::HeightFieldHandler::create().

Definition at line 112 of file GeometryHandlers.h.

Referenced by PhysicsDebugUpdateCB::operator()().


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

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