Skip to content

Commit

Permalink
Improved URDF support for btMultiBody and separate graphics/collision…
Browse files Browse the repository at this point in the history
…/inertial frames and shapes

Fix WinXP GetTickCount64 with a typedef
Expose debug drawing mode/flags in UI (hot keys A,D,L,W for now, buttons later)
GLInstancingRenderer: tweak near/far planes to allow closer approach of camera
btDiscreteDynamicsWorld: enable debug drawing for btGeneric6DofSpring2Constraint
btMultiBodyDynamicsWorld: enable basic debug drawing for btMultiBody
btMultibody: allow center-of-mass shift for prismatic and fixed constraint
  • Loading branch information
erwincoumans committed Jan 23, 2015
1 parent 6e70f28 commit a159fba
Show file tree
Hide file tree
Showing 28 changed files with 1,018 additions and 670 deletions.
26 changes: 23 additions & 3 deletions Demos3/AllBullet2Demos/main.cpp
Expand Up @@ -234,9 +234,10 @@ extern bool useShadowMap;
static bool visualWireframe=false;
static bool renderVisualGeometry=true;
static bool renderGrid = true;

static bool pauseSimulation=false;//true;
int gDebugDrawFlags = 0;
static bool pauseSimulation=true;
int midiBaseIndex = 176;
extern bool gDisableDeactivation;

//#include <float.h>
//unsigned int fp_control_state = _controlfp(_EM_INEXACT, _MCW_EM);
Expand Down Expand Up @@ -268,9 +269,28 @@ void MyKeyboardCallback(int key, int state)
//if (handled)
// return;

if (key=='a' && state)
{
gDebugDrawFlags ^= btIDebugDraw::DBG_DrawAabb;
}
if (key=='c' && state)
{
gDebugDrawFlags ^= btIDebugDraw::DBG_DrawConstraints;
gDebugDrawFlags ^= btIDebugDraw::DBG_DrawContactPoints;
}
if (key == 'd' && state)
{
gDebugDrawFlags ^= btIDebugDraw::DBG_NoDeactivation;
gDisableDeactivation = ((gDebugDrawFlags & btIDebugDraw::DBG_NoDeactivation) != 0);
}
if (key=='l' && state)
{
gDebugDrawFlags ^= btIDebugDraw::DBG_DrawConstraintLimits;
}
if (key=='w' && state)
{
visualWireframe=!visualWireframe;
gDebugDrawFlags ^= btIDebugDraw::DBG_DrawWireframe;
}
if (key=='v' && state)
{
Expand Down Expand Up @@ -792,7 +812,7 @@ int main(int argc, char* argv[])
}
{
glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
sCurrentDemo->physicsDebugDraw();
sCurrentDemo->physicsDebugDraw(gDebugDrawFlags);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Demos3/FiniteElementMethod/FiniteElementDemo.cpp
Expand Up @@ -317,7 +317,7 @@ void FiniteElementDemo::renderScene()
m_app->m_renderer->renderScene();
}

void FiniteElementDemo::physicsDebugDraw()
void FiniteElementDemo::physicsDebugDraw(int debugDrawFlags)
{
{
btAlignedObjectArray<btVector3FloatData> m_linePoints;
Expand Down
2 changes: 1 addition & 1 deletion Demos3/FiniteElementMethod/FiniteElementDemo.h
Expand Up @@ -50,7 +50,7 @@ class FiniteElementDemo : public BulletDemoInterface
virtual void renderScene();


virtual void physicsDebugDraw();
virtual void physicsDebugDraw(int debugDrawFlags);
virtual bool mouseMoveCallback(float x,float y);
virtual bool mouseButtonCallback(int button, int state, float x, float y);
virtual bool keyboardCallback(int key, int state);
Expand Down
2 changes: 1 addition & 1 deletion Demos3/Geometry/DistributePoints.h
Expand Up @@ -181,7 +181,7 @@ class DistributePoints : public BulletDemoInterface


}
virtual void physicsDebugDraw()
virtual void physicsDebugDraw(int debugDrawFlags)
{

int lineWidth = 1;
Expand Down
2 changes: 1 addition & 1 deletion Demos3/Geometry/SphereCreation.h
Expand Up @@ -168,7 +168,7 @@ class SphereCreation : public BulletDemoInterface
m_app->m_renderer->renderScene();

}
virtual void physicsDebugDraw()
virtual void physicsDebugDraw(int debugDrawFlags)
{
int lineWidth = 1;
int pointSize = 2;
Expand Down

0 comments on commit a159fba

Please sign in to comment.