allow to enable/disable GUI, shadows, wireframe of OpenGL Visualizer from API

(pybullet.configureDebugVisualizer)
This commit is contained in:
Erwin Coumans
2017-02-21 17:36:54 -08:00
parent 5c74b0a199
commit 37890e5a4d
14 changed files with 183 additions and 7 deletions

View File

@@ -125,10 +125,10 @@ bool sUseOpenGL2 = false;
extern bool useShadowMap;
#endif
static bool visualWireframe=false;
bool visualWireframe=false;
static bool renderVisualGeometry=true;
static bool renderGrid = true;
static bool renderGui = true;
bool renderGui = true;
static bool enable_experimental_opencl = false;
int gDebugDrawFlags = 0;

View File

@@ -374,6 +374,30 @@ void OpenGLGuiHelper::setUpAxis(int axis)
}
extern bool useShadowMap;
extern bool visualWireframe;
extern bool renderGui;
#include "../SharedMemory/SharedMemoryPublic.h"
void OpenGLGuiHelper::setVisualizerFlag(int flag, int enable)
{
//temporary direct access
if (flag == COV_ENABLE_SHADOWS)
{
useShadowMap = enable;
}
if (flag == COV_ENABLE_GUI)
{
renderGui = enable;
}
if (flag == COV_ENABLE_WIREFRAME)
{
visualWireframe = enable;
}
}
void OpenGLGuiHelper::resetCamera(float camDist, float pitch, float yaw, float camPosX,float camPosY, float camPosZ)
{
if (getRenderInterface() && getRenderInterface()->getActiveCamera())

View File

@@ -42,6 +42,8 @@ struct OpenGLGuiHelper : public GUIHelperInterface
virtual void setUpAxis(int axis);
void setVisualizerFlag(int flag, int enable);
virtual void resetCamera(float camDist, float pitch, float yaw, float camPosX,float camPosY, float camPosZ);
virtual void copyCameraImageData(const float viewMatrix[16], const float projectionMatrix[16],