Skip to content

Commit

Permalink
enable v-hacd in cmake for BulletRobotics and pybullet build (use cma…
Browse files Browse the repository at this point in the history
…ke -DENABLE_VHACD=OFF .. to disable)

cmake: enable stable PD plugin (-DDSTATIC_LINK_SPD_PLUGIN)
btMultibody, make some args const in mulMatrix
  • Loading branch information
erwincoumans committed Mar 1, 2021
1 parent 97add36 commit adcaa75
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
21 changes: 21 additions & 0 deletions Extras/BulletRobotics/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -156,7 +159,25 @@ 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)
Expand Down
14 changes: 9 additions & 5 deletions examples/pybullet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/BulletDynamics/Featherstone/btMultiBody.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++)
{
Expand Down
2 changes: 1 addition & 1 deletion src/BulletDynamics/Featherstone/btMultiBody.h
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ btMultiBody
}
}

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
Expand Down

0 comments on commit adcaa75

Please sign in to comment.