Skip to content
Snippets Groups Projects
Commit f8a41631 authored by vahrenkamp's avatar vahrenkamp
Browse files

Fixing units bug in dynamics simulator

git-svn-id: http://svn.code.sf.net/p/simox/code/trunk@332 042f3d55-54a8-47e9-b7fb-15903f145c44
parent cec54a31
No related branches found
No related tags found
No related merge requests found
......@@ -18,6 +18,8 @@ namespace SimDynamics
BulletCoinQtViewer::BulletCoinQtViewer(DynamicsWorldPtr world)
{
bulletMaxSubSteps = 10;
const float TIMER_MS = 30.0f;
SIMDYNAMICS_ASSERT(world);
......@@ -138,7 +140,7 @@ void BulletCoinQtViewer::stepPhysics()
bulletEngine->activateAllObjects(); // avoid sleeping objects
updateMotors(dt1);
bulletEngine->getBulletWorld()->stepSimulation(dt1,4);
bulletEngine->getBulletWorld()->stepSimulation(dt1,bulletMaxSubSteps);
//optional but useful: debug drawing
//m_dynamicsWorld->debugDrawWorld();
......@@ -251,4 +253,11 @@ void BulletCoinQtViewer::stopCB()
}
}
void BulletCoinQtViewer::setBulletSimMaxSubSteps(int n)
{
VR_ASSERT(n>=0);
bulletMaxSubSteps = n;
}
}
......@@ -73,6 +73,12 @@ public:
//! Stop callbacks
void stopCB();
/*!
Parameter that is passed to bulletstepSimulation.
Specifies how many sub steps should be performed. Higher value means better simulation but lower performance.
*/
void setBulletSimMaxSubSteps(int n);
protected:
......@@ -120,6 +126,8 @@ protected:
SoSeparator* sceneGraphRoot;
SoSeparator* floor;
SoSelection* sceneGraph;
int bulletMaxSubSteps;
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment