Improve CMake support:

Add CMake install support for libbulletmath,libbulletcollision,libbulletdynamics,libbulletsoftbody,and toplevel include files
Options to enable/disable BUILD_DEMOS and BUILD_ETRAS

Fixed compile issue in BulletMultiThreaded
Fixed double-precision issues with btMatrix3x3::getEulerZYX
This commit is contained in:
erwin.coumans
2008-11-04 10:36:27 +00:00
parent ccc63bbce7
commit 325fc0bab0
8 changed files with 245 additions and 190 deletions

View File

@@ -3,7 +3,14 @@ INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src }
)
ADD_LIBRARY(LibLinearMath
SET(LibLinearMath_SRCS
btConvexHull.cpp
btQuickprof.cpp
btGeometryUtil.cpp
btAlignedAllocator.cpp
)
SET(LibLinearMath_HDRS
btAlignedObjectArray.h
btList.h
btPoolAllocator.h
@@ -16,7 +23,6 @@ ADD_LIBRARY(LibLinearMath
btScalar.h
btAabbUtil2.h
btConvexHull.h
btConvexHull.cpp
btMinMax.h
btQuaternion.h
btStackAlloc.h
@@ -27,8 +33,10 @@ ADD_LIBRARY(LibLinearMath
btIDebugDraw.h
btQuickprof.h
btTransformUtil.h
btQuickprof.cpp
btGeometryUtil.cpp
btAlignedAllocator.cpp
)
# ADD_LIBRARY(LibLinearMath SHARED ${LibLinearMath_SRCS} ${LibLinearMath_HDRS})
ADD_LIBRARY(LibLinearMath ${LibLinearMath_SRCS} ${LibLinearMath_HDRS})
INSTALL(TARGETS LibLinearMath DESTINATION lib)
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")

View File

@@ -293,18 +293,18 @@ class btMatrix3x3 {
euler_out2.yaw = 0;
// From difference of angles formula
double delta = btAtan2(m_el[0].x(),m_el[0].z());
btScalar delta = btAtan2(m_el[0].x(),m_el[0].z());
if (m_el[2].x() > 0) //gimbal locked up
{
euler_out.pitch = SIMD_PI / 2.0;
euler_out2.pitch = SIMD_PI / 2.0;
euler_out.pitch = SIMD_PI / btScalar(2.0);
euler_out2.pitch = SIMD_PI / btScalar(2.0);
euler_out.roll = euler_out.pitch + delta;
euler_out2.roll = euler_out.pitch + delta;
}
else // gimbal locked down
{
euler_out.pitch = -SIMD_PI / 2.0;
euler_out2.pitch = -SIMD_PI / 2.0;
euler_out.pitch = -SIMD_PI / btScalar(2.0);
euler_out2.pitch = -SIMD_PI / btScalar(2.0);
euler_out.roll = -euler_out.pitch + delta;
euler_out2.roll = -euler_out.pitch + delta;
}
@@ -314,32 +314,29 @@ class btMatrix3x3 {
euler_out.pitch = - btAsin(m_el[2].x());
euler_out2.pitch = SIMD_PI - euler_out.pitch;
euler_out.roll = btAtan2(m_el[2].y()/cos(euler_out.pitch),
m_el[2].z()/cos(euler_out.pitch));
euler_out2.roll = btAtan2(m_el[2].y()/cos(euler_out2.pitch),
m_el[2].z()/cos(euler_out2.pitch));
euler_out.roll = btAtan2(m_el[2].y()/btCos(euler_out.pitch),
m_el[2].z()/btCos(euler_out.pitch));
euler_out2.roll = btAtan2(m_el[2].y()/btCos(euler_out2.pitch),
m_el[2].z()/btCos(euler_out2.pitch));
euler_out.yaw = btAtan2(m_el[1].x()/cos(euler_out.pitch),
m_el[0].x()/cos(euler_out.pitch));
euler_out2.yaw = btAtan2(m_el[1].x()/cos(euler_out2.pitch),
m_el[0].x()/cos(euler_out2.pitch));
euler_out.yaw = btAtan2(m_el[1].x()/btCos(euler_out.pitch),
m_el[0].x()/btCos(euler_out.pitch));
euler_out2.yaw = btAtan2(m_el[1].x()/btCos(euler_out2.pitch),
m_el[0].x()/btCos(euler_out2.pitch));
}
if (solution_number == 1)
{ yaw = euler_out.yaw;
pitch = euler_out.pitch;
roll = euler_out.roll;
{
yaw = euler_out.yaw;
pitch = euler_out.pitch;
roll = euler_out.roll;
}
else
{ yaw = euler_out2.yaw;
pitch = euler_out2.pitch;
roll = euler_out2.roll;
{
yaw = euler_out2.yaw;
pitch = euler_out2.pitch;
roll = euler_out2.roll;
}
return;
}
/**@brief Create a scaled copy of the matrix