Blender V2.61 - r43446
|
#include <btSoftRigidDynamicsWorld.h>
Public Member Functions | |
btSoftRigidDynamicsWorld (btDispatcher *dispatcher, btBroadphaseInterface *pairCache, btConstraintSolver *constraintSolver, btCollisionConfiguration *collisionConfiguration, btSoftBodySolver *softBodySolver=0) | |
virtual | ~btSoftRigidDynamicsWorld () |
virtual void | debugDrawWorld () |
void | addSoftBody (btSoftBody *body, short int collisionFilterGroup=btBroadphaseProxy::DefaultFilter, short int collisionFilterMask=btBroadphaseProxy::AllFilter) |
void | removeSoftBody (btSoftBody *body) |
virtual void | removeCollisionObject (btCollisionObject *collisionObject) |
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btDiscreteDynamicsWorld::removeCollisionObject | |
int | getDrawFlags () const |
void | setDrawFlags (int f) |
btSoftBodyWorldInfo & | getWorldInfo () |
const btSoftBodyWorldInfo & | getWorldInfo () const |
btSoftBodyArray & | getSoftBodyArray () |
const btSoftBodyArray & | getSoftBodyArray () const |
virtual void | rayTest (const btVector3 &rayFromWorld, const btVector3 &rayToWorld, RayResultCallback &resultCallback) const |
virtual void | serialize (btSerializer *serializer) |
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see Bullet/Demos/SerializeDemo) | |
Static Public Member Functions | |
static void | rayTestSingle (const btTransform &rayFromTrans, const btTransform &rayToTrans, btCollisionObject *collisionObject, const btCollisionShape *collisionShape, const btTransform &colObjWorldTransform, RayResultCallback &resultCallback) |
Protected Member Functions | |
virtual void | predictUnconstraintMotion (btScalar timeStep) |
virtual void | internalSingleStepSimulation (btScalar timeStep) |
void | solveSoftBodiesConstraints (btScalar timeStep) |
void | serializeSoftBodies (btSerializer *serializer) |
Definition at line 26 of file btSoftRigidDynamicsWorld.h.
btSoftRigidDynamicsWorld::btSoftRigidDynamicsWorld | ( | btDispatcher * | dispatcher, |
btBroadphaseInterface * | pairCache, | ||
btConstraintSolver * | constraintSolver, | ||
btCollisionConfiguration * | collisionConfiguration, | ||
btSoftBodySolver * | softBodySolver = 0 |
||
) |
Definition at line 28 of file btSoftRigidDynamicsWorld.cpp.
References btSoftBodyWorldInfo::air_density, btAlignedAlloc, btSparseSdf< CELLSIZE >::Initialize(), btSoftBodyWorldInfo::m_broadphase, btSoftBodyWorldInfo::m_dispatcher, btSoftBodyWorldInfo::m_gravity, btSoftBodyWorldInfo::m_sparsesdf, btSparseSdf< CELLSIZE >::Reset(), fDrawFlags::Std, btSoftBodyWorldInfo::water_density, btSoftBodyWorldInfo::water_normal, and btSoftBodyWorldInfo::water_offset.
btSoftRigidDynamicsWorld::~btSoftRigidDynamicsWorld | ( | ) | [virtual] |
Definition at line 65 of file btSoftRigidDynamicsWorld.cpp.
References btAlignedFree, and btSoftBodySolver::~btSoftBodySolver().
void btSoftRigidDynamicsWorld::addSoftBody | ( | btSoftBody * | body, |
short int | collisionFilterGroup = btBroadphaseProxy::DefaultFilter , |
||
short int | collisionFilterMask = btBroadphaseProxy::AllFilter |
||
) |
Definition at line 128 of file btSoftRigidDynamicsWorld.cpp.
References btDiscreteDynamicsWorld::addCollisionObject(), btAlignedObjectArray< T >::push_back(), and btSoftBody::setSoftBodySolver().
Referenced by CcdPhysicsEnvironment::addCcdPhysicsController().
void btSoftRigidDynamicsWorld::debugDrawWorld | ( | ) | [virtual] |
Reimplemented from btDiscreteDynamicsWorld.
Definition at line 158 of file btSoftRigidDynamicsWorld.cpp.
References btIDebugDraw::DBG_DrawAabb, btIDebugDraw::DBG_DrawWireframe, btSoftBodyHelpers::Draw(), btSoftBodyHelpers::DrawClusterTree(), btSoftBodyHelpers::DrawFaceTree(), btSoftBodyHelpers::DrawFrame(), btSoftBodyHelpers::DrawNodeTree(), btCollisionWorld::getDebugDrawer(), btIDebugDraw::getDebugMode(), i, btCollisionWorld::m_debugDrawer, and btAlignedObjectArray< T >::size().
Referenced by CcdPhysicsEnvironment::debugDrawWorld().
int btSoftRigidDynamicsWorld::getDrawFlags | ( | ) | const [inline] |
Definition at line 64 of file btSoftRigidDynamicsWorld.h.
btSoftBodyArray& btSoftRigidDynamicsWorld::getSoftBodyArray | ( | ) | [inline] |
Definition at line 77 of file btSoftRigidDynamicsWorld.h.
Referenced by internalSingleStepSimulation().
const btSoftBodyArray& btSoftRigidDynamicsWorld::getSoftBodyArray | ( | ) | const [inline] |
Definition at line 82 of file btSoftRigidDynamicsWorld.h.
btSoftBodyWorldInfo& btSoftRigidDynamicsWorld::getWorldInfo | ( | ) | [inline] |
Definition at line 67 of file btSoftRigidDynamicsWorld.h.
Referenced by CcdPhysicsController::CreateSoftbody(), and CcdPhysicsEnvironment::setGravity().
const btSoftBodyWorldInfo& btSoftRigidDynamicsWorld::getWorldInfo | ( | ) | const [inline] |
Definition at line 71 of file btSoftRigidDynamicsWorld.h.
void btSoftRigidDynamicsWorld::internalSingleStepSimulation | ( | btScalar | timeStep | ) | [protected, virtual] |
solve soft bodies constraints
update soft bodies
Reimplemented from btDiscreteDynamicsWorld.
Definition at line 83 of file btSoftRigidDynamicsWorld.cpp.
References btAssert, btSoftBodySolver::checkInitialized(), btSoftBody::defaultCollisionHandler(), getSoftBodyArray(), i, btSoftBodySolver::optimize(), btAlignedObjectArray< T >::size(), solveSoftBodiesConstraints(), and btSoftBodySolver::updateSoftBodies().
void btSoftRigidDynamicsWorld::predictUnconstraintMotion | ( | btScalar | timeStep | ) | [protected, virtual] |
Reimplemented from btDiscreteDynamicsWorld.
Definition at line 74 of file btSoftRigidDynamicsWorld.cpp.
References BT_PROFILE, and btSoftBodySolver::predictMotion().
void btSoftRigidDynamicsWorld::rayTest | ( | const btVector3 & | rayFromWorld, |
const btVector3 & | rayToWorld, | ||
RayResultCallback & | resultCallback | ||
) | const [virtual] |
rayTest performs a raycast on all objects in the btCollisionWorld, and calls the resultCallback This allows for several queries: first hit, all hits, any hit, dependent on the value returned by the callback.
use the broadphase to accelerate the search for objects, based on their aabb and for each object with ray-aabb overlap, perform an exact ray test
use the broadphase to accelerate the search for objects, based on their aabb and for each object with ray-aabb overlap, perform an exact ray test
Reimplemented from btCollisionWorld.
Definition at line 264 of file btSoftRigidDynamicsWorld.cpp.
References BT_PROFILE, btCollisionWorld::getNumCollisionObjects(), i, btCollisionWorld::m_broadphasePairCache, btCollisionWorld::m_collisionObjects, btSoftSingleRayCallback::process(), and btBroadphaseInterface::rayTest().
Referenced by CcdPhysicsEnvironment::processFhSprings(), and CcdPhysicsEnvironment::rayTest().
void btSoftRigidDynamicsWorld::rayTestSingle | ( | const btTransform & | rayFromTrans, |
const btTransform & | rayToTrans, | ||
btCollisionObject * | collisionObject, | ||
const btCollisionShape * | collisionShape, | ||
const btTransform & | colObjWorldTransform, | ||
RayResultCallback & | resultCallback | ||
) | [static] |
rayTestSingle performs a raycast call and calls the resultCallback. It is used internally by rayTest. In a future implementation, we consider moving the ray test as a virtual method in btCollisionShape. This allows more customization.
Reimplemented from btCollisionWorld.
Definition at line 283 of file btSoftRigidDynamicsWorld.cpp.
References btCollisionWorld::RayResultCallback::addSingleResult(), btSoftBody::sRayCast::fraction, btTransform::getOrigin(), btSoftBody::sRayCast::index, btCollisionShape::isSoftBody(), btCollisionWorld::RayResultCallback::m_closestHitFraction, btSoftBody::m_faces, btCollisionWorld::LocalShapeInfo::m_shapePart, btCollisionWorld::LocalShapeInfo::m_triangleIndex, btSoftBody::rayTest(), and btSoftBody::upcast().
Referenced by btSoftSingleRayCallback::process().
void btSoftRigidDynamicsWorld::removeCollisionObject | ( | btCollisionObject * | collisionObject | ) | [virtual] |
removeCollisionObject will first check if it is a rigid body, if so call removeRigidBody otherwise call btDiscreteDynamicsWorld::removeCollisionObject
Reimplemented from btDiscreteDynamicsWorld.
Definition at line 149 of file btSoftRigidDynamicsWorld.cpp.
References removeSoftBody(), and btSoftBody::upcast().
Referenced by CcdPhysicsEnvironment::disableCcdPhysicsController(), CcdPhysicsEnvironment::removeCcdPhysicsController(), removeSoftBody(), and CcdPhysicsEnvironment::updateCcdPhysicsController().
void btSoftRigidDynamicsWorld::removeSoftBody | ( | btSoftBody * | body | ) |
Definition at line 142 of file btSoftRigidDynamicsWorld.cpp.
References btAlignedObjectArray< T >::remove(), and removeCollisionObject().
Referenced by CcdPhysicsEnvironment::removeCcdPhysicsController(), and removeCollisionObject().
void btSoftRigidDynamicsWorld::serialize | ( | btSerializer * | serializer | ) | [virtual] |
Preliminary serialization test for Bullet 2.76. Loading those files requires a separate parser (see Bullet/Demos/SerializeDemo)
Reimplemented from btDiscreteDynamicsWorld.
Definition at line 344 of file btSoftRigidDynamicsWorld.cpp.
References btSerializer::finishSerialization(), btCollisionWorld::serializeCollisionObjects(), btDiscreteDynamicsWorld::serializeRigidBodies(), serializeSoftBodies(), and btSerializer::startSerialization().
void btSoftRigidDynamicsWorld::serializeSoftBodies | ( | btSerializer * | serializer | ) | [protected] |
Definition at line 326 of file btSoftRigidDynamicsWorld.cpp.
References btSerializer::allocate(), BT_SOFTBODY_CODE, btSerializer::finalizeChunk(), i, len(), btCollisionWorld::m_collisionObjects, btChunk::m_oldPtr, and btAlignedObjectArray< T >::size().
Referenced by serialize().
void btSoftRigidDynamicsWorld::setDrawFlags | ( | int | f | ) | [inline] |
Definition at line 65 of file btSoftRigidDynamicsWorld.h.
void btSoftRigidDynamicsWorld::solveSoftBodiesConstraints | ( | btScalar | timeStep | ) | [protected] |
Definition at line 114 of file btSoftRigidDynamicsWorld.cpp.
References BT_PROFILE, btSoftBodySolver::getTimeScale(), btAlignedObjectArray< T >::size(), btSoftBody::solveClusters(), and btSoftBodySolver::solveConstraints().
Referenced by internalSingleStepSimulation().