diff --git a/examples/CommonInterfaces/CommonRenderInterface.h b/examples/CommonInterfaces/CommonRenderInterface.h index 37787ab4b..d94d24650 100644 --- a/examples/CommonInterfaces/CommonRenderInterface.h +++ b/examples/CommonInterfaces/CommonRenderInterface.h @@ -9,6 +9,13 @@ enum B3_GL_POINTS }; +enum +{ + B3_INSTANCE_TRANSPARANCY = 1, + B3_INSTANCE_TEXTURE = 2, + B3_INSTANCE_DOUBLE_SIDED = 4, +}; + enum { B3_DEFAULT_RENDERMODE = 1, @@ -94,7 +101,8 @@ struct CommonRenderInterface virtual void writeSingleInstanceScaleToCPU(const double* scale, int srcIndex) = 0; virtual void writeSingleInstanceSpecularColorToCPU(const double* specular, int srcIndex) = 0; virtual void writeSingleInstanceSpecularColorToCPU(const float* specular, int srcIndex) = 0; - + virtual void writeSingleInstanceFlagsToCPU(int flags, int srcIndex) = 0; + virtual int getTotalNumInstances() const = 0; virtual void writeTransforms() = 0; diff --git a/examples/DeformableDemo/ClothFriction.cpp b/examples/DeformableDemo/ClothFriction.cpp index e62dab0d2..192769db4 100644 --- a/examples/DeformableDemo/ClothFriction.cpp +++ b/examples/DeformableDemo/ClothFriction.cpp @@ -75,10 +75,11 @@ public: { btSoftBody* psb = (btSoftBody*)deformableWorld->getSoftBodyArray()[i]; { - btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); - btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), deformableWorld->getDrawFlags()); + //btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); + btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), fDrawFlags::Faces);// deformableWorld->getDrawFlags()); } } + } }; diff --git a/examples/DeformableDemo/DeformableClothAnchor.cpp b/examples/DeformableDemo/DeformableClothAnchor.cpp index 49fd3184b..e7fe6484b 100644 --- a/examples/DeformableDemo/DeformableClothAnchor.cpp +++ b/examples/DeformableDemo/DeformableClothAnchor.cpp @@ -80,8 +80,8 @@ public: btSoftBody* psb = (btSoftBody*)deformableWorld->getSoftBodyArray()[i]; //if (softWorld->getDebugDrawer() && !(softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe))) { - btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); - btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), deformableWorld->getDrawFlags()); + //btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); + btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), fDrawFlags::Faces);// deformableWorld->getDrawFlags()); } } } diff --git a/examples/DeformableDemo/DeformableContact.cpp b/examples/DeformableDemo/DeformableContact.cpp index 8712d6de8..850bcebb2 100644 --- a/examples/DeformableDemo/DeformableContact.cpp +++ b/examples/DeformableDemo/DeformableContact.cpp @@ -70,16 +70,19 @@ public: virtual void renderScene() { CommonRigidBodyBase::renderScene(); - btDeformableMultiBodyDynamicsWorld* deformableWorld = getDeformableDynamicsWorld(); + + + btDeformableMultiBodyDynamicsWorld* deformableWorld = getDeformableDynamicsWorld(); for (int i = 0; i < deformableWorld->getSoftBodyArray().size(); i++) { btSoftBody* psb = (btSoftBody*)deformableWorld->getSoftBodyArray()[i]; { - btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); - btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), deformableWorld->getDrawFlags()); + //btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); + btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), fDrawFlags::Faces);// StddeformableWorld->getDrawFlags()); } } + } }; @@ -200,6 +203,10 @@ void DeformableContact::initPhysics() getDeformableDynamicsWorld()->setImplicit(false); getDeformableDynamicsWorld()->setLineSearch(false); m_guiHelper->autogenerateGraphicsObjects(m_dynamicsWorld); + int numInstances = m_guiHelper->getRenderInterface()->getTotalNumInstances(); + double rgbaColors[3][4] = { { 1, 0, 0, 1 } , { 0, 1, 0, 1 } ,{ 0, 0, 1, 1 } }; + + } void DeformableContact::exitPhysics() diff --git a/examples/DeformableDemo/DeformableMultibody.cpp b/examples/DeformableDemo/DeformableMultibody.cpp index 40db119b9..1274a3721 100644 --- a/examples/DeformableDemo/DeformableMultibody.cpp +++ b/examples/DeformableDemo/DeformableMultibody.cpp @@ -86,7 +86,7 @@ public: btSoftBody* psb = (btSoftBody*)deformableWorld->getSoftBodyArray()[i]; { btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); - btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), deformableWorld->getDrawFlags()); + btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), fDrawFlags::Faces);// deformableWorld->getDrawFlags()); } } } diff --git a/examples/DeformableDemo/DeformableRigid.cpp b/examples/DeformableDemo/DeformableRigid.cpp index 9a3ca9403..f6c087d2a 100644 --- a/examples/DeformableDemo/DeformableRigid.cpp +++ b/examples/DeformableDemo/DeformableRigid.cpp @@ -124,7 +124,7 @@ public: //if (softWorld->getDebugDrawer() && !(softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe))) { btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); - btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), deformableWorld->getDrawFlags()); + btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), fDrawFlags::Faces);// deformableWorld->getDrawFlags()); } } } diff --git a/examples/DeformableDemo/DeformableSelfCollision.cpp b/examples/DeformableDemo/DeformableSelfCollision.cpp index 6b1d92611..20caa45d5 100644 --- a/examples/DeformableDemo/DeformableSelfCollision.cpp +++ b/examples/DeformableDemo/DeformableSelfCollision.cpp @@ -79,7 +79,7 @@ public: btSoftBody* psb = (btSoftBody*)deformableWorld->getSoftBodyArray()[i]; { btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); - btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), deformableWorld->getDrawFlags()); + btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), fDrawFlags::Faces);// deformableWorld->getDrawFlags()); } } } diff --git a/examples/DeformableDemo/GraspDeformable.cpp b/examples/DeformableDemo/GraspDeformable.cpp index a1952169d..475fa9095 100644 --- a/examples/DeformableDemo/GraspDeformable.cpp +++ b/examples/DeformableDemo/GraspDeformable.cpp @@ -162,7 +162,7 @@ public: btSoftBody* psb = (btSoftBody*)deformableWorld->getSoftBodyArray()[i]; { btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); - btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), deformableWorld->getDrawFlags()); + btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), fDrawFlags::Faces);// deformableWorld->getDrawFlags()); } } } diff --git a/examples/DeformableDemo/MultibodyClothAnchor.cpp b/examples/DeformableDemo/MultibodyClothAnchor.cpp index eeeb4d33c..ba90a9e20 100644 --- a/examples/DeformableDemo/MultibodyClothAnchor.cpp +++ b/examples/DeformableDemo/MultibodyClothAnchor.cpp @@ -81,7 +81,7 @@ public: //if (softWorld->getDebugDrawer() && !(softWorld->getDebugDrawer()->getDebugMode() & (btIDebugDraw::DBG_DrawWireframe))) { btSoftBodyHelpers::DrawFrame(psb, deformableWorld->getDebugDrawer()); - btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), deformableWorld->getDrawFlags()); + btSoftBodyHelpers::Draw(psb, deformableWorld->getDebugDrawer(), fDrawFlags::Faces);// deformableWorld->getDrawFlags()); } } } diff --git a/examples/ExampleBrowser/OpenGLGuiHelper.cpp b/examples/ExampleBrowser/OpenGLGuiHelper.cpp index eecf94df6..6f4b7686f 100644 --- a/examples/ExampleBrowser/OpenGLGuiHelper.cpp +++ b/examples/ExampleBrowser/OpenGLGuiHelper.cpp @@ -1433,6 +1433,11 @@ void OpenGLGuiHelper::autogenerateGraphicsObjects(btDiscreteDynamicsWorld* rbWor color.setValue(1, 1, 1, 1); } createCollisionObjectGraphicsObject(colObj, color); + if (sb) + { + int graphicsInstanceId = colObj->getUserIndex(); + changeInstanceFlags(graphicsInstanceId, B3_INSTANCE_DOUBLE_SIDED); + } } } diff --git a/examples/OpenGLWindow/GLInstancingRenderer.cpp b/examples/OpenGLWindow/GLInstancingRenderer.cpp index 809d87b1f..e27547839 100644 --- a/examples/OpenGLWindow/GLInstancingRenderer.cpp +++ b/examples/OpenGLWindow/GLInstancingRenderer.cpp @@ -139,11 +139,7 @@ static InternalDataRenderer* sData2; GLint lineWidthRange[2] = {1, 1}; -enum -{ - eGfxTransparency = 1, - eGfxHasTexture = 2, -}; + struct b3GraphicsInstance { @@ -492,6 +488,26 @@ void GLInstancingRenderer::readSingleInstanceTransformFromCPU(int srcIndex2, flo orientation[2] = m_data->m_instance_quaternion_ptr[srcIndex * 4 + 2]; orientation[3] = m_data->m_instance_quaternion_ptr[srcIndex * 4 + 3]; } + +void GLInstancingRenderer::writeSingleInstanceFlagsToCPU(int flags, int srcIndex2) +{ + b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); + b3Assert(pg); + int srcIndex = pg->m_internalInstanceIndex; + + int shapeIndex = pg->m_shapeIndex; + b3GraphicsInstance* gfxObj = m_graphicsInstances[shapeIndex]; + if (flags & B3_INSTANCE_DOUBLE_SIDED) + { + gfxObj->m_flags |= B3_INSTANCE_DOUBLE_SIDED; + } + else + { + gfxObj->m_flags &= ~B3_INSTANCE_DOUBLE_SIDED; + } +} + + void GLInstancingRenderer::writeSingleInstanceColorToCPU(const double* color, int srcIndex2) { b3PublicGraphicsInstance* pg = m_data->m_publicGraphicsInstances.getHandle(srcIndex2); @@ -502,11 +518,11 @@ void GLInstancingRenderer::writeSingleInstanceColorToCPU(const double* color, in b3GraphicsInstance* gfxObj = m_graphicsInstances[shapeIndex]; if (color[3] < 1) { - gfxObj->m_flags |= eGfxTransparency; + gfxObj->m_flags |= B3_INSTANCE_TRANSPARANCY; } else { - gfxObj->m_flags &= ~eGfxTransparency; + gfxObj->m_flags &= ~B3_INSTANCE_TRANSPARANCY; } m_data->m_instance_colors_ptr[srcIndex * 4 + 0] = float(color[0]); @@ -525,11 +541,11 @@ void GLInstancingRenderer::writeSingleInstanceColorToCPU(const float* color, int if (color[3] < 1) { - gfxObj->m_flags |= eGfxTransparency; + gfxObj->m_flags |= B3_INSTANCE_TRANSPARANCY; } else { - gfxObj->m_flags &= ~eGfxTransparency; + gfxObj->m_flags &= ~B3_INSTANCE_TRANSPARANCY; } m_data->m_instance_colors_ptr[srcIndex * 4 + 0] = color[0]; @@ -916,7 +932,7 @@ int GLInstancingRenderer::registerGraphicsInstanceInternal(int newUid, const flo if (color[3] < 1 && color[3] > 0) { - gfxObj->m_flags |= eGfxTransparency; + gfxObj->m_flags |= B3_INSTANCE_TRANSPARANCY; } gfxObj->m_numGraphicsInstances++; m_data->m_totalNumInstances++; @@ -1018,11 +1034,11 @@ void GLInstancingRenderer::replaceTexture(int shapeIndex, int textureId) if (textureId >= 0 && textureId < m_data->m_textureHandles.size()) { gfxObj->m_textureIndex = textureId; - gfxObj->m_flags |= eGfxHasTexture; + gfxObj->m_flags |= B3_INSTANCE_TEXTURE; } else { gfxObj->m_textureIndex = -1; - gfxObj->m_flags &= ~eGfxHasTexture; + gfxObj->m_flags &= ~B3_INSTANCE_TEXTURE; } } } @@ -1110,7 +1126,7 @@ int GLInstancingRenderer::registerShape(const float* vertices, int numvertices, if (textureId >= 0) { gfxObj->m_textureIndex = textureId; - gfxObj->m_flags |= eGfxHasTexture; + gfxObj->m_flags |= B3_INSTANCE_TEXTURE; } gfxObj->m_primitiveType = primitiveType; @@ -1754,6 +1770,7 @@ static void b3CreateLookAt(const b3Vector3& eye, const b3Vector3& center, const result[3 * 4 + 3] = 1.f; } + void GLInstancingRenderer::drawTexturedTriangleMesh(float worldPosition[3], float worldOrientation[4], const float* vertices, int numvertices, const unsigned int* indices, int numIndices, float colorRGBA[4], int textureIndex, int vertexLayout) { int sz = sizeof(GfxVertexFormat0); @@ -2263,7 +2280,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) inst.m_shapeIndex = obj; - if ((gfxObj->m_flags & eGfxTransparency) == 0) + if ((gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) == 0) { inst.m_instanceId = curOffset; b3Vector3 centerPosition; @@ -2313,10 +2330,10 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) b3GraphicsInstance* gfxObj = m_graphicsInstances[shapeIndex]; //only draw stuff (opaque/transparent) if it is the right pass - int drawThisPass = (pass == 0) == ((gfxObj->m_flags & eGfxTransparency) == 0); + int drawThisPass = (pass == 0) == ((gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) == 0); //transparent objects don't cast shadows (to simplify things) - if (gfxObj->m_flags & eGfxTransparency) + if (gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) { if (renderMode == B3_CREATE_SHADOWMAP_RENDERMODE) drawThisPass = 0; @@ -2326,7 +2343,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) { glActiveTexture(GL_TEXTURE0); GLuint curBindTexture = 0; - if (gfxObj->m_flags & eGfxHasTexture) + if (gfxObj->m_flags & B3_INSTANCE_TEXTURE) { curBindTexture = m_data->m_textureHandles[gfxObj->m_textureIndex].m_glTexture; @@ -2432,6 +2449,11 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) } else { + if (gfxObj->m_flags & B3_INSTANCE_DOUBLE_SIDED) + { + glDisable(GL_CULL_FACE); + } + switch (renderMode) { case B3_SEGMENTATION_MASK_RENDERMODE: @@ -2445,7 +2467,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) } case B3_DEFAULT_RENDERMODE: { - if (gfxObj->m_flags & eGfxTransparency) + if (gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) { glDepthMask(false); glEnable(GL_BLEND); @@ -2462,7 +2484,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) glUniform1i(uniform_texture_diffuse, 0); - if (gfxObj->m_flags & eGfxTransparency) + if (gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) { int instanceId = transparentInstances[i].m_instanceId; glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 0, (GLvoid*)((instanceId)*4 * sizeof(float) + m_data->m_maxShapeCapacityInBytes)); @@ -2477,7 +2499,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) glDrawElementsInstanced(GL_TRIANGLES, indexCount, GL_UNSIGNED_INT, indexOffset, gfxObj->m_numGraphicsInstances); } - if (gfxObj->m_flags & eGfxTransparency) + if (gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) { glDisable(GL_BLEND); glDepthMask(true); @@ -2495,7 +2517,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) case B3_USE_SHADOWMAP_RENDERMODE: { - if (gfxObj->m_flags & eGfxTransparency) + if (gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) { glDepthMask(false); glEnable(GL_BLEND); @@ -2549,7 +2571,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) //gfxObj->m_instanceOffset - if (gfxObj->m_flags & eGfxTransparency) + if (gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) { int instanceId = transparentInstances[i].m_instanceId; glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 0, (GLvoid*)((instanceId)*4 * sizeof(float) + m_data->m_maxShapeCapacityInBytes)); @@ -2563,7 +2585,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) glDrawElementsInstanced(GL_TRIANGLES, indexCount, GL_UNSIGNED_INT, indexOffset, gfxObj->m_numGraphicsInstances); } - if (gfxObj->m_flags & eGfxTransparency) + if (gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) { glDisable(GL_BLEND); glDepthMask(true); @@ -2577,7 +2599,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) } case B3_USE_PROJECTIVE_TEXTURE_RENDERMODE: { - if (gfxObj->m_flags & eGfxTransparency) + if (gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) { glDepthMask(false); glEnable(GL_BLEND); @@ -2617,7 +2639,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) glUniformMatrix4fv(projectiveTexture_TextureMVP, 1, false, &textureMVP[0]); //sort transparent objects - if (gfxObj->m_flags & eGfxTransparency) + if (gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) { int instanceId = transparentInstances[i].m_instanceId; glVertexAttribPointer(1, 4, GL_FLOAT, GL_FALSE, 0, (GLvoid*)((instanceId)*4 * sizeof(float) + m_data->m_maxShapeCapacityInBytes)); @@ -2631,7 +2653,7 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) glDrawElementsInstanced(GL_TRIANGLES, indexCount, GL_UNSIGNED_INT, indexOffset, gfxObj->m_numGraphicsInstances); } - if (gfxObj->m_flags & eGfxTransparency) + if (gfxObj->m_flags & B3_INSTANCE_TRANSPARANCY) { glDisable(GL_BLEND); glDepthMask(true); @@ -2646,6 +2668,10 @@ void GLInstancingRenderer::renderSceneInternal(int orgRenderMode) // b3Assert(0); } }; + if (gfxObj->m_flags & B3_INSTANCE_DOUBLE_SIDED) + { + glEnable(GL_CULL_FACE); + } } //glDrawElementsInstanced(GL_LINE_LOOP, indexCount, GL_UNSIGNED_INT, (void*)indexOffset, gfxObj->m_numGraphicsInstances); diff --git a/examples/OpenGLWindow/GLInstancingRenderer.h b/examples/OpenGLWindow/GLInstancingRenderer.h index 821da5263..b6ef85250 100644 --- a/examples/OpenGLWindow/GLInstancingRenderer.h +++ b/examples/OpenGLWindow/GLInstancingRenderer.h @@ -95,6 +95,7 @@ public: virtual void writeSingleInstanceColorToCPU(const float* color, int srcIndex); virtual void writeSingleInstanceColorToCPU(const double* color, int srcIndex); + virtual void writeSingleInstanceFlagsToCPU(int flags, int srcIndex2); virtual void writeSingleInstanceSpecularColorToCPU(const double* specular, int srcIndex2); virtual void writeSingleInstanceSpecularColorToCPU(const float* specular, int srcIndex2); diff --git a/examples/OpenGLWindow/SimpleOpenGL2Renderer.h b/examples/OpenGLWindow/SimpleOpenGL2Renderer.h index 320184d7c..d328c3cd5 100644 --- a/examples/OpenGLWindow/SimpleOpenGL2Renderer.h +++ b/examples/OpenGLWindow/SimpleOpenGL2Renderer.h @@ -40,7 +40,7 @@ public: virtual void writeSingleInstanceScaleToCPU(const double* scale, int srcIndex); virtual void writeSingleInstanceSpecularColorToCPU(const double* specular, int srcIndex) {} virtual void writeSingleInstanceSpecularColorToCPU(const float* specular, int srcIndex) {} - + virtual void writeSingleInstanceFlagsToCPU(int flags, int srcIndex) {} virtual void getCameraViewMatrix(float viewMat[16]) const; virtual void getCameraProjectionMatrix(float projMat[16]) const; virtual void drawTexturedTriangleMesh(float worldPosition[3], float worldOrientation[4], const float* vertices, int numvertices, const unsigned int* indices, int numIndices, float color[4], int textureIndex = -1, int vertexLayout = 0) diff --git a/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp b/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp index 3eb7248b3..f16786e16 100644 --- a/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp +++ b/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.cpp @@ -378,6 +378,22 @@ void btDeformableMultiBodyDynamicsWorld::reinitialize(btScalar timeStep) btMultiBodyDynamicsWorld::getSolverInfo().m_timeStep = timeStep; } + +void btDeformableMultiBodyDynamicsWorld::debugDrawWorld() +{ + + for (int i = 0; i < getSoftBodyArray().size(); i++) + { + btSoftBody* psb = (btSoftBody*)getSoftBodyArray()[i]; + { + btSoftBodyHelpers::DrawFrame(psb, getDebugDrawer()); + btSoftBodyHelpers::Draw(psb, getDebugDrawer(), getDrawFlags()); + } + } + + btMultiBodyDynamicsWorld::debugDrawWorld(); +} + void btDeformableMultiBodyDynamicsWorld::applyRigidBodyGravity(btScalar timeStep) { // Gravity is applied in stepSimulation and then cleared here and then applied here and then cleared here again diff --git a/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.h b/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.h index d00183504..9fbebd6ed 100644 --- a/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.h +++ b/src/BulletSoftBody/btDeformableMultiBodyDynamicsWorld.h @@ -93,7 +93,9 @@ public: } virtual int stepSimulation(btScalar timeStep, int maxSubSteps = 1, btScalar fixedTimeStep = btScalar(1.) / btScalar(60.)); - + + virtual void debugDrawWorld(); + void setSolverCallback(btSolverCallback cb) { m_solverCallback = cb; @@ -178,6 +180,7 @@ public: { m_lineSearch = lineSearch; } + }; #endif //BT_DEFORMABLE_MULTIBODY_DYNAMICS_WORLD_H