Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp')
-rw-r--r--extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp b/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp
index 885304983a6..5b6db434f8b 100644
--- a/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp
+++ b/extern/bullet/Extras/PhysicsInterface/CcdPhysics/CcdPhysicsEnvironment.cpp
@@ -33,7 +33,7 @@ bool useIslands = true;
//#include "BroadphaseCollision/QueryBox.h"
//todo: change this to allow dynamic registration of types!
-unsigned long gNumIterations = 1;
+unsigned long gNumIterations = 10;
#ifdef WIN32
void DrawRasterizerLine(const float* from,const float* to,int color);
@@ -366,6 +366,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
//contacts
+
m_dispatcher->SolveConstraints(timeStep, gNumIterations ,numRigidBodies,m_debugDrawer);
for (int g=0;g<numsubstep;g++)
@@ -438,7 +439,7 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
#ifdef WIN32
SimdVector3 color (1,0,0);
- if (0)//m_debugDrawer)
+ if (m_debugDrawer)
{
//draw aabb
@@ -540,6 +541,29 @@ bool CcdPhysicsEnvironment::proceedDeltaTime(double curTime,float timeStep)
return true;
}
+void CcdPhysicsEnvironment::setDebugMode(int debugMode)
+{
+ if (debugMode > 10)
+ {
+ if (m_dispatcher)
+ delete m_dispatcher;
+
+ if (debugMode == 11)
+ {
+ SimpleConstraintSolver* solver= new SimpleConstraintSolver();
+ m_dispatcher = new ToiContactDispatcher(solver);
+ } else
+ {
+ OdeConstraintSolver* solver = new OdeConstraintSolver();
+ m_dispatcher = new ToiContactDispatcher(solver);
+ }
+ }
+ if (m_debugDrawer){
+ m_debugDrawer->SetDebugMode(debugMode);
+ }
+}
+
+
void CcdPhysicsEnvironment::SyncMotionStates(float timeStep)
{
std::vector<CcdPhysicsController*>::iterator i;