Fix in btQuickprof that caused crash in ConcaveConvexcastDemo.cpp
Thanks to Roman Ponomarev for the report Make btVector3::rotate const Thanks to lepoussin, see Issue 428 CMakeLists.txt improvement: don't copy resources when INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES is set CMakeLists.txt improvement: INSTALL_EXTRA_LIBS for ConvexDecomposition and GIMPACTUtils Thanks to andrebra, see Issue 425
This commit is contained in:
@@ -75,11 +75,12 @@ ELSE(CMAKE_CL_64)
|
|||||||
ENDIF(CMAKE_CL_64)
|
ENDIF(CMAKE_CL_64)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
|
||||||
ADD_CUSTOM_COMMAND( TARGET AppOpenCLClothDemo_Mini POST_BUILD
|
IF(NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
|
ADD_CUSTOM_COMMAND( TARGET AppOpenCLClothDemo_Mini POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenCLClothDemo/amdFlag.bmp ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenCLClothDemo/amdFlag.bmp ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenCLClothDemo/atiFlag.bmp ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenCLClothDemo/atiFlag.bmp ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
ENDIF()
|
||||||
IF (UNIX)
|
IF (UNIX)
|
||||||
TARGET_LINK_LIBRARIES(AppOpenCLClothDemo_Mini pthread)
|
TARGET_LINK_LIBRARIES(AppOpenCLClothDemo_Mini pthread)
|
||||||
ENDIF(UNIX)
|
ENDIF(UNIX)
|
||||||
|
|||||||
@@ -72,12 +72,12 @@ ELSE(CMAKE_CL_64)
|
|||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF(CMAKE_CL_64)
|
ENDIF(CMAKE_CL_64)
|
||||||
ENDIF(WIN32)
|
ENDIF(WIN32)
|
||||||
|
IF(NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
ADD_CUSTOM_COMMAND( TARGET AppOpenCLClothDemo_NVidia POST_BUILD
|
ADD_CUSTOM_COMMAND( TARGET AppOpenCLClothDemo_NVidia POST_BUILD
|
||||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenCLClothDemo/amdFlag.bmp ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenCLClothDemo/amdFlag.bmp ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenCLClothDemo/atiFlag.bmp ${CMAKE_CURRENT_BINARY_DIR}
|
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenCLClothDemo/atiFlag.bmp ${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
ENDIF()
|
||||||
IF (UNIX)
|
IF (UNIX)
|
||||||
TARGET_LINK_LIBRARIES(AppOpenCLClothDemo_NVidia pthread)
|
TARGET_LINK_LIBRARIES(AppOpenCLClothDemo_NVidia pthread)
|
||||||
ENDIF(UNIX)
|
ENDIF(UNIX)
|
||||||
|
|||||||
@@ -2,14 +2,63 @@ INCLUDE_DIRECTORIES(
|
|||||||
${BULLET_PHYSICS_SOURCE_DIR}/Extras/ConvexDecomposition ${BULLET_PHYSICS_SOURCE_DIR}/src
|
${BULLET_PHYSICS_SOURCE_DIR}/Extras/ConvexDecomposition ${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_LIBRARY(ConvexDecomposition
|
SET(ConvexDecomposition_SRCS
|
||||||
ConvexDecomposition.h bestfitobb.cpp cd_vector.h concavity.h float_math.h planetri.h splitplane.h
|
bestfitobb.cpp
|
||||||
ConvexBuilder.cpp bestfitobb.h cd_wavefront.cpp fitsphere.cpp meshvolume.cpp raytri.cpp vlookup.cpp
|
ConvexBuilder.cpp
|
||||||
ConvexBuilder.h bestfit.cpp cd_hull.cpp cd_wavefront.h fitsphere.h meshvolume.h raytri.h vlookup.h
|
cd_wavefront.cpp
|
||||||
ConvexDecomposition.cpp bestfit.h cd_hull.h concavity.cpp float_math.cpp planetri.cpp splitplane.cpp
|
fitsphere.cpp
|
||||||
|
meshvolume.cpp
|
||||||
|
raytri.cpp
|
||||||
|
vlookup.cpp
|
||||||
|
bestfit.cpp
|
||||||
|
cd_hull.cpp
|
||||||
|
ConvexDecomposition.cpp
|
||||||
|
concavity.cpp
|
||||||
|
float_math.cpp
|
||||||
|
planetri.cpp
|
||||||
|
splitplane.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
SET(ConvexDecomposition_HDRS
|
||||||
|
ConvexDecomposition.h
|
||||||
|
cd_vector.h
|
||||||
|
concavity.h
|
||||||
|
bestfitobb.h
|
||||||
|
ConvexBuilder.h
|
||||||
|
cd_wavefront.h
|
||||||
|
fitsphere.h
|
||||||
|
meshvolume.h
|
||||||
|
raytri.h
|
||||||
|
vlookup.h
|
||||||
|
bestfit.h
|
||||||
|
cd_hull.h
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_LIBRARY(ConvexDecomposition ${ConvexDecomposition_SRCS} ${ConvexDecomposition_HDRS})
|
||||||
|
SET_TARGET_PROPERTIES(ConvexDecomposition PROPERTIES VERSION ${BULLET_VERSION})
|
||||||
|
SET_TARGET_PROPERTIES(ConvexDecomposition PROPERTIES SOVERSION ${BULLET_VERSION})
|
||||||
|
|
||||||
IF (BUILD_SHARED_LIBS)
|
IF (BUILD_SHARED_LIBS)
|
||||||
TARGET_LINK_LIBRARIES(ConvexDecomposition BulletCollision LinearMath)
|
TARGET_LINK_LIBRARIES(ConvexDecomposition BulletCollision LinearMath)
|
||||||
ENDIF (BUILD_SHARED_LIBS)
|
ENDIF (BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
|
IF (INSTALL_EXTRA_LIBS)
|
||||||
|
IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
|
#FILES_MATCHING requires CMake 2.6
|
||||||
|
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||||
|
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
INSTALL(TARGETS ConvexDecomposition DESTINATION .)
|
||||||
|
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
INSTALL(TARGETS ConvexDecomposition DESTINATION lib${LIB_SUFFIX})
|
||||||
|
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN
|
||||||
|
".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)
|
||||||
|
ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||||
|
|
||||||
|
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
SET_TARGET_PROPERTIES(ConvexDecomposition PROPERTIES FRAMEWORK true)
|
||||||
|
SET_TARGET_PROPERTIES(ConvexDecomposition PROPERTIES PUBLIC_HEADER "${ConvexDecomposition_HDRS}")
|
||||||
|
ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
|
ENDIF (INSTALL_EXTRA_LIBS)
|
||||||
|
|||||||
@@ -8,7 +8,30 @@ ${BULLET_PHYSICS_SOURCE_DIR}/Extras/ConvexDecomposition
|
|||||||
ADD_LIBRARY(GIMPACTUtils
|
ADD_LIBRARY(GIMPACTUtils
|
||||||
btGImpactConvexDecompositionShape.cpp btGImpactConvexDecompositionShape.h
|
btGImpactConvexDecompositionShape.cpp btGImpactConvexDecompositionShape.h
|
||||||
)
|
)
|
||||||
|
SET_TARGET_PROPERTIES(GIMPACTUtils PROPERTIES VERSION ${BULLET_VERSION})
|
||||||
|
SET_TARGET_PROPERTIES(GIMPACTUtils PROPERTIES SOVERSION ${BULLET_VERSION})
|
||||||
|
|
||||||
IF (BUILD_SHARED_LIBS)
|
IF (BUILD_SHARED_LIBS)
|
||||||
TARGET_LINK_LIBRARIES(GIMPACTUtils ConvexDecomposition BulletCollision)
|
TARGET_LINK_LIBRARIES(GIMPACTUtils ConvexDecomposition BulletCollision)
|
||||||
ENDIF (BUILD_SHARED_LIBS)
|
ENDIF (BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
|
IF (INSTALL_EXTRA_LIBS)
|
||||||
|
IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
|
#FILES_MATCHING requires CMake 2.6
|
||||||
|
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||||
|
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
INSTALL(TARGETS GIMPACTUtils DESTINATION .)
|
||||||
|
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
INSTALL(TARGETS GIMPACTUtils DESTINATION lib${LIB_SUFFIX})
|
||||||
|
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
|
DESTINATION ${INCLUDE_INSTALL_DIR} FILES_MATCHING PATTERN "*.h" PATTERN
|
||||||
|
".svn" EXCLUDE PATTERN "CMakeFiles" EXCLUDE)
|
||||||
|
ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||||
|
|
||||||
|
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
SET_TARGET_PROPERTIES(GIMPACTUtils PROPERTIES FRAMEWORK true)
|
||||||
|
SET_TARGET_PROPERTIES(GIMPACTUtils PROPERTIES PUBLIC_HEADER "btGImpactConvexDecompositionShape.h")
|
||||||
|
ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
|
ENDIF (INSTALL_EXTRA_LIBS)
|
||||||
|
|||||||
@@ -87,6 +87,19 @@ btClock::~btClock()
|
|||||||
delete m_data;
|
delete m_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
btClock::btClock(const btClock& other)
|
||||||
|
{
|
||||||
|
m_data = new btClockData;
|
||||||
|
*m_data = *other.m_data;
|
||||||
|
}
|
||||||
|
|
||||||
|
btClock& btClock::operator=(const btClock& other)
|
||||||
|
{
|
||||||
|
*m_data = *other.m_data;
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Resets the initial reference time.
|
/// Resets the initial reference time.
|
||||||
void btClock::reset()
|
void btClock::reset()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -37,6 +37,9 @@ class btClock
|
|||||||
public:
|
public:
|
||||||
btClock();
|
btClock();
|
||||||
|
|
||||||
|
btClock(const btClock& other);
|
||||||
|
btClock& operator=(const btClock& other);
|
||||||
|
|
||||||
~btClock();
|
~btClock();
|
||||||
|
|
||||||
/// Resets the initial reference time.
|
/// Resets the initial reference time.
|
||||||
|
|||||||
@@ -171,10 +171,10 @@ public:
|
|||||||
/**@brief Return a normalized version of this vector */
|
/**@brief Return a normalized version of this vector */
|
||||||
SIMD_FORCE_INLINE btVector3 normalized() const;
|
SIMD_FORCE_INLINE btVector3 normalized() const;
|
||||||
|
|
||||||
/**@brief Rotate this vector
|
/**@brief Return a rotated version of this vector
|
||||||
* @param wAxis The axis to rotate about
|
* @param wAxis The axis to rotate about
|
||||||
* @param angle The angle to rotate by */
|
* @param angle The angle to rotate by */
|
||||||
SIMD_FORCE_INLINE btVector3 rotate( const btVector3& wAxis, const btScalar angle );
|
SIMD_FORCE_INLINE btVector3 rotate( const btVector3& wAxis, const btScalar angle ) const;
|
||||||
|
|
||||||
/**@brief Return the angle between this and another vector
|
/**@brief Return the angle between this and another vector
|
||||||
* @param v The other vector */
|
* @param v The other vector */
|
||||||
@@ -491,7 +491,7 @@ SIMD_FORCE_INLINE btVector3 btVector3::normalized() const
|
|||||||
return *this / length();
|
return *this / length();
|
||||||
}
|
}
|
||||||
|
|
||||||
SIMD_FORCE_INLINE btVector3 btVector3::rotate( const btVector3& wAxis, const btScalar angle )
|
SIMD_FORCE_INLINE btVector3 btVector3::rotate( const btVector3& wAxis, const btScalar angle ) const
|
||||||
{
|
{
|
||||||
// wAxis must be a unit lenght vector
|
// wAxis must be a unit lenght vector
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user