enable v-hacd in cmake for BulletRobotics and pybullet build (use cmake -DENABLE_VHACD=OFF .. to disable)

cmake: enable stable PD plugin (-DDSTATIC_LINK_SPD_PLUGIN)
btMultibody, make some args const in mulMatrix
This commit is contained in:
Erwin Coumans 2021-03-01 14:03:48 -08:00
parent 97add36b9f
commit adcaa75777
5 changed files with 34 additions and 7 deletions

View File

@ -30,6 +30,8 @@ OPTION(BUILD_SHARED_LIBS "Use shared libraries" OFF)
OPTION(USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD "Use btSoftMultiBodyDynamicsWorld" ON)
OPTION(USE_OPENVR "Use OpenVR for virtual reality" OFF)
OPTION(ENABLE_VHACD "Use VHACD in BulletRobotics and pybullet" ON)
OPTION(BULLET2_MULTITHREADING "Build Bullet 2 libraries with mutex locking around certain operations (required for multi-threading)" OFF)
IF (BULLET2_MULTITHREADING)
OPTION(BULLET2_USE_OPEN_MP_MULTITHREADING "Build Bullet 2 with support for multi-threading with OpenMP (requires a compiler with OpenMP support)" OFF)

View File

@ -7,6 +7,9 @@ INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/enet/include
${BULLET_PHYSICS_SOURCE_DIR}/examples/ThirdPartyLibs/clsocket/src
)
ADD_DEFINITIONS(-DSTATIC_LINK_SPD_PLUGIN)
SET(BulletRobotics_INCLUDES
../../examples/CommonInterfaces/Common2dCanvasInterface.h
@ -156,8 +159,26 @@ SET(BulletRobotics_SRCS ${BulletRobotics_INCLUDES}
../../examples/MultiThreading/b3PosixThreadSupport.cpp
../../examples/MultiThreading/b3Win32ThreadSupport.cpp
../../examples/MultiThreading/b3ThreadSupportInterface.cpp
)
IF(ENABLE_VHACD)
ADD_DEFINITIONS(-DBT_ENABLE_VHACD)
SET(BulletRobotics_SRCS ${BulletRobotics_SRCS}
../../Extras/VHACD/test/src/main_vhacd.cpp
../../Extras/VHACD/src/VHACD.cpp
../../Extras/VHACD/src/vhacdICHull.cpp
../../Extras/VHACD/src/vhacdManifoldMesh.cpp
../../Extras/VHACD/src/vhacdMesh.cpp
../../Extras/VHACD/src/vhacdVolume.cpp
)
INCLUDE_DIRECTORIES(
../../Extras/VHACD/inc
../../Extras/VHACD/public
)
ENDIF(ENABLE_VHACD)
IF(BUILD_CLSOCKET)
ADD_DEFINITIONS(-DBT_ENABLE_CLSOCKET)
ENDIF(BUILD_CLSOCKET)

View File

@ -13,15 +13,19 @@ IF(BUILD_PYBULLET_NUMPY)
)
ENDIF()
ADD_DEFINITIONS(-DSTATIC_LINK_SPD_PLUGIN)
ADD_DEFINITIONS(-DSTATIC_LINK_SPD_PLUGIN )
SET(pybullet3_SRCS
pybullet.c
)
IF(ENABLE_VHACD)
ADD_DEFINITIONS(-DBT_ENABLE_VHACD)
INCLUDE_DIRECTORIES(
../../Extras/VHACD/inc
../../Extras/VHACD/public
)
ENDIF(ENABLE_VHACD)
SET(pybullet_SRCS
pybullet.c
)
IF(BUILD_CLSOCKET)

View File

@ -1411,7 +1411,7 @@ void btMultiBody::solveImatrix(const btSpatialForceVector &rhs, btSpatialMotionV
}
}
void btMultiBody::mulMatrix(btScalar *pA, btScalar *pB, int rowsA, int colsA, int rowsB, int colsB, btScalar *pC) const
void btMultiBody::mulMatrix(const btScalar *pA, const btScalar *pB, int rowsA, int colsA, int rowsB, int colsB, btScalar *pC) const
{
for (int row = 0; row < rowsA; row++)
{

View File

@ -745,7 +745,7 @@ private:
}
}
void mulMatrix(btScalar * pA, btScalar * pB, int rowsA, int colsA, int rowsB, int colsB, btScalar *pC) const;
void mulMatrix(const btScalar *pA, const btScalar *pB, int rowsA, int colsA, int rowsB, int colsB, btScalar *pC) const;
private:
btMultiBodyLinkCollider *m_baseCollider; //can be NULL