Blender V2.61 - r43446
|
#include <CcdPhysicsEnvironment.h>
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_IVehicle * | getVehicleConstraint (int constraintId) |
btTypedConstraint * | getConstraintById (int constraintId) |
virtual PHY_IPhysicsController * | rayTest (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_IPhysicsController * | CreateSphereController (float radius, const PHY__Vector3 &position) |
virtual PHY_IPhysicsController * | CreateConeController (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) |
btBroadphaseInterface * | getBroadphase () |
btDbvtBroadphase * | getCullingTree () |
btDispatcher * | getDispatcher () |
bool | IsSatCollisionDetectionEnabled () const |
void | EnableSatCollisionDetection (bool enableSat) |
const btPersistentManifold * | GetManifold (int index) const |
void | SyncMotionStates (float timeStep) |
class btSoftRigidDynamicsWorld * | getDynamicsWorld () |
class btConstraintSolver * | GetConstraintSolver () |
void | MergeEnvironment (CcdPhysicsEnvironment *other) |
Protected Member Functions | |
void | processFhSprings (double curTime, float timeStep) |
virtual void | exportFile (const char *filename) |
Protected Attributes | |
btIDebugDraw * | m_debugDrawer |
class btDefaultCollisionConfiguration * | m_collisionConfiguration |
class btBroadphaseInterface * | m_broadphase |
btOverlappingPairCache * | m_cullingCache |
struct btDbvtBroadphase * | m_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 btSoftRigidDynamicsWorld * | m_dynamicsWorld |
class btConstraintSolver * | m_solver |
class btOverlappingPairCache * | m_ownPairCache |
class CcdOverlapFilterCallBack * | m_filterCallback |
class btDispatcher * | m_ownDispatcher |
bool | m_scalingPropagated |
Friends | |
class | CcdOverlapFilterCallBack |
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.
CcdPhysicsEnvironment::CcdPhysicsEnvironment | ( | bool | useDbvtCulling, |
btDispatcher * | dispatcher = 0 , |
||
btOverlappingPairCache * | pairCache = 0 |
||
) |
Definition at line 328 of file CcdPhysicsEnvironment.cpp.
References CcdOverlapFilterCallBack, btBroadphaseInterface::getOverlappingPairCache(), i, m_broadphase, m_collisionConfiguration, m_cullingCache, m_cullingTree, m_debugDrawer, m_dynamicsWorld, m_filterCallback, m_ownDispatcher, m_solver, m_triggerCallbacks, PHY_NUM_RESPONSE, btGImpactCollisionAlgorithm::registerAlgorithm(), setGravity(), btOverlappingPairCache::setOverlapFilterCallback(), and setSolverType().
CcdPhysicsEnvironment::~CcdPhysicsEnvironment | ( | ) | [virtual] |
Definition at line 1853 of file CcdPhysicsEnvironment.cpp.
References NULL.
void CcdPhysicsEnvironment::addCcdGraphicController | ( | CcdGraphicController * | ctrl | ) |
Definition at line 537 of file CcdPhysicsEnvironment.cpp.
References assert, btDbvtBroadphase::createProxy(), CcdGraphicController::getAabb(), CcdGraphicController::getBroadphaseHandle(), INVALID_SHAPE_PROXYTYPE, m_cullingTree, NULL, and CcdGraphicController::setBroadphaseHandle().
Referenced by CcdGraphicController::Activate(), and BL_CreateGraphicObjectNew().
void CcdPhysicsEnvironment::addCcdPhysicsController | ( | CcdPhysicsController * | ctrl | ) |
Definition at line 383 of file CcdPhysicsEnvironment.cpp.
References btDiscreteDynamicsWorld::addCollisionObject(), btDiscreteDynamicsWorld::addRigidBody(), btSoftRigidDynamicsWorld::addSoftBody(), assert, CcdPhysicsController::GetCollisionFilterGroup(), CcdPhysicsController::GetCollisionFilterMask(), CcdPhysicsController::GetCollisionObject(), CcdPhysicsController::GetRigidBody(), CcdPhysicsController::GetSoftBody(), ISLAND_SLEEPING, m_controllers, m_dynamicsWorld, and btRigidBody::setGravity().
Referenced by CcdPhysicsController::PostProcessReplica(), CcdPhysicsController::ReplaceControllerShape(), and CcdPhysicsController::SetPhysicsEnvironment().
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] |
Definition at line 2134 of file CcdPhysicsEnvironment.cpp.
References MakeCursor::color, btIDebugDraw::DBG_DrawContactPoints, btManifoldPoint::getDistance(), btManifoldPoint::getLifeTime(), btDispatcher::getManifoldByIndexInternal(), btDispatcher::getNumManifolds(), btManifoldPoint::m_normalWorldOnB, btManifoldPoint::m_positionWorldOnB, btDispatcher::needsResponse(), and PHY_OBJECT_RESPONSE.
Referenced by proceedDeltaTime().
PHY_IPhysicsController * CcdPhysicsEnvironment::CreateConeController | ( | float | coneradius, |
float | coneheight | ||
) | [virtual] |
Implements PHY_IPhysicsEnvironment.
Definition at line 2762 of file CcdPhysicsEnvironment.cpp.
References CcdConstructionInfo::AllFilter, CcdConstructionInfo::m_bSensor, CcdConstructionInfo::m_collisionFilterGroup, CcdConstructionInfo::m_collisionFilterMask, CcdConstructionInfo::m_collisionFlags, CcdConstructionInfo::m_collisionShape, CcdConstructionInfo::m_MotionState, CcdConstructionInfo::m_physicsEnv, DefaultMotionState::m_worldTransform, CcdConstructionInfo::SensorFilter, and btTransform::setIdentity().
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] |
frameInB in worldspace
frameInB in worldspace
Implements PHY_IPhysicsEnvironment.
Definition at line 2312 of file CcdPhysicsEnvironment.cpp.
References btSoftBody::appendAnchor(), btPlaneSpace1(), CCD_CONSTRAINT_DISABLE_LINKED_COLLISION, findClosestNode(), btTransform::getBasis(), btRigidBody::getCenterOfMassTransform(), CcdPhysicsController::GetCollisionObject(), CcdPhysicsController::GetRigidBody(), CcdPhysicsController::GetSoftBody(), btTypedConstraint::getUserConstraintId(), btRaycastVehicle::getUserConstraintId(), btTransform::inverse(), btSoftBody::m_initialWorldTransform, PHY_ANGULAR_CONSTRAINT, PHY_CONE_TWIST_CONSTRAINT, PHY_GENERIC_6DOF_CONSTRAINT, PHY_LINEHINGE_CONSTRAINT, PHY_POINT2POINT_CONSTRAINT, PHY_VEHICLE_CONSTRAINT, btSoftBody::setMass(), btTransform::setOrigin(), btRaycastVehicle::setUserConstraintId(), btTypedConstraint::setUserConstraintId(), btTypedConstraint::setUserConstraintType(), btRaycastVehicle::setUserConstraintType(), and btMatrix3x3::setValue().
PHY_IPhysicsController * CcdPhysicsEnvironment::CreateSphereController | ( | float | radius, |
const PHY__Vector3 & | position | ||
) | [virtual] |
Implements PHY_IPhysicsEnvironment.
Definition at line 2266 of file CcdPhysicsEnvironment.cpp.
References CcdConstructionInfo::AllFilter, CcdConstructionInfo::m_bSensor, CcdConstructionInfo::m_collisionFilterGroup, CcdConstructionInfo::m_collisionFilterMask, CcdConstructionInfo::m_collisionFlags, CcdConstructionInfo::m_collisionShape, CcdConstructionInfo::m_MotionState, CcdConstructionInfo::m_physicsEnv, DefaultMotionState::m_worldTransform, CcdConstructionInfo::SensorFilter, btTransform::setIdentity(), and btTransform::setOrigin().
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] |
Definition at line 903 of file CcdPhysicsEnvironment.cpp.
References btDiscreteDynamicsWorld::addConstraint(), CCD_CONSTRAINT_DISABLE_LINKED_COLLISION, CcdPhysicsController::GetRigidBody(), btTypedConstraint::getUserConstraintId(), m_dynamicsWorld, PHY_GENERIC_6DOF_CONSTRAINT, btGeneric6DofConstraint::setAngularLowerLimit(), btGeneric6DofConstraint::setAngularUpperLimit(), btGeneric6DofConstraint::setLinearLowerLimit(), btGeneric6DofConstraint::setLinearUpperLimit(), btTypedConstraint::setUserConstraintId(), and btTypedConstraint::setUserConstraintType().
bool CcdPhysicsEnvironment::cullingTest | ( | PHY_CullingCallback | callback, |
void * | userData, | ||
PHY__Vector4 * | planes, | ||
int | nplanes, | ||
int | occlusionRes | ||
) | [virtual] |
Implements PHY_IPhysicsEnvironment.
Definition at line 1786 of file CcdPhysicsEnvironment.cpp.
References btDbvt::collideKDOP(), btDbvt::collideOCL(), gOcb, i, DbvtCullingCallback::m_ocb, and OcclusionBuffer::setup().
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 | ) |
Definition at line 504 of file CcdPhysicsEnvironment.cpp.
References CcdPhysicsController::GetCollisionObject(), CcdPhysicsController::GetRigidBody(), CcdPhysicsController::GetSoftBody(), m_controllers, m_dynamicsWorld, btSoftRigidDynamicsWorld::removeCollisionObject(), and btDiscreteDynamicsWorld::removeRigidBody().
void CcdPhysicsEnvironment::enableCcdPhysicsController | ( | CcdPhysicsController * | ctrl | ) |
Definition at line 487 of file CcdPhysicsEnvironment.cpp.
References btDiscreteDynamicsWorld::addCollisionObject(), CcdPhysicsController::GetCollisionFilterGroup(), CcdPhysicsController::GetCollisionFilterMask(), CcdPhysicsController::GetCollisionObject(), CcdPhysicsController::GetMotionState(), CcdPhysicsController::GetTransformFromMotionState(), m_controllers, m_dynamicsWorld, and CcdPhysicsController::SetCenterOfMassTransform().
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] |
Reimplemented from PHY_IPhysicsEnvironment.
Definition at line 2805 of file CcdPhysicsEnvironment.cpp.
References btDefaultSerializer::getBufferPointer(), btDefaultSerializer::getCurrentBufferSize(), CcdPhysicsController::getName(), i, and btDefaultSerializer::registerNameForPointer().
float CcdPhysicsEnvironment::getAppliedImpulse | ( | int | constraintid | ) | [virtual] |
Reimplemented from PHY_IPhysicsEnvironment.
Definition at line 2789 of file CcdPhysicsEnvironment.cpp.
References btTypedConstraint::getAppliedImpulse(), btTypedConstraint::getUserConstraintId(), and i.
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] |
Implements PHY_IPhysicsEnvironment.
Definition at line 1898 of file CcdPhysicsEnvironment.cpp.
References btGeneric6DofConstraint::calculateTransforms(), btGeneric6DofConstraint::getAngle(), btGeneric6DofConstraint::getRelativePivotPosition(), btTypedConstraint::getUserConstraintType(), and PHY_GENERIC_6DOF_CONSTRAINT.
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] |
Definition at line 248 of file CcdPhysicsEnvironment.h.
References m_dynamicsWorld.
Referenced by CcdPhysicsController::CreateSoftbody(), and CcdPhysicsController::ReplaceControllerShape().
virtual float CcdPhysicsEnvironment::getFixedTimeStep | ( | ) | [inline, virtual] |
Implements PHY_IPhysicsEnvironment.
Definition at line 135 of file CcdPhysicsEnvironment.h.
void CcdPhysicsEnvironment::getGravity | ( | PHY__Vector3 & | grav | ) | [virtual] |
Definition at line 881 of file CcdPhysicsEnvironment.cpp.
References btDiscreteDynamicsWorld::getGravity(), and m_dynamicsWorld.
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] |
Implements PHY_IPhysicsEnvironment.
Definition at line 2242 of file CcdPhysicsEnvironment.cpp.
References btRaycastVehicle::getUserConstraintId(), WrapperVehicle::GetVehicle(), and i.
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] |
Perform an integration step of duration 'timeStep'.
Implements PHY_IPhysicsEnvironment.
Definition at line 583 of file CcdPhysicsEnvironment.cpp.
References CallbackTriggers(), i, m_controllers, m_dynamicsWorld, m_numTimeSubSteps, m_wrapperVehicles, processFhSprings(), btDiscreteDynamicsWorld::stepSimulation(), and WrapperVehicle::SyncWheels().
void CcdPhysicsEnvironment::processFhSprings | ( | double | curTime, |
float | timeStep | ||
) | [protected] |
Definition at line 650 of file CcdPhysicsEnvironment.cpp.
References btRigidBody::applyCentralImpulse(), btMax(), distance(), btRigidBody::getAngularVelocity(), btTransform::getBasis(), btRigidBody::getCenterOfMassPosition(), btRigidBody::getCenterOfMassTransform(), CcdPhysicsController::getConstructionInfo(), btRigidBody::getInvMass(), btRigidBody::getLinearVelocity(), CcdPhysicsController::getParentCtrl(), CcdPhysicsController::GetRigidBody(), btRigidBody::getVelocityInLocalPoint(), btCollisionWorld::RayResultCallback::hasHit(), btCollisionWorld::RayResultCallback::m_closestHitFraction, btCollisionWorld::RayResultCallback::m_collisionObject, m_controllers, CcdConstructionInfo::m_do_anisotropic, CcdConstructionInfo::m_do_fh, CcdConstructionInfo::m_do_rot_fh, m_dynamicsWorld, CcdConstructionInfo::m_fh_damping, CcdConstructionInfo::m_fh_distance, CcdConstructionInfo::m_fh_normal, CcdConstructionInfo::m_fh_spring, btCollisionWorld::ClosestRayResultCallback::m_hitNormalWorld, CcdConstructionInfo::m_radius, btSoftRigidDynamicsWorld::rayTest(), btRigidBody::setAngularVelocity(), btRigidBody::setLinearVelocity(), and SIMD_EPSILON.
Referenced by proceedDeltaTime().
PHY_IPhysicsController * CcdPhysicsEnvironment::rayTest | ( | PHY_IRayCastFilterCallback & | filterCallback, |
float | fromX, | ||
float | fromY, | ||
float | fromZ, | ||
float | toX, | ||
float | toY, | ||
float | toZ | ||
) | [virtual] |
Implements PHY_IPhysicsEnvironment.
Definition at line 1080 of file CcdPhysicsEnvironment.cpp.
References A, CcdConstructionInfo::AllFilter, cross(), CcdShapeConstructionInfo::GetChildShape(), CcdPhysicsController::GetCollisionObject(), GetHitTriangle(), CcdShapeConstructionInfo::GetMesh(), btCollisionWorld::RayResultCallback::hasHit(), btCollisionShape::isCompound(), btCollisionShape::isSoftBody(), btCollisionWorld::RayResultCallback::m_collisionFilterMask, btCollisionWorld::RayResultCallback::m_collisionObject, PHY_RayCastResult::m_controller, m_dynamicsWorld, PHY_IRayCastFilterCallback::m_faceNormal, btSoftBody::m_faces, PHY_IRayCastFilterCallback::m_faceUV, PHY_RayCastResult::m_hitNormal, btCollisionWorld::ClosestRayResultCallback::m_hitNormalWorld, PHY_RayCastResult::m_hitPoint, btCollisionWorld::ClosestRayResultCallback::m_hitPointWorld, FilterClosestRayResultCallback::m_hitTriangleIndex, FilterClosestRayResultCallback::m_hitTriangleShape, PHY_RayCastResult::m_hitUV, PHY_RayCastResult::m_hitUVOK, PHY_RayCastResult::m_meshObject, PHY_RayCastResult::m_polygon, CcdShapeConstructionInfo::m_polygonIndexArray, CcdPhysicsController::m_shapeInfo, CcdShapeConstructionInfo::m_triFaceUVcoArray, NULL, btSoftRigidDynamicsWorld::rayTest(), PHY_IRayCastFilterCallback::reportHit(), CcdConstructionInfo::SensorFilter, SIMD_EPSILON, CcdShapeConstructionInfo::UVco::uv, and simple_enum_gen::w.
void CcdPhysicsEnvironment::refreshCcdPhysicsController | ( | CcdPhysicsController * | ctrl | ) |
Definition at line 524 of file CcdPhysicsEnvironment.cpp.
References btOverlappingPairCache::cleanProxyFromPairs(), CcdPhysicsController::GetCollisionObject(), btCollisionWorld::getDispatcher(), btCollisionWorld::getPairCache(), and m_dynamicsWorld.
void CcdPhysicsEnvironment::removeCcdGraphicController | ( | CcdGraphicController * | ctrl | ) |
Definition at line 559 of file CcdPhysicsEnvironment.cpp.
References btDbvtBroadphase::destroyProxy(), CcdGraphicController::getBroadphaseHandle(), m_cullingTree, NULL, and CcdGraphicController::setBroadphaseHandle().
Referenced by CcdGraphicController::Activate(), and CcdGraphicController::~CcdGraphicController().
bool CcdPhysicsEnvironment::removeCcdPhysicsController | ( | CcdPhysicsController * | ctrl | ) |
Definition at line 423 of file CcdPhysicsEnvironment.cpp.
References CcdPhysicsController::GetCollisionObject(), btRigidBody::getConstraintRef(), btRigidBody::getNumConstraintRefs(), CcdPhysicsController::GetRigidBody(), CcdPhysicsController::GetSoftBody(), m_controllers, m_dynamicsWorld, CcdPhysicsController::m_registerCount, m_triggerControllers, btSoftRigidDynamicsWorld::removeCollisionObject(), btDiscreteDynamicsWorld::removeConstraint(), btRigidBody::removeConstraintRef(), btDiscreteDynamicsWorld::removeRigidBody(), and btSoftRigidDynamicsWorld::removeSoftBody().
Referenced by MergeEnvironment(), CcdPhysicsController::ReplaceControllerShape(), CcdPhysicsController::SetPhysicsEnvironment(), and CcdPhysicsController::~CcdPhysicsController().
bool CcdPhysicsEnvironment::removeCollisionCallback | ( | PHY_IPhysicsController * | ctrl | ) | [virtual] |
Implements PHY_IPhysicsEnvironment.
Definition at line 2077 of file CcdPhysicsEnvironment.cpp.
References CcdPhysicsController::Unregister().
void CcdPhysicsEnvironment::removeConstraint | ( | int | constraintid | ) | [virtual] |
Implements PHY_IPhysicsEnvironment.
Definition at line 961 of file CcdPhysicsEnvironment.cpp.
References btDiscreteDynamicsWorld::getConstraint(), btDiscreteDynamicsWorld::getNumConstraints(), btTypedConstraint::getRigidBodyA(), btTypedConstraint::getRigidBodyB(), btTypedConstraint::getUserConstraintId(), i, m_dynamicsWorld, and btDiscreteDynamicsWorld::removeConstraint().
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] |
Implements PHY_IPhysicsEnvironment.
Definition at line 1937 of file CcdPhysicsEnvironment.cpp.
References BT_LARGE_FLOAT, btGeneric6DofSpringConstraint::enableSpring(), btGeneric6DofConstraint::getRotationalLimitMotor(), btGeneric6DofConstraint::getTranslationalLimitMotor(), btTypedConstraint::getUserConstraintType(), btRotationalLimitMotor::m_enableMotor, btTranslationalLimitMotor::m_enableMotor, btRotationalLimitMotor::m_maxMotorForce, btTranslationalLimitMotor::m_maxMotorForce, btRotationalLimitMotor::m_targetVelocity, btTranslationalLimitMotor::m_targetVelocity, PHY_ANGULAR_CONSTRAINT, PHY_CONE_TWIST_CONSTRAINT, PHY_GENERIC_6DOF_CONSTRAINT, PHY_LINEHINGE_CONSTRAINT, btGeneric6DofSpringConstraint::setDamping(), btGeneric6DofSpringConstraint::setEquilibriumPoint(), btGeneric6DofConstraint::setLimit(), btConeTwistConstraint::setLimit(), and btGeneric6DofSpringConstraint::setStiffness().
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] |
Implements PHY_IPhysicsEnvironment.
Definition at line 890 of file CcdPhysicsEnvironment.cpp.
References btSoftRigidDynamicsWorld::getWorldInfo(), m_dynamicsWorld, btSoftBodyWorldInfo::m_gravity, and btDiscreteDynamicsWorld::setGravity().
Referenced by CcdPhysicsEnvironment().
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 | ||
) |
Definition at line 457 of file CcdPhysicsEnvironment.cpp.
References btDiscreteDynamicsWorld::addCollisionObject(), btDiscreteDynamicsWorld::addRigidBody(), btCollisionShape::calculateLocalInertia(), CcdPhysicsController::GetCollisionObject(), btRigidBody::getCollisionShape(), CcdPhysicsController::GetRigidBody(), CcdPhysicsController::m_cci, CcdConstructionInfo::m_collisionFilterGroup, CcdConstructionInfo::m_collisionFilterMask, CcdConstructionInfo::m_collisionFlags, m_dynamicsWorld, CcdConstructionInfo::m_mass, btSoftRigidDynamicsWorld::removeCollisionObject(), and btRigidBody::setMassProps().
friend class CcdOverlapFilterCallBack [friend] |
Definition at line 62 of file CcdPhysicsEnvironment.h.
Referenced by CcdPhysicsEnvironment().
class btBroadphaseInterface* CcdPhysicsEnvironment::m_broadphase [protected] |
Definition at line 69 of file CcdPhysicsEnvironment.h.
Referenced by CcdPhysicsEnvironment().
int CcdPhysicsEnvironment::m_ccdMode [protected] |
Definition at line 81 of file CcdPhysicsEnvironment.h.
Referenced by setCcdMode().
class btDefaultCollisionConfiguration* CcdPhysicsEnvironment::m_collisionConfiguration [protected] |
Definition at line 68 of file CcdPhysicsEnvironment.h.
Referenced by CcdPhysicsEnvironment().
std::set<CcdPhysicsController*> CcdPhysicsEnvironment::m_controllers [protected] |
Definition at line 261 of file CcdPhysicsEnvironment.h.
Referenced by addCcdPhysicsController(), disableCcdPhysicsController(), enableCcdPhysicsController(), MergeEnvironment(), proceedDeltaTime(), processFhSprings(), and removeCcdPhysicsController().
Definition at line 71 of file CcdPhysicsEnvironment.h.
Referenced by CcdPhysicsEnvironment().
struct btDbvtBroadphase* CcdPhysicsEnvironment::m_cullingTree [protected] |
Definition at line 72 of file CcdPhysicsEnvironment.h.
Referenced by addCcdGraphicController(), CcdPhysicsEnvironment(), getCullingTree(), and removeCcdGraphicController().
btIDebugDraw* CcdPhysicsEnvironment::m_debugDrawer [protected] |
Definition at line 66 of file CcdPhysicsEnvironment.h.
Referenced by CcdPhysicsEnvironment(), setDebugDrawer(), and setDebugMode().
class btSoftRigidDynamicsWorld* CcdPhysicsEnvironment::m_dynamicsWorld [protected] |
Definition at line 275 of file CcdPhysicsEnvironment.h.
Referenced by addCcdPhysicsController(), CcdPhysicsEnvironment(), createUniversalD6Constraint(), debugDrawWorld(), disableCcdPhysicsController(), enableCcdPhysicsController(), getDynamicsWorld(), getGravity(), proceedDeltaTime(), processFhSprings(), rayTest(), refreshCcdPhysicsController(), removeCcdPhysicsController(), removeConstraint(), setDebugDrawer(), setGravity(), and updateCcdPhysicsController().
bool CcdPhysicsEnvironment::m_enableSatCollisionDetection [protected] |
Definition at line 84 of file CcdPhysicsEnvironment.h.
Referenced by EnableSatCollisionDetection(), and IsSatCollisionDetectionEnabled().
class CcdOverlapFilterCallBack* CcdPhysicsEnvironment::m_filterCallback [protected] |
Definition at line 281 of file CcdPhysicsEnvironment.h.
Referenced by CcdPhysicsEnvironment().
int CcdPhysicsEnvironment::m_numIterations [protected] |
Definition at line 75 of file CcdPhysicsEnvironment.h.
Referenced by setNumIterations().
int CcdPhysicsEnvironment::m_numTimeSubSteps [protected] |
Definition at line 78 of file CcdPhysicsEnvironment.h.
Referenced by proceedDeltaTime(), and setNumTimeSubSteps().
class btDispatcher* CcdPhysicsEnvironment::m_ownDispatcher [protected] |
Definition at line 283 of file CcdPhysicsEnvironment.h.
Referenced by CcdPhysicsEnvironment().
class btOverlappingPairCache* CcdPhysicsEnvironment::m_ownPairCache [protected] |
Definition at line 279 of file CcdPhysicsEnvironment.h.
int CcdPhysicsEnvironment::m_profileTimings [protected] |
Definition at line 83 of file CcdPhysicsEnvironment.h.
bool CcdPhysicsEnvironment::m_scalingPropagated [protected] |
Definition at line 285 of file CcdPhysicsEnvironment.h.
class btConstraintSolver* CcdPhysicsEnvironment::m_solver [protected] |
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().
int CcdPhysicsEnvironment::m_solverType [protected] |
Definition at line 82 of file CcdPhysicsEnvironment.h.
Referenced by setSolverType().
PHY_ResponseCallback CcdPhysicsEnvironment::m_triggerCallbacks[PHY_NUM_RESPONSE] [protected] |
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.
std::set<CcdPhysicsController*> CcdPhysicsEnvironment::m_triggerControllers [protected] |
Definition at line 262 of file CcdPhysicsEnvironment.h.
Referenced by removeCcdPhysicsController().
std::vector<WrapperVehicle*> CcdPhysicsEnvironment::m_wrapperVehicles [protected] |
Definition at line 267 of file CcdPhysicsEnvironment.h.
Referenced by proceedDeltaTime().