From 034dfba3ae30808c8b0f7edc334777fe0c070e13 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Wed, 16 May 2018 14:24:12 -0700 Subject: [PATCH] fix VR controllers only visible in one eye (remove stray glClear for testing planar reflection) PyBullet: force both contactStiffness and contactDamping (report error otherwise) --- examples/OpenGLWindow/GLInstancingRenderer.cpp | 2 +- examples/OpenGLWindow/Win32OpenGLWindow.cpp | 6 +++--- examples/pybullet/pybullet.c | 6 ++++++ 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/examples/OpenGLWindow/GLInstancingRenderer.cpp b/examples/OpenGLWindow/GLInstancingRenderer.cpp index 26d765536..1a66c32df 100644 --- a/examples/OpenGLWindow/GLInstancingRenderer.cpp +++ b/examples/OpenGLWindow/GLInstancingRenderer.cpp @@ -1618,7 +1618,7 @@ void GLInstancingRenderer::renderScene() { renderSceneInternal(B3_CREATE_SHADOWMAP_RENDERMODE); - glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); + if (m_planeReflectionShapeIndex>=0) { diff --git a/examples/OpenGLWindow/Win32OpenGLWindow.cpp b/examples/OpenGLWindow/Win32OpenGLWindow.cpp index 28eab35cb..aa71750ad 100644 --- a/examples/OpenGLWindow/Win32OpenGLWindow.cpp +++ b/examples/OpenGLWindow/Win32OpenGLWindow.cpp @@ -119,9 +119,9 @@ void Win32OpenGLWindow::closeWindow() void Win32OpenGLWindow::startRendering() { pumpMessage(); - //don't clear all 3 buffers because some AMD drivers are buggy - //glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT|GL_STENCIL_BUFFER_BIT); + //glCullFace(GL_BACK); diff --git a/examples/pybullet/pybullet.c b/examples/pybullet/pybullet.c index 4e0785021..1fae95a6d 100644 --- a/examples/pybullet/pybullet.c +++ b/examples/pybullet/pybullet.c @@ -937,6 +937,12 @@ static PyObject* pybullet_changeDynamicsInfo(PyObject* self, PyObject* args, PyO return NULL; } + if ((contactStiffness>=0 && contactDamping <0)||(contactStiffness<0 && contactDamping >=0)) + { + PyErr_SetString(SpamError, "Both contactStiffness and contactDamping needs to be set together."); + return NULL; + } + { b3SharedMemoryCommandHandle command = b3InitChangeDynamicsInfo(sm); b3SharedMemoryStatusHandle statusHandle;