From 18924135e093dfcdf02d3861c8bbf03659c089a2 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Wed, 2 Sep 2020 23:00:15 +0200 Subject: [PATCH 1/4] Remove some code --- src/engine/PhysicsWorld.cpp | 9 --------- src/systems/CollisionDetectionSystem.cpp | 2 -- 2 files changed, 11 deletions(-) diff --git a/src/engine/PhysicsWorld.cpp b/src/engine/PhysicsWorld.cpp index fc59195d..ec9645ad 100644 --- a/src/engine/PhysicsWorld.cpp +++ b/src/engine/PhysicsWorld.cpp @@ -880,15 +880,6 @@ void PhysicsWorld::createIslands() { } } - for (uint32 i=0; i < (*mCollisionDetection.mCurrentContactPairs).size(); i++) { - - ContactPair& contactPair = (*mCollisionDetection.mCurrentContactPairs)[i]; - - if (mRigidBodyComponents.hasComponent(contactPair.body1Entity) && mRigidBodyComponents.hasComponent(contactPair.body2Entity)) { - - } - } - mCollisionDetection.mMapBodyToContactPairs.clear(true); } diff --git a/src/systems/CollisionDetectionSystem.cpp b/src/systems/CollisionDetectionSystem.cpp index b794b32d..924d1457 100644 --- a/src/systems/CollisionDetectionSystem.cpp +++ b/src/systems/CollisionDetectionSystem.cpp @@ -732,8 +732,6 @@ void CollisionDetectionSystem::createContacts() { uint32 contactPairIndex = mWorld->mProcessContactPairsOrderIslands[p]; - processedContactPairsIndices.add(contactPairIndex); - ContactPair& contactPair = (*mCurrentContactPairs)[contactPairIndex]; contactPair.contactManifoldsIndex = mCurrentContactManifolds->size(); From 264705056e95a6d9e5b935af30a8f387132eccf1 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Mon, 9 Nov 2020 22:47:17 +0100 Subject: [PATCH 2/4] =?UTF-8?q?Fix=20issue=20when=20building=20the=20testb?= =?UTF-8?q?ed=20application=20on=20MacOS=C2=A0X?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- testbed/CMakeLists.txt | 1 + testbed/src/TestbedApplication.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/testbed/CMakeLists.txt b/testbed/CMakeLists.txt index ffb813c5..80b3a0c3 100755 --- a/testbed/CMakeLists.txt +++ b/testbed/CMakeLists.txt @@ -8,6 +8,7 @@ project(Testbed) set(NANOGUI_BUILD_EXAMPLES OFF CACHE BOOL " " FORCE) set(NANOGUI_BUILD_PYTHON OFF CACHE BOOL " " FORCE) set(NANOGUI_INSTALL OFF CACHE BOOL " " FORCE) +set(NANOGUI_BACKEND OpenGL CACHE BOOL " " FORCE) # ---- Make sure to recursively clone all the git submodules for external libraries (nanogui) --- # find_package(Git QUIET) diff --git a/testbed/src/TestbedApplication.cpp b/testbed/src/TestbedApplication.cpp index 34ddab7f..49c5d000 100755 --- a/testbed/src/TestbedApplication.cpp +++ b/testbed/src/TestbedApplication.cpp @@ -95,12 +95,15 @@ void TestbedApplication::init() { glGetIntegerv(GL_MAJOR_VERSION, &glMajorVersion); glGetIntegerv(GL_MINOR_VERSION, &glMinorVersion); +#ifdef GL_DEBUG_OUTPUT + if (glMajorVersion > 4 || (glMajorVersion == 4 && glMinorVersion >= 3)) { // Enable OpenGL error reporting glEnable(GL_DEBUG_OUTPUT); glDebugMessageCallback(onOpenGLError, 0); } +#endif mIsInitialized = true; } @@ -307,6 +310,7 @@ void TestbedApplication::notifyEngineSetttingsChanged() { void GLAPIENTRY TestbedApplication::onOpenGLError(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, const void* userParam ) { +#ifdef GL_DEBUG_OUTPUT if (type == GL_DEBUG_TYPE_ERROR) { /* fprintf( stderr, "GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s\n", @@ -314,6 +318,8 @@ void GLAPIENTRY TestbedApplication::onOpenGLError(GLenum source, GLenum type, GL type, severity, message ); */ } +#endif + } // Compute the FPS From cc63f7c0a10b61a16beff33d340650697da08355 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Wed, 25 Nov 2020 22:20:40 +0100 Subject: [PATCH 3/4] Fix issue 179 in FixedJoint --- src/systems/SolveFixedJointSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/systems/SolveFixedJointSystem.cpp b/src/systems/SolveFixedJointSystem.cpp index 7143bb43..42f33a5e 100644 --- a/src/systems/SolveFixedJointSystem.cpp +++ b/src/systems/SolveFixedJointSystem.cpp @@ -454,7 +454,7 @@ void SolveFixedJointSystem::solvePositionConstraint() { // Compute the pseudo velocity of body 1 const Vector3 v1 = inverseMassBody1 * linearImpulseBody1; - Vector3 w1 = mFixedJointComponents.mI2[i] * angularImpulseBody1; + Vector3 w1 = mFixedJointComponents.mI1[i] * angularImpulseBody1; // Update the body position/orientation of body 1 x1 += v1; From a4a386f82313bf77a4d6692652d1b803a0dfc3c5 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Thu, 26 Nov 2020 22:08:15 +0100 Subject: [PATCH 4/4] Fix issue in FixedJointComponents --- src/components/FixedJointComponents.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/FixedJointComponents.cpp b/src/components/FixedJointComponents.cpp index d7c8c129..4ae8552a 100644 --- a/src/components/FixedJointComponents.cpp +++ b/src/components/FixedJointComponents.cpp @@ -163,7 +163,7 @@ void FixedJointComponents::moveComponentToIndex(uint32 srcIndex, uint32 destInde new (mR2World + destIndex) Vector3(mR2World[srcIndex]); new (mI1 + destIndex) Matrix3x3(mI1[srcIndex]); new (mI2 + destIndex) Matrix3x3(mI2[srcIndex]); - new (mImpulseTranslation + destIndex) Vector3(mImpulseRotation[srcIndex]); + new (mImpulseTranslation + destIndex) Vector3(mImpulseTranslation[srcIndex]); new (mImpulseRotation + destIndex) Vector3(mImpulseRotation[srcIndex]); new (mInverseMassMatrixTranslation + destIndex) Matrix3x3(mInverseMassMatrixTranslation[srcIndex]); new (mInverseMassMatrixRotation + destIndex) Matrix3x3(mInverseMassMatrixRotation[srcIndex]);