From 991366a48f0edb471e0fa892bbc054e2c5393b7d Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 20 Jan 2015 19:10:52 -1000 Subject: [PATCH 1/4] Fixed self-referencial bug in btVector3's setInterpolate3 --- src/LinearMath/btVector3.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/LinearMath/btVector3.h b/src/LinearMath/btVector3.h index 112b70dd6..839b19c14 100644 --- a/src/LinearMath/btVector3.h +++ b/src/LinearMath/btVector3.h @@ -501,10 +501,10 @@ public: __m128 tmp3 = _mm_add_ps(r0,r1); mVec128 = tmp3; #elif defined(BT_USE_NEON) - mVec128 = vsubq_f32(v1.mVec128, v0.mVec128); - mVec128 = vmulq_n_f32(mVec128, rt); - mVec128 = vaddq_f32(mVec128, v0.mVec128); -#else + float32x4_t vl = vsubq_f32(v1.mVec128, v0.mVec128); + vl = vmulq_n_f32(vl, rt); + mVec128 = vaddq_f32(vl, v0.mVec128); +#else btScalar s = btScalar(1.0) - rt; m_floats[0] = s * v0.m_floats[0] + rt * v1.m_floats[0]; m_floats[1] = s * v0.m_floats[1] + rt * v1.m_floats[1]; From 9e8e22bee52a6679c40964f403c8e97943059f14 Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Tue, 20 Jan 2015 20:11:56 -1000 Subject: [PATCH 2/4] Same fix for B3 codebase --- src/Bullet3Common/b3Vector3.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bullet3Common/b3Vector3.h b/src/Bullet3Common/b3Vector3.h index ed45ffaa9..9bd10a5cc 100644 --- a/src/Bullet3Common/b3Vector3.h +++ b/src/Bullet3Common/b3Vector3.h @@ -467,10 +467,10 @@ public: __m128 tmp3 = _mm_add_ps(r0,r1); mVec128 = tmp3; #elif defined(B3_USE_NEON) - mVec128 = vsubq_f32(v1.mVec128, v0.mVec128); - mVec128 = vmulq_n_f32(mVec128, rt); - mVec128 = vaddq_f32(mVec128, v0.mVec128); -#else + float32x4_t vl = vsubq_f32(v1.mVec128, v0.mVec128); + vl = vmulq_n_f32(vl, rt); + mVec128 = vaddq_f32(vl, v0.mVec128); +#else b3Scalar s = b3Scalar(1.0) - rt; m_floats[0] = s * v0.m_floats[0] + rt * v1.m_floats[0]; m_floats[1] = s * v0.m_floats[1] + rt * v1.m_floats[1]; From d7131e9bb0df5163050f046bc432148fbd23befd Mon Sep 17 00:00:00 2001 From: Steven Peters Date: Tue, 3 Feb 2015 12:55:02 -0800 Subject: [PATCH 3/4] Use absolute paths in pkg-config file --- bullet.pc.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bullet.pc.cmake b/bullet.pc.cmake index c5649d58d..a504b1fc4 100644 --- a/bullet.pc.cmake +++ b/bullet.pc.cmake @@ -2,5 +2,5 @@ Name: bullet Description: Bullet Continuous Collision Detection and Physics Library Requires: Version: @BULLET_VERSION@ -Libs: -L@LIB_DESTINATION@ -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath -Cflags: @BULLET_DOUBLE_DEF@ -I@INCLUDE_INSTALL_DIR@ +Libs: -L@CMAKE_INSTALL_PREFIX@/@LIB_DESTINATION@ -lBulletSoftBody -lBulletDynamics -lBulletCollision -lLinearMath +Cflags: @BULLET_DOUBLE_DEF@ -I@CMAKE_INSTALL_PREFIX@/@INCLUDE_INSTALL_DIR@ From b36936a4abc34bca3cbfbaf37b38095005e3a384 Mon Sep 17 00:00:00 2001 From: erwincoumans Date: Tue, 10 Feb 2015 18:12:55 -0800 Subject: [PATCH 4/4] Update Test_v3interp.cpp add test case for https://github.com/bulletphysics/bullet3/pull/313 --- test/Bullet2/Source/Tests/Test_v3interp.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/Bullet2/Source/Tests/Test_v3interp.cpp b/test/Bullet2/Source/Tests/Test_v3interp.cpp index b03377597..33d47db02 100644 --- a/test/Bullet2/Source/Tests/Test_v3interp.cpp +++ b/test/Bullet2/Source/Tests/Test_v3interp.cpp @@ -62,7 +62,9 @@ int Test_v3interp(void) v2.setW(w); correct_res = v3interp_ref(correct_res, v1, v2, rt); - test_res.setInterpolate3(v1, v2, rt); + //test self-referencing vector, see issue https://github.com/bulletphysics/bullet3/pull/313 + test_res = v1; + test_res.setInterpolate3(test_res, v2, rt); if( fabs(correct_res.m_floats[0] - test_res.m_floats[0]) + fabs(correct_res.m_floats[1] - test_res.m_floats[1]) +