Blender V2.61 - r43446
Public Member Functions | Protected Member Functions | Protected Attributes | Friends

CcdPhysicsEnvironment Class Reference

#include <CcdPhysicsEnvironment.h>

Inheritance diagram for CcdPhysicsEnvironment:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CcdPhysicsEnvironment (bool useDbvtCulling, btDispatcher *dispatcher=0, btOverlappingPairCache *pairCache=0)
virtual ~CcdPhysicsEnvironment ()
virtual void setDebugDrawer (btIDebugDraw *debugDrawer)
 Perform an integration step of duration 'timeStep'.
virtual void setNumIterations (int numIter)
 setNumIterations set the number of iterations for iterative solvers
virtual void setNumTimeSubSteps (int numTimeSubSteps)
 setNumTimeSubSteps set the number of divisions of the timestep. Tradeoff quality versus performance.
virtual void setDeactivationTime (float dTime)
 setDeactivationTime sets the minimum time that an objects has to stay within the velocity tresholds until it gets fully deactivated
virtual void setDeactivationLinearTreshold (float linTresh)
 setDeactivationLinearTreshold sets the linear velocity treshold, see setDeactivationTime
virtual void setDeactivationAngularTreshold (float angTresh)
 setDeactivationAngularTreshold sets the angular velocity treshold, see setDeactivationTime
virtual void setContactBreakingTreshold (float contactBreakingTreshold)
 setContactBreakingTreshold sets tresholds to do with contact point management
virtual void setCcdMode (int ccdMode)
 continuous collision detection mode, very experimental for Bullet
virtual void setSolverType (int solverType)
 setSolverType, internal setting, chooses solvertype, PSOR, Dantzig, impulse based, penalty based
virtual void setSolverSorConstant (float sor)
 successive overrelaxation constant, in case PSOR is used, values in between 1 and 2 guarantee converging behaviour
virtual void setSolverTau (float tau)
 setTau sets the spring constant of a penalty based solver
virtual void setSolverDamping (float damping)
 setDamping sets the damper constant of a penalty based solver
virtual void setLinearAirDamping (float damping)
 linear air damping for rigidbodies
virtual void setUseEpa (bool epa)
 penetrationdepth setting
virtual void beginFrame ()
virtual void endFrame ()
virtual bool proceedDeltaTime (double curTime, float timeStep, float interval)
 Perform an integration step of duration 'timeStep'.
virtual void debugDrawWorld ()
 draw debug lines (make sure to call this during the render phase, otherwise lines are not drawn properly)
virtual void setFixedTimeStep (bool useFixedTimeStep, float fixedTimeStep)
virtual float getFixedTimeStep ()
virtual void setDebugMode (int debugMode)
 setDebugMode is used to support several ways of debug lines, contact point visualization
virtual void setGravity (float x, float y, float z)
virtual void getGravity (PHY__Vector3 &grav)
virtual int createConstraint (class PHY_IPhysicsController *ctrl, class PHY_IPhysicsController *ctrl2, PHY_ConstraintType type, float pivotX, float pivotY, float pivotZ, float axisX, float axisY, float axisZ, float axis1X=0, float axis1Y=0, float axis1Z=0, float axis2X=0, float axis2Y=0, float axis2Z=0, int flag=0)
virtual int createUniversalD6Constraint (class PHY_IPhysicsController *ctrlRef, class PHY_IPhysicsController *ctrlOther, btTransform &localAttachmentFrameRef, btTransform &localAttachmentOther, const btVector3 &linearMinLimits, const btVector3 &linearMaxLimits, const btVector3 &angularMinLimits, const btVector3 &angularMaxLimits, int flags)
virtual void setConstraintParam (int constraintId, int param, float value, float value1)
virtual float getConstraintParam (int constraintId, int param)
virtual void removeConstraint (int constraintid)
virtual float getAppliedImpulse (int constraintid)
virtual void CallbackTriggers ()
virtual PHY_IVehiclegetVehicleConstraint (int constraintId)
btTypedConstraintgetConstraintById (int constraintId)
virtual PHY_IPhysicsControllerrayTest (PHY_IRayCastFilterCallback &filterCallback, float fromX, float fromY, float fromZ, float toX, float toY, float toZ)
virtual bool cullingTest (PHY_CullingCallback callback, void *userData, PHY__Vector4 *planes, int nplanes, int occlusionRes)
virtual void addSensor (PHY_IPhysicsController *ctrl)
virtual void removeSensor (PHY_IPhysicsController *ctrl)
virtual void addTouchCallback (int response_class, PHY_ResponseCallback callback, void *user)
virtual bool requestCollisionCallback (PHY_IPhysicsController *ctrl)
virtual bool removeCollisionCallback (PHY_IPhysicsController *ctrl)
virtual PHY_IPhysicsControllerCreateSphereController (float radius, const PHY__Vector3 &position)
virtual PHY_IPhysicsControllerCreateConeController (float coneradius, float coneheight)
virtual int getNumContactPoints ()
virtual void getContactPoint (int i, float &hitX, float &hitY, float &hitZ, float &normalX, float &normalY, float &normalZ)
void addCcdPhysicsController (CcdPhysicsController *ctrl)
bool removeCcdPhysicsController (CcdPhysicsController *ctrl)
void updateCcdPhysicsController (CcdPhysicsController *ctrl, btScalar newMass, int newCollisionFlags, short int newCollisionGroup, short int newCollisionMask)
void disableCcdPhysicsController (CcdPhysicsController *ctrl)
void enableCcdPhysicsController (CcdPhysicsController *ctrl)
void refreshCcdPhysicsController (CcdPhysicsController *ctrl)
void addCcdGraphicController (CcdGraphicController *ctrl)
void removeCcdGraphicController (CcdGraphicController *ctrl)
btBroadphaseInterfacegetBroadphase ()
btDbvtBroadphasegetCullingTree ()
btDispatchergetDispatcher ()
bool IsSatCollisionDetectionEnabled () const
void EnableSatCollisionDetection (bool enableSat)
const btPersistentManifold * GetManifold (int index) const
void SyncMotionStates (float timeStep)
class btSoftRigidDynamicsWorldgetDynamicsWorld ()
class btConstraintSolverGetConstraintSolver ()
void MergeEnvironment (CcdPhysicsEnvironment *other)

Protected Member Functions

void processFhSprings (double curTime, float timeStep)
virtual void exportFile (const char *filename)

Protected Attributes

btIDebugDrawm_debugDrawer
class
btDefaultCollisionConfiguration
m_collisionConfiguration
class btBroadphaseInterfacem_broadphase
btOverlappingPairCachem_cullingCache
struct btDbvtBroadphasem_cullingTree
int m_numIterations
int m_numTimeSubSteps
int m_ccdMode
int m_solverType
int m_profileTimings
bool m_enableSatCollisionDetection
btContactSolverInfo m_solverInfo
std::set< CcdPhysicsController * > m_controllers
std::set< CcdPhysicsController * > m_triggerControllers
PHY_ResponseCallback m_triggerCallbacks [PHY_NUM_RESPONSE]
void * m_triggerCallbacksUserPtrs [PHY_NUM_RESPONSE]
std::vector< WrapperVehicle * > m_wrapperVehicles
class btSoftRigidDynamicsWorldm_dynamicsWorld
class btConstraintSolverm_solver
class btOverlappingPairCachem_ownPairCache
class CcdOverlapFilterCallBackm_filterCallback
class btDispatcherm_ownDispatcher
bool m_scalingPropagated

Friends

class CcdOverlapFilterCallBack

Detailed Description

CcdPhysicsEnvironment is an experimental mainloop for physics simulation using optional continuous collision detection. Physics Environment takes care of stepping the simulation and is a container for physics entities. It stores rigidbodies,constraints, materials etc. A derived class may be able to 'construct' entities by loading and/or converting

Definition at line 60 of file CcdPhysicsEnvironment.h.


Constructor & Destructor Documentation

CcdPhysicsEnvironment::CcdPhysicsEnvironment ( bool  useDbvtCulling,
btDispatcher dispatcher = 0,
btOverlappingPairCache pairCache = 0 
)
CcdPhysicsEnvironment::~CcdPhysicsEnvironment ( ) [virtual]

Definition at line 1853 of file CcdPhysicsEnvironment.cpp.

References NULL.


Member Function Documentation

void CcdPhysicsEnvironment::addCcdGraphicController ( CcdGraphicController ctrl)
void CcdPhysicsEnvironment::addCcdPhysicsController ( CcdPhysicsController ctrl)
void CcdPhysicsEnvironment::addSensor ( PHY_IPhysicsController ctrl) [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 2064 of file CcdPhysicsEnvironment.cpp.

void CcdPhysicsEnvironment::addTouchCallback ( int  response_class,
PHY_ResponseCallback  callback,
void *  user 
) [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 2092 of file CcdPhysicsEnvironment.cpp.

void CcdPhysicsEnvironment::beginFrame ( ) [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 572 of file CcdPhysicsEnvironment.cpp.

void CcdPhysicsEnvironment::CallbackTriggers ( ) [virtual]
PHY_IPhysicsController * CcdPhysicsEnvironment::CreateConeController ( float  coneradius,
float  coneheight 
) [virtual]
int CcdPhysicsEnvironment::createConstraint ( class PHY_IPhysicsController ctrl,
class PHY_IPhysicsController ctrl2,
PHY_ConstraintType  type,
float  pivotX,
float  pivotY,
float  pivotZ,
float  axisX,
float  axisY,
float  axisZ,
float  axis1X = 0,
float  axis1Y = 0,
float  axis1Z = 0,
float  axis2X = 0,
float  axis2Y = 0,
float  axis2Z = 0,
int  flag = 0 
) [virtual]
PHY_IPhysicsController * CcdPhysicsEnvironment::CreateSphereController ( float  radius,
const PHY__Vector3 position 
) [virtual]
int CcdPhysicsEnvironment::createUniversalD6Constraint ( class PHY_IPhysicsController ctrlRef,
class PHY_IPhysicsController ctrlOther,
btTransform localAttachmentFrameRef,
btTransform localAttachmentOther,
const btVector3 &  linearMinLimits,
const btVector3 &  linearMaxLimits,
const btVector3 &  angularMinLimits,
const btVector3 &  angularMaxLimits,
int  flags 
) [virtual]
bool CcdPhysicsEnvironment::cullingTest ( PHY_CullingCallback  callback,
void *  userData,
PHY__Vector4 planes,
int  nplanes,
int  occlusionRes 
) [virtual]
void CcdPhysicsEnvironment::debugDrawWorld ( ) [virtual]

draw debug lines (make sure to call this during the render phase, otherwise lines are not drawn properly)

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 577 of file CcdPhysicsEnvironment.cpp.

References btSoftRigidDynamicsWorld::debugDrawWorld(), btCollisionWorld::getDebugDrawer(), btIDebugDraw::getDebugMode(), and m_dynamicsWorld.

void CcdPhysicsEnvironment::disableCcdPhysicsController ( CcdPhysicsController ctrl)
void CcdPhysicsEnvironment::enableCcdPhysicsController ( CcdPhysicsController ctrl)
void CcdPhysicsEnvironment::EnableSatCollisionDetection ( bool  enableSat) [inline]

Definition at line 237 of file CcdPhysicsEnvironment.h.

References m_enableSatCollisionDetection.

virtual void CcdPhysicsEnvironment::endFrame ( ) [inline, virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 121 of file CcdPhysicsEnvironment.h.

void CcdPhysicsEnvironment::exportFile ( const char *  filename) [protected, virtual]
float CcdPhysicsEnvironment::getAppliedImpulse ( int  constraintid) [virtual]
btBroadphaseInterface * CcdPhysicsEnvironment::getBroadphase ( )

Definition at line 1829 of file CcdPhysicsEnvironment.cpp.

btTypedConstraint * CcdPhysicsEnvironment::getConstraintById ( int  constraintId)

Definition at line 2047 of file CcdPhysicsEnvironment.cpp.

References btTypedConstraint::getUserConstraintId(), and i.

float CcdPhysicsEnvironment::getConstraintParam ( int  constraintId,
int  param 
) [virtual]
class btConstraintSolver* CcdPhysicsEnvironment::GetConstraintSolver ( )
void CcdPhysicsEnvironment::getContactPoint ( int  i,
float &  hitX,
float &  hitY,
float &  hitZ,
float &  normalX,
float &  normalY,
float &  normalZ 
) [virtual]

Definition at line 1821 of file CcdPhysicsEnvironment.cpp.

btDbvtBroadphase* CcdPhysicsEnvironment::getCullingTree ( ) [inline]

Definition at line 227 of file CcdPhysicsEnvironment.h.

References m_cullingTree.

Referenced by CcdGraphicController::SetGraphicTransform().

btDispatcher * CcdPhysicsEnvironment::getDispatcher ( )

Definition at line 1834 of file CcdPhysicsEnvironment.cpp.

class btSoftRigidDynamicsWorld* CcdPhysicsEnvironment::getDynamicsWorld ( ) [inline]
virtual float CcdPhysicsEnvironment::getFixedTimeStep ( ) [inline, virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 135 of file CcdPhysicsEnvironment.h.

void CcdPhysicsEnvironment::getGravity ( PHY__Vector3 grav) [virtual]
const btPersistentManifold* CcdPhysicsEnvironment::GetManifold ( int  index) const
int CcdPhysicsEnvironment::getNumContactPoints ( ) [virtual]

Definition at line 1816 of file CcdPhysicsEnvironment.cpp.

PHY_IVehicle * CcdPhysicsEnvironment::getVehicleConstraint ( int  constraintId) [virtual]
bool CcdPhysicsEnvironment::IsSatCollisionDetectionEnabled ( ) const [inline]

Definition at line 232 of file CcdPhysicsEnvironment.h.

References m_enableSatCollisionDetection.

void CcdPhysicsEnvironment::MergeEnvironment ( CcdPhysicsEnvironment other)

Definition at line 1839 of file CcdPhysicsEnvironment.cpp.

References m_controllers, and removeCcdPhysicsController().

Referenced by KX_Scene::MergeScene().

bool CcdPhysicsEnvironment::proceedDeltaTime ( double  curTime,
float  timeStep,
float  interval 
) [virtual]
void CcdPhysicsEnvironment::processFhSprings ( double  curTime,
float  timeStep 
) [protected]
PHY_IPhysicsController * CcdPhysicsEnvironment::rayTest ( PHY_IRayCastFilterCallback filterCallback,
float  fromX,
float  fromY,
float  fromZ,
float  toX,
float  toY,
float  toZ 
) [virtual]
void CcdPhysicsEnvironment::refreshCcdPhysicsController ( CcdPhysicsController ctrl)
void CcdPhysicsEnvironment::removeCcdGraphicController ( CcdGraphicController ctrl)
bool CcdPhysicsEnvironment::removeCcdPhysicsController ( CcdPhysicsController ctrl)
bool CcdPhysicsEnvironment::removeCollisionCallback ( PHY_IPhysicsController ctrl) [virtual]
void CcdPhysicsEnvironment::removeConstraint ( int  constraintid) [virtual]
void CcdPhysicsEnvironment::removeSensor ( PHY_IPhysicsController ctrl) [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 2087 of file CcdPhysicsEnvironment.cpp.

bool CcdPhysicsEnvironment::requestCollisionCallback ( PHY_IPhysicsController ctrl) [virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 2124 of file CcdPhysicsEnvironment.cpp.

References CcdPhysicsController::Register().

void CcdPhysicsEnvironment::setCcdMode ( int  ccdMode) [virtual]

continuous collision detection mode, very experimental for Bullet

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 817 of file CcdPhysicsEnvironment.cpp.

References m_ccdMode.

void CcdPhysicsEnvironment::setConstraintParam ( int  constraintId,
int  param,
float  value,
float  value1 
) [virtual]
void CcdPhysicsEnvironment::setContactBreakingTreshold ( float  contactBreakingTreshold) [virtual]

setContactBreakingTreshold sets tresholds to do with contact point management

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 810 of file CcdPhysicsEnvironment.cpp.

References gContactBreakingThreshold.

void CcdPhysicsEnvironment::setDeactivationAngularTreshold ( float  angTresh) [virtual]

setDeactivationAngularTreshold sets the angular velocity treshold, see setDeactivationTime

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 805 of file CcdPhysicsEnvironment.cpp.

References gAngularSleepingTreshold.

Referenced by KX_BlenderSceneConverter::ConvertScene().

void CcdPhysicsEnvironment::setDeactivationLinearTreshold ( float  linTresh) [virtual]

setDeactivationLinearTreshold sets the linear velocity treshold, see setDeactivationTime

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 801 of file CcdPhysicsEnvironment.cpp.

References gLinearSleepingTreshold.

Referenced by KX_BlenderSceneConverter::ConvertScene().

void CcdPhysicsEnvironment::setDeactivationTime ( float  dTime) [virtual]

setDeactivationTime sets the minimum time that an objects has to stay within the velocity tresholds until it gets fully deactivated

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 797 of file CcdPhysicsEnvironment.cpp.

References gDeactivationTime.

void CcdPhysicsEnvironment::setDebugDrawer ( btIDebugDraw debugDrawer) [virtual]

Perform an integration step of duration 'timeStep'.

Definition at line 286 of file CcdPhysicsEnvironment.cpp.

References m_debugDrawer, m_dynamicsWorld, and btCollisionWorld::setDebugDrawer().

Referenced by KX_BlenderSceneConverter::ConvertScene().

void CcdPhysicsEnvironment::setDebugMode ( int  debugMode) [virtual]

setDebugMode is used to support several ways of debug lines, contact point visualization

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 786 of file CcdPhysicsEnvironment.cpp.

References m_debugDrawer, and btIDebugDraw::setDebugMode().

Referenced by KX_BlenderSceneConverter::ConvertScene().

virtual void CcdPhysicsEnvironment::setFixedTimeStep ( bool  useFixedTimeStep,
float  fixedTimeStep 
) [inline, virtual]

Implements PHY_IPhysicsEnvironment.

Definition at line 128 of file CcdPhysicsEnvironment.h.

References setNumTimeSubSteps().

void CcdPhysicsEnvironment::setGravity ( float  x,
float  y,
float  z 
) [virtual]
void CcdPhysicsEnvironment::setLinearAirDamping ( float  damping) [virtual]

linear air damping for rigidbodies

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 838 of file CcdPhysicsEnvironment.cpp.

void CcdPhysicsEnvironment::setNumIterations ( int  numIter) [virtual]

setNumIterations set the number of iterations for iterative solvers

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 793 of file CcdPhysicsEnvironment.cpp.

References m_numIterations.

virtual void CcdPhysicsEnvironment::setNumTimeSubSteps ( int  numTimeSubSteps) [inline, virtual]

setNumTimeSubSteps set the number of divisions of the timestep. Tradeoff quality versus performance.

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 104 of file CcdPhysicsEnvironment.h.

References m_numTimeSubSteps.

Referenced by setFixedTimeStep().

void CcdPhysicsEnvironment::setSolverDamping ( float  damping) [virtual]

setDamping sets the damper constant of a penalty based solver

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 832 of file CcdPhysicsEnvironment.cpp.

References btContactSolverInfoData::m_damping, and m_solverInfo.

void CcdPhysicsEnvironment::setSolverSorConstant ( float  sor) [virtual]

successive overrelaxation constant, in case PSOR is used, values in between 1 and 2 guarantee converging behaviour

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 823 of file CcdPhysicsEnvironment.cpp.

References m_solverInfo, and btContactSolverInfoData::m_sor.

void CcdPhysicsEnvironment::setSolverTau ( float  tau) [virtual]

setTau sets the spring constant of a penalty based solver

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 828 of file CcdPhysicsEnvironment.cpp.

References m_solverInfo, and btContactSolverInfoData::m_tau.

void CcdPhysicsEnvironment::setSolverType ( int  solverType) [virtual]

setSolverType, internal setting, chooses solvertype, PSOR, Dantzig, impulse based, penalty based

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 848 of file CcdPhysicsEnvironment.cpp.

References m_solver, and m_solverType.

Referenced by CcdPhysicsEnvironment().

void CcdPhysicsEnvironment::setUseEpa ( bool  epa) [virtual]

penetrationdepth setting

Reimplemented from PHY_IPhysicsEnvironment.

Definition at line 843 of file CcdPhysicsEnvironment.cpp.

void CcdPhysicsEnvironment::SyncMotionStates ( float  timeStep)
void CcdPhysicsEnvironment::updateCcdPhysicsController ( CcdPhysicsController ctrl,
btScalar  newMass,
int  newCollisionFlags,
short int  newCollisionGroup,
short int  newCollisionMask 
)

Friends And Related Function Documentation

friend class CcdOverlapFilterCallBack [friend]

Definition at line 62 of file CcdPhysicsEnvironment.h.

Referenced by CcdPhysicsEnvironment().


Member Data Documentation

Definition at line 69 of file CcdPhysicsEnvironment.h.

Referenced by CcdPhysicsEnvironment().

Definition at line 81 of file CcdPhysicsEnvironment.h.

Referenced by setCcdMode().

Definition at line 68 of file CcdPhysicsEnvironment.h.

Referenced by CcdPhysicsEnvironment().

Definition at line 71 of file CcdPhysicsEnvironment.h.

Referenced by CcdPhysicsEnvironment().

Definition at line 66 of file CcdPhysicsEnvironment.h.

Referenced by CcdPhysicsEnvironment(), setDebugDrawer(), and setDebugMode().

Definition at line 281 of file CcdPhysicsEnvironment.h.

Referenced by CcdPhysicsEnvironment().

Definition at line 75 of file CcdPhysicsEnvironment.h.

Referenced by setNumIterations().

Definition at line 78 of file CcdPhysicsEnvironment.h.

Referenced by proceedDeltaTime(), and setNumTimeSubSteps().

Definition at line 283 of file CcdPhysicsEnvironment.h.

Referenced by CcdPhysicsEnvironment().

Definition at line 279 of file CcdPhysicsEnvironment.h.

Definition at line 83 of file CcdPhysicsEnvironment.h.

Definition at line 285 of file CcdPhysicsEnvironment.h.

Definition at line 277 of file CcdPhysicsEnvironment.h.

Referenced by CcdPhysicsEnvironment(), and setSolverType().

Definition at line 86 of file CcdPhysicsEnvironment.h.

Referenced by setSolverDamping(), setSolverSorConstant(), and setSolverTau().

Definition at line 82 of file CcdPhysicsEnvironment.h.

Referenced by setSolverType().

Definition at line 264 of file CcdPhysicsEnvironment.h.

Referenced by CcdPhysicsEnvironment().

void* CcdPhysicsEnvironment::m_triggerCallbacksUserPtrs[PHY_NUM_RESPONSE] [protected]

Definition at line 265 of file CcdPhysicsEnvironment.h.

Definition at line 262 of file CcdPhysicsEnvironment.h.

Referenced by removeCcdPhysicsController().

Definition at line 267 of file CcdPhysicsEnvironment.h.

Referenced by proceedDeltaTime().


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