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]); diff --git a/src/systems/SolveFixedJointSystem.cpp b/src/systems/SolveFixedJointSystem.cpp index 6f31972a..e120bfcc 100644 --- a/src/systems/SolveFixedJointSystem.cpp +++ b/src/systems/SolveFixedJointSystem.cpp @@ -355,7 +355,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; diff --git a/testbed/CMakeLists.txt b/testbed/CMakeLists.txt index ea09cef7..7305e9cf 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 337ea96a..9a467044 100755 --- a/testbed/src/TestbedApplication.cpp +++ b/testbed/src/TestbedApplication.cpp @@ -103,12 +103,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; } @@ -332,6 +335,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", @@ -339,6 +343,8 @@ void GLAPIENTRY TestbedApplication::onOpenGLError(GLenum source, GLenum type, GL type, severity, message ); */ } +#endif + } // Compute the FPS