Bullet Collision Detection & Physics Library
|
btConstraintSolverPoolMt - masquerades as a constraint solver, but really it is a threadsafe pool of them. More...
#include <btDiscreteDynamicsWorldMt.h>
Classes | |
struct | ThreadSolver |
Public Member Functions | |
btConstraintSolverPoolMt (int numSolvers) | |
btConstraintSolverPoolMt (btConstraintSolver **solvers, int numSolvers) | |
virtual | ~btConstraintSolverPoolMt () |
virtual btScalar | solveGroup (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifolds, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &info, btIDebugDraw *debugDrawer, btDispatcher *dispatcher) BT_OVERRIDE |
solve a group of constraints More... | |
virtual void | reset () BT_OVERRIDE |
clear internal cached data and reset random seed More... | |
virtual btConstraintSolverType | getSolverType () const BT_OVERRIDE |
Public Member Functions inherited from btConstraintSolver | |
virtual | ~btConstraintSolver () |
virtual void | prepareSolve (int, int) |
virtual btScalar | solveGroup (btCollisionObject **bodies, int numBodies, btPersistentManifold **manifold, int numManifolds, btTypedConstraint **constraints, int numConstraints, const btContactSolverInfo &info, class btIDebugDraw *debugDrawer, btDispatcher *dispatcher)=0 |
solve a group of constraints More... | |
virtual void | allSolved (const btContactSolverInfo &, class btIDebugDraw *) |
virtual void | reset ()=0 |
clear internal cached data and reset random seed More... | |
virtual btConstraintSolverType | getSolverType () const =0 |
Private Member Functions | |
ThreadSolver * | getAndLockThreadSolver () |
btConstraintSolverPoolMt More... | |
void | init (btConstraintSolver **solvers, int numSolvers) |
Private Attributes | |
btAlignedObjectArray< ThreadSolver > | m_solvers |
btConstraintSolverType | m_solverType |
Static Private Attributes | |
static const size_t | kCacheLineSize = 128 |
btConstraintSolverPoolMt - masquerades as a constraint solver, but really it is a threadsafe pool of them.
Each solver in the pool is protected by a mutex. When solveGroup is called from a thread, the pool looks for a solver that isn't being used by another thread, locks it, and dispatches the call to the solver. So long as there are at least as many solvers as there are hardware threads, it should never need to spin wait.
Definition at line 32 of file btDiscreteDynamicsWorldMt.h.
|
explicit |
Definition at line 87 of file btDiscreteDynamicsWorldMt.cpp.
btConstraintSolverPoolMt::btConstraintSolverPoolMt | ( | btConstraintSolver ** | solvers, |
int | numSolvers | ||
) |
Definition at line 100 of file btDiscreteDynamicsWorldMt.cpp.
|
virtual |
Definition at line 105 of file btDiscreteDynamicsWorldMt.cpp.
|
private |
Definition at line 53 of file btDiscreteDynamicsWorldMt.cpp.
|
inlinevirtual |
Implements btConstraintSolver.
Definition at line 55 of file btDiscreteDynamicsWorldMt.h.
|
private |
Definition at line 72 of file btDiscreteDynamicsWorldMt.cpp.
|
virtual |
clear internal cached data and reset random seed
Implements btConstraintSolver.
Definition at line 133 of file btDiscreteDynamicsWorldMt.cpp.
|
virtual |
solve a group of constraints
Implements btConstraintSolver.
Definition at line 117 of file btDiscreteDynamicsWorldMt.cpp.
|
staticprivate |
Definition at line 58 of file btDiscreteDynamicsWorldMt.h.
|
private |
Definition at line 65 of file btDiscreteDynamicsWorldMt.h.
|
private |
Definition at line 66 of file btDiscreteDynamicsWorldMt.h.