use relative path, to make it easier to include btBulletWorldImporter, #include "../BulletFileLoader/btBulletFile.h"
Create a separate library for MiniCL (a rudimentary OpenCL wrapper to run kernels on multi-core CPU using the default C++ compiler, using Win32 Threads or Posix) tweak vectormath/vmInclude.h for PS3 platforms fix warning in btKinematicCharacterController
This commit is contained in:
@@ -31,12 +31,16 @@ ENDIF()
|
|||||||
OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" ON)
|
OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" ON)
|
||||||
OPTION(USE_MSVC_INCREMENTAL_LINKING "Use MSVC Incremental Linking" OFF)
|
OPTION(USE_MSVC_INCREMENTAL_LINKING "Use MSVC Incremental Linking" OFF)
|
||||||
|
|
||||||
IF(WIN32)
|
OPTION(USE_CUSTOM_VECTOR_MATH "Use custom vectormath library" OFF)
|
||||||
SET (VECTOR_MATH_INCLUDE ${BULLET_PHYSICS_SOURCE_DIR}/src/BulletMultiThreaded/vectormath/sse CACHE PATH "Vector Math library include path.")
|
|
||||||
ELSE(WIN32)
|
|
||||||
SET (VECTOR_MATH_INCLUDE ${BULLET_PHYSICS_SOURCE_DIR}/src/BulletMultiThreaded/vectormath/scalar CACHE PATH "Vector Math library include path.")
|
|
||||||
ENDIF(WIN32)
|
|
||||||
|
|
||||||
|
IF (USE_CUSTOM_VECTOR_MATH)
|
||||||
|
ADD_DEFINITIONS(-DUSE_SYSTEM_VECTORMATH)
|
||||||
|
IF(WIN32)
|
||||||
|
SET (VECTOR_MATH_INCLUDE ${BULLET_PHYSICS_SOURCE_DIR}/src/vectormath/sse CACHE PATH "Vector Math library include path.")
|
||||||
|
ELSE(WIN32)
|
||||||
|
SET (VECTOR_MATH_INCLUDE ${BULLET_PHYSICS_SOURCE_DIR}/src/vectormath/scalar CACHE PATH "Vector Math library include path.")
|
||||||
|
ENDIF(WIN32)
|
||||||
|
ENDIF(USE_CUSTOM_VECTOR_MATH)
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
FIND_PATH(DIRECTX_SDK_BASE_DIR Include/D3D11.h PATH $ENV{DXSDK_DIR} )
|
FIND_PATH(DIRECTX_SDK_BASE_DIR Include/D3D11.h PATH $ENV{DXSDK_DIR} )
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ IF (USE_GLUT)
|
|||||||
OpenGLSupport
|
OpenGLSupport
|
||||||
BulletDynamics
|
BulletDynamics
|
||||||
BulletCollision
|
BulletCollision
|
||||||
|
MiniCL
|
||||||
BulletMultiThreaded
|
BulletMultiThreaded
|
||||||
LinearMath
|
LinearMath
|
||||||
${GLUT_glut_LIBRARY}
|
${GLUT_glut_LIBRARY}
|
||||||
|
|||||||
@@ -8,7 +8,9 @@ ${BULLET_PHYSICS_SOURCE_DIR}/src
|
|||||||
)
|
)
|
||||||
|
|
||||||
LINK_LIBRARIES(
|
LINK_LIBRARIES(
|
||||||
BulletMultiThreaded LinearMath
|
MiniCL
|
||||||
|
BulletMultiThreaded
|
||||||
|
LinearMath
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_EXECUTABLE(AppVectorAdd_Mini
|
ADD_EXECUTABLE(AppVectorAdd_Mini
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
#include "btBulletWorldImporter.h"
|
#include "btBulletWorldImporter.h"
|
||||||
#include "btBulletFile.h"
|
#include "../BulletFileLoader/btBulletFile.h"
|
||||||
|
|
||||||
#include "btBulletDynamicsCommon.h"
|
#include "btBulletDynamicsCommon.h"
|
||||||
#include "BulletCollision/Gimpact/btGImpactShape.h"
|
#include "BulletCollision/Gimpact/btGImpactShape.h"
|
||||||
|
|||||||
@@ -217,7 +217,7 @@ void btKinematicCharacterController::stepUp ( btCollisionWorld* world)
|
|||||||
{
|
{
|
||||||
// phase 1: up
|
// phase 1: up
|
||||||
btTransform start, end;
|
btTransform start, end;
|
||||||
m_targetPosition = m_currentPosition + getUpAxisDirections()[m_upAxis] * (m_stepHeight + (m_verticalOffset > 0.0?m_verticalOffset:0.0));
|
m_targetPosition = m_currentPosition + getUpAxisDirections()[m_upAxis] * (m_stepHeight + (m_verticalOffset > 0.f?m_verticalOffset:0.f));
|
||||||
|
|
||||||
start.setIdentity ();
|
start.setIdentity ();
|
||||||
end.setIdentity ();
|
end.setIdentity ();
|
||||||
@@ -392,7 +392,7 @@ void btKinematicCharacterController::stepDown ( btCollisionWorld* collisionWorld
|
|||||||
btVector3 gravity_drop = getUpAxisDirections()[m_upAxis] * downVelocity;
|
btVector3 gravity_drop = getUpAxisDirections()[m_upAxis] * downVelocity;
|
||||||
m_targetPosition -= (step_drop + gravity_drop);*/
|
m_targetPosition -= (step_drop + gravity_drop);*/
|
||||||
|
|
||||||
btScalar downVelocity = (m_verticalVelocity<0.0?-m_verticalVelocity:0.0) * dt;
|
btScalar downVelocity = (m_verticalVelocity<0.f?-m_verticalVelocity:0.f) * dt;
|
||||||
if(downVelocity > 0.0 && downVelocity < m_stepHeight
|
if(downVelocity > 0.0 && downVelocity < m_stepHeight
|
||||||
&& (m_wasOnGround || !m_wasJumping))
|
&& (m_wasOnGround || !m_wasJumping))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -65,16 +65,6 @@ ADD_LIBRARY(BulletMultiThreaded
|
|||||||
btGpuUtilsSharedCode.h
|
btGpuUtilsSharedCode.h
|
||||||
btGpuUtilsSharedDefs.h
|
btGpuUtilsSharedDefs.h
|
||||||
|
|
||||||
#MiniCL provides a small subset of OpenCL
|
|
||||||
MiniCL.cpp
|
|
||||||
MiniCLTaskScheduler.cpp
|
|
||||||
MiniCLTaskScheduler.h
|
|
||||||
MiniCLTask/MiniCLTask.cpp
|
|
||||||
MiniCLTask/MiniCLTask.h
|
|
||||||
../MiniCL/cl.h
|
|
||||||
../MiniCL/cl_gl.h
|
|
||||||
../MiniCL/cl_platform.h
|
|
||||||
../MiniCL/cl_MiniCL_Defs.h
|
|
||||||
)
|
)
|
||||||
|
|
||||||
#for now, only Direct 11 (Direct Compute)
|
#for now, only Direct 11 (Direct Compute)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
SUBDIRS( BulletMultiThreaded BulletSoftBody BulletCollision BulletDynamics LinearMath )
|
SUBDIRS( MiniCL BulletMultiThreaded BulletSoftBody BulletCollision BulletDynamics LinearMath )
|
||||||
|
|
||||||
IF(INSTALL_LIBS)
|
IF(INSTALL_LIBS)
|
||||||
#INSTALL of other files requires CMake 2.6
|
#INSTALL of other files requires CMake 2.6
|
||||||
|
|||||||
40
src/MiniCL/CMakeLists.txt
Normal file
40
src/MiniCL/CMakeLists.txt
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
#MiniCL provides a small subset of OpenCL
|
||||||
|
|
||||||
|
INCLUDE_DIRECTORIES(
|
||||||
|
${BULLET_PHYSICS_SOURCE_DIR}/src
|
||||||
|
${VECTOR_MATH_INCLUDE}
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_LIBRARY(MiniCL
|
||||||
|
MiniCL.cpp
|
||||||
|
MiniCLTaskScheduler.cpp
|
||||||
|
MiniCLTaskScheduler.h
|
||||||
|
MiniCLTask/MiniCLTask.cpp
|
||||||
|
MiniCLTask/MiniCLTask.h
|
||||||
|
../MiniCL/cl.h
|
||||||
|
../MiniCL/cl_gl.h
|
||||||
|
../MiniCL/cl_platform.h
|
||||||
|
../MiniCL/cl_MiniCL_Defs.h
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
IF (BUILD_SHARED_LIBS)
|
||||||
|
TARGET_LINK_LIBRARIES(MiniCL BulletMultiThreaded BulletDynamics BulletCollision)
|
||||||
|
ENDIF (BUILD_SHARED_LIBS)
|
||||||
|
|
||||||
|
IF (INSTALL_LIBS)
|
||||||
|
IF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
|
#INSTALL of other files requires CMake 2.6
|
||||||
|
IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||||
|
IF(INSTALL_EXTRA_LIBS)
|
||||||
|
IF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
INSTALL(TARGETS MiniCL DESTINATION .)
|
||||||
|
ELSE (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
INSTALL(TARGETS MiniCL DESTINATION lib)
|
||||||
|
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION include FILES_MATCHING PATTERN "*.h")
|
||||||
|
ENDIF (APPLE AND BUILD_SHARED_LIBS AND FRAMEWORK)
|
||||||
|
ENDIF (INSTALL_EXTRA_LIBS)
|
||||||
|
ENDIF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.5)
|
||||||
|
ENDIF (NOT INTERNAL_CREATE_DISTRIBUTABLE_MSVC_PROJECTFILES)
|
||||||
|
ENDIF (INSTALL_LIBS)
|
||||||
|
|
||||||
@@ -19,7 +19,7 @@ subject to the following restrictions:
|
|||||||
#include "BulletMultiThreaded/SpuFakeDma.h"
|
#include "BulletMultiThreaded/SpuFakeDma.h"
|
||||||
#include "LinearMath/btMinMax.h"
|
#include "LinearMath/btMinMax.h"
|
||||||
#include "MiniCLTask.h"
|
#include "MiniCLTask.h"
|
||||||
#include "BulletMultiThreaded/MiniCLTaskScheduler.h"
|
#include "MiniCL/MiniCLTaskScheduler.h"
|
||||||
|
|
||||||
|
|
||||||
#ifdef __SPU__
|
#ifdef __SPU__
|
||||||
@@ -4,17 +4,11 @@
|
|||||||
|
|
||||||
#include "LinearMath/btScalar.h"
|
#include "LinearMath/btScalar.h"
|
||||||
|
|
||||||
#if defined (USE_SYSTEM_VECTORMATH)
|
#if defined (USE_SYSTEM_VECTORMATH) || defined (__CELLOS_LV2__)
|
||||||
#include <vectormath_aos.h>
|
#include <vectormath_aos.h>
|
||||||
#else //(USE_SYSTEM_VECTORMATH)
|
#else //(USE_SYSTEM_VECTORMATH)
|
||||||
#if defined (BT_USE_SSE) && defined (_WIN32)
|
#if defined (BT_USE_SSE) && defined (_WIN32)
|
||||||
#include "sse/vectormath_aos.h"
|
#include "sse/vectormath_aos.h"
|
||||||
#elif defined (__CELLOS_LV2__)
|
|
||||||
#ifdef __SPU__
|
|
||||||
#include "spu/vectormath_aos.h"
|
|
||||||
#else
|
|
||||||
#include "ppu/vectormath_aos.h"
|
|
||||||
#endif //__SPU__
|
|
||||||
#else //all other platforms
|
#else //all other platforms
|
||||||
#include "scalar/vectormath_aos.h"
|
#include "scalar/vectormath_aos.h"
|
||||||
#endif //(BT_USE_SSE) && defined (_WIN32)
|
#endif //(BT_USE_SSE) && defined (_WIN32)
|
||||||
|
|||||||
Reference in New Issue
Block a user