Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions examples/ForkLift/ForkLiftDemo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ int forwardIndex = 2;
btVector3 wheelDirectionCS0(0, -1, 0);
btVector3 wheelAxleCS(-1, 0, 0);

bool useMCLPSolver = true;
bool useMLCPSolver = true;

#include <stdio.h> //printf debugging

Expand Down Expand Up @@ -322,7 +322,7 @@ void ForkLiftDemo::initPhysics()
btVector3 worldMin(-1000, -1000, -1000);
btVector3 worldMax(1000, 1000, 1000);
m_overlappingPairCache = new btAxisSweep3(worldMin, worldMax);
if (useMCLPSolver)
if (useMLCPSolver)
{
btDantzigSolver* mlcp = new btDantzigSolver();
//btSolveProjectedGaussSeidel* mlcp = new btSolveProjectedGaussSeidel;
Expand All @@ -334,7 +334,7 @@ void ForkLiftDemo::initPhysics()
m_constraintSolver = new btSequentialImpulseConstraintSolver();
}
m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher, m_overlappingPairCache, m_constraintSolver, m_collisionConfiguration);
if (useMCLPSolver)
if (useMLCPSolver)
{
m_dynamicsWorld->getSolverInfo().m_minimumSolverBatchSize = 1; //for direct solver it is better to have a small A matrix
}
Expand Down Expand Up @@ -867,11 +867,11 @@ bool ForkLiftDemo::keyboardCallback(int key, int state)
{
handled = true;
//switch solver (needs demo restart)
useMCLPSolver = !useMCLPSolver;
printf("switching to useMLCPSolver = %d\n", useMCLPSolver);
useMLCPSolver = !useMLCPSolver;
printf("switching to useMLCPSolver = %d\n", useMLCPSolver);

delete m_constraintSolver;
if (useMCLPSolver)
if (useMLCPSolver)
{
btDantzigSolver* mlcp = new btDantzigSolver();
//btSolveProjectedGaussSeidel* mlcp = new btSolveProjectedGaussSeidel;
Expand Down Expand Up @@ -1036,11 +1036,11 @@ void ForkLiftDemo::specialKeyboard(int key, int x, int y)
case GLUT_KEY_F6:
{
//switch solver (needs demo restart)
useMCLPSolver = !useMCLPSolver;
printf("switching to useMLCPSolver = %d\n", useMCLPSolver);
useMLCPSolver = !useMLCPSolver;
printf("switching to useMLCPSolver = %d\n", useMLCPSolver);

delete m_constraintSolver;
if (useMCLPSolver)
if (useMLCPSolver)
{
btDantzigSolver* mlcp = new btDantzigSolver();
//btSolveProjectedGaussSeidel* mlcp = new btSolveProjectedGaussSeidel;
Expand Down
12 changes: 6 additions & 6 deletions examples/Vehicles/Hinge2Vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ static btScalar maxMotorImpulse = 4000.f;
static btVector3 wheelDirectionCS0(0, -1, 0);
static btVector3 wheelAxleCS(-1, 0, 0);

static bool useMCLPSolver = false; //true;
static bool useMLCPSolver = false; //true;

#include <stdio.h> //printf debugging

Expand Down Expand Up @@ -262,7 +262,7 @@ void Hinge2Vehicle::initPhysics()
btVector3 worldMin(-1000, -1000, -1000);
btVector3 worldMax(1000, 1000, 1000);
m_broadphase = new btAxisSweep3(worldMin, worldMax);
if (useMCLPSolver)
if (useMLCPSolver)
{
btDantzigSolver* mlcp = new btDantzigSolver();
//btSolveProjectedGaussSeidel* mlcp = new btSolveProjectedGaussSeidel;
Expand All @@ -274,7 +274,7 @@ void Hinge2Vehicle::initPhysics()
m_solver = new btSequentialImpulseConstraintSolver();
}
m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher, m_broadphase, m_solver, m_collisionConfiguration);
if (useMCLPSolver)
if (useMLCPSolver)
{
m_dynamicsWorld->getSolverInfo().m_minimumSolverBatchSize = 1; //for direct solver it is better to have a small A matrix
}
Expand Down Expand Up @@ -545,11 +545,11 @@ bool Hinge2Vehicle::keyboardCallback(int key, int state)
{
handled = true;
//switch solver (needs demo restart)
useMCLPSolver = !useMCLPSolver;
printf("switching to useMLCPSolver = %d\n", useMCLPSolver);
useMLCPSolver = !useMLCPSolver;
printf("switching to useMLCPSolver = %d\n", useMLCPSolver);

delete m_solver;
if (useMCLPSolver)
if (useMLCPSolver)
{
btDantzigSolver* mlcp = new btDantzigSolver();
//btSolveProjectedGaussSeidel* mlcp = new btSolveProjectedGaussSeidel;
Expand Down