Skip to content

Commit

Permalink
Merge pull request TorqueGameEngines#826 from Ragora/adjustment-bulle…
Browse files Browse the repository at this point in the history
…t-update

Adjustment: Update Bullet version to 3.24
  • Loading branch information
Azaezel authored Nov 1, 2022
2 parents 8d8a4b2 + 4a3f31d commit 62d808c
Show file tree
Hide file tree
Showing 6,148 changed files with 2,080,370 additions and 56,829 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
7 changes: 7 additions & 0 deletions Engine/lib/bullet/.ci/docker/env.list
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
TRAVIS_OS_NAME
TRAVIS_PULL_REQUEST

BUILD_NAME
CC
CXX
SUDO
19 changes: 19 additions & 0 deletions Engine/lib/bullet/.ci/docker/ubuntu-bionic
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
FROM ubuntu:bionic

RUN apt-get update -qq
RUN apt-get install -y \
build-essential \
clang \
cmake \
curl \
git \
libgl-dev \
libglu-dev \
libpython3-dev \
lsb-release \
pkg-config \
python3 \
python3-dev \
python3-distutils \
software-properties-common \
sudo
18 changes: 18 additions & 0 deletions Engine/lib/bullet/.ci/docker/ubuntu-xenial
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ubuntu:xenial

RUN apt-get update -qq
RUN apt-get install -y \
build-essential \
clang \
cmake \
curl \
git \
libgl-dev \
libglu-dev \
libpython3-dev \
lsb-release \
pkg-config \
python3 \
python3-dev \
software-properties-common \
sudo
31 changes: 31 additions & 0 deletions Engine/lib/bullet/.ci/script.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
set -ex

echo "CXX="$CXX
echo "CC="$CC
if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" = "g++" ]]; then
$SUDO apt-get update
$SUDO apt-get install -y python3
$SUDO apt-get install -y python3-pip
$SUDO apt-get install python3-dev
$SUDO pip3 install -U wheel
$SUDO pip3 install -U setuptools
python3 setup.py install --user
python3 examples/pybullet/unittests/unittests.py --verbose
python3 examples/pybullet/unittests/userDataTest.py --verbose
python3 examples/pybullet/unittests/saveRestoreStateTest.py --verbose
fi
cmake . -DBUILD_PYBULLET=ON -G"Unix Makefiles" #-DCMAKE_CXX_FLAGS=-Werror
make -j8
ctest -j8 --output-on-failure

# Build again with double precision
cmake . -G "Unix Makefiles" -DUSE_DOUBLE_PRECISION=ON #-DCMAKE_CXX_FLAGS=-Werror
make -j8
ctest -j8 --output-on-failure

# Build again with shared libraries
cmake . -G "Unix Makefiles" -DBUILD_SHARED_LIBS=ON
make -j8
ctest -j8 --output-on-failure
$SUDO make install
38 changes: 38 additions & 0 deletions Engine/lib/bullet/.github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CMake

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally
# well on Windows or Mac. You can convert this to a matrix build if you need
# cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}

- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{env.BUILD_TYPE}}

42 changes: 42 additions & 0 deletions Engine/lib/bullet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/bin
/build3/gmake
/build3/vs2010
/build_cmake/

*.pyc

# Python
__pycache__/
*.py[cod]

# Pip
pip-selfcheck.json
*.whl
*.egg
*.egg-info

# Setuptools
/build
/dist
*.eggs

# CMake
CMakeFiles/
CMakeCache.txt
cmake_install.cmake
CTestTestFile.cmake

# Visual Studio build files
*.vcxproj
*.vcxproj.filters
*.sln

# Apple Finder metadata
*.DS_Store

# vim temp files
*.swp

.vscode/
.idea/
cmake-build-debug/
5 changes: 5 additions & 0 deletions Engine/lib/bullet/.style.yapf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[style]
based_on_style = google
column_limit = 99
indent_width = 2

100 changes: 68 additions & 32 deletions Engine/lib/bullet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,22 @@ SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
#MESSAGE("CMAKE_CXX_FLAGS_DEBUG="+${CMAKE_CXX_FLAGS_DEBUG})

OPTION(USE_DOUBLE_PRECISION "Use double precision" OFF)
SET(CLAMP_VELOCITIES "0" CACHE STRING "Clamp rigid bodies' velocity to this value, if larger than zero. Useful to prevent floating point errors or in general runaway velocities in complex scenarios")
OPTION(USE_GRAPHICAL_BENCHMARK "Use Graphical Benchmark" ON)
OPTION(BUILD_SHARED_LIBS "Use shared libraries" OFF)
OPTION(USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD "Use btSoftMultiBodyDynamicsWorld" OFF)
OPTION(USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD "Use btSoftMultiBodyDynamicsWorld" ON)
OPTION(USE_OPENVR "Use OpenVR for virtual reality" OFF)

OPTION(BULLET2_USE_THREAD_LOCKS "Build Bullet 2 libraries with mutex locking around certain operations (required for multi-threading)" OFF)
IF (BULLET2_USE_THREAD_LOCKS)
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)
OPTION(BULLET2_USE_TBB_MULTITHREADING "Build Bullet 2 with support for multi-threading with Intel Threading Building Blocks (requires the TBB library to be already installed)" OFF)
IF (MSVC)
OPTION(BULLET2_USE_PPL_MULTITHREADING "Build Bullet 2 with support for multi-threading with Microsoft Parallel Patterns Library (requires MSVC compiler)" OFF)
ENDIF (MSVC)
ENDIF (BULLET2_USE_THREAD_LOCKS)
ENDIF (BULLET2_MULTITHREADING)


IF(NOT WIN32)
Expand All @@ -55,14 +59,14 @@ IF(NOT WIN32)
ENDIF(NOT WIN32)

OPTION(USE_MSVC_INCREMENTAL_LINKING "Use MSVC Incremental Linking" OFF)
OPTION(USE_CUSTOM_VECTOR_MATH "Use custom vectormath library" OFF)

#statically linking VC++ isn't supported for WindowsPhone/WindowsStore
IF (CMAKE_SYSTEM_NAME STREQUAL WindowsPhone OR CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" ON)
ELSE ()
OPTION(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC Runtime Library DLL (/MD or /MDd)" OFF)
ENDIF (CMAKE_SYSTEM_NAME STREQUAL WindowsPhone OR CMAKE_SYSTEM_NAME STREQUAL WindowsStore)
OPTION(USE_MSVC_RELEASE_RUNTIME_ALWAYS "Use MSVC Release Runtime Library even in Debug" OFF)

#SET(CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /INCREMENTAL:NO")
#SET(CMAKE_EXE_LINKER_FLAGS "/STACK:10000000 /INCREMENTAL:NO")
Expand All @@ -75,11 +79,11 @@ IF(MSVC)
#MESSAGE("MSVC_INCREMENTAL_DEFAULT"+${MSVC_INCREMENTAL_DEFAULT})
SET( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:NO")

STRING(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags ${CMAKE_EXE_LINKER_FLAGS_DEBUG})
STRING(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags "${CMAKE_EXE_LINKER_FLAGS_DEBUG}")
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "/INCREMENTAL:NO ${replacementFlags}" )
MESSAGE("CMAKE_EXE_LINKER_FLAGS_DEBUG=${CMAKE_EXE_LINKER_FLAGS_DEBUG}")

STRING(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags2 ${CMAKE_EXE_LINKER_FLAGS})
STRING(REPLACE "INCREMENTAL:YES" "INCREMENTAL:NO" replacementFlags2 "${CMAKE_EXE_LINKER_FLAGS}")

SET(CMAKE_EXE_LINKER_FLAGS ${replacementFlag2})
STRING(REPLACE "INCREMENTAL:YES" "" replacementFlags3 "${CMAKE_EXTRA_LINK_FLAGS}")
Expand All @@ -94,7 +98,7 @@ IF(MSVC)
ENDIF (NOT USE_MSVC_INCREMENTAL_LINKING)

IF (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
#We statically link to reduce dependancies
#We statically link to reduce dependencies
FOREACH(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO )
IF(${flag_var} MATCHES "/MD")
STRING(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
Expand All @@ -105,10 +109,25 @@ IF(MSVC)
ENDFOREACH(flag_var)
ENDIF (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)

IF (USE_MSVC_RELEASE_RUNTIME_ALWAYS)
FOREACH(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_RELWITHDEBINFO )
IF(${flag_var} MATCHES "/MDd")
STRING(REGEX REPLACE "/MDd" "/MD" ${flag_var} "${${flag_var}}")
ENDIF(${flag_var} MATCHES "/MDd")
IF(${flag_var} MATCHES "/MTd")
STRING(REGEX REPLACE "/MTd" "/MT" ${flag_var} "${${flag_var}}")
ENDIF(${flag_var} MATCHES "/MTd")
# Need to remove _DEBUG too otherwise things like _ITERATOR_DEBUG_LEVEL mismatch
IF(${flag_var} MATCHES "-D_DEBUG")
STRING(REGEX REPLACE "-D_DEBUG" "" ${flag_var} "${${flag_var}}")
ENDIF(${flag_var} MATCHES "-D_DEBUG")
ENDFOREACH(flag_var)
ENDIF (USE_MSVC_RELEASE_RUNTIME_ALWAYS)

IF (CMAKE_CL_64)
ADD_DEFINITIONS(-D_WIN64)
ELSE()
OPTION(USE_MSVC_SSE "Use MSVC /arch:sse option" ON)
OPTION(USE_MSVC_SSE "Use MSVC /arch:sse option" OFF)
option(USE_MSVC_SSE2 "Compile your program with SSE2 instructions" ON)

IF (USE_MSVC_SSE)
Expand Down Expand Up @@ -212,25 +231,33 @@ IF (INTERNAL_UPDATE_SERIALIZATION_STRUCTURES)
ADD_DEFINITIONS( -DBT_INTERNAL_UPDATE_SERIALIZATION_STRUCTURES)
ENDIF (INTERNAL_UPDATE_SERIALIZATION_STRUCTURES)

IF (CLAMP_VELOCITIES)
ADD_DEFINITIONS( -DBT_CLAMP_VELOCITY_TO=${CLAMP_VELOCITIES})
ENDIF (CLAMP_VELOCITIES)

IF (USE_DOUBLE_PRECISION)
ADD_DEFINITIONS( -DBT_USE_DOUBLE_PRECISION)
SET( BULLET_DOUBLE_DEF "-DBT_USE_DOUBLE_PRECISION")
ENDIF (USE_DOUBLE_PRECISION)

IF (USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD)
ADD_DEFINITIONS(-DUSE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD)
ENDIF (USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD)
IF (NOT USE_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD)
ADD_DEFINITIONS(-DSKIP_SOFT_BODY_MULTI_BODY_DYNAMICS_WORLD)
ENDIF ()

IF(USE_GRAPHICAL_BENCHMARK)
ADD_DEFINITIONS( -DUSE_GRAPHICAL_BENCHMARK)
ENDIF (USE_GRAPHICAL_BENCHMARK)

IF(BULLET2_USE_THREAD_LOCKS)
IF(BULLET2_MULTITHREADING)
ADD_DEFINITIONS( -DBT_THREADSAFE=1 )
IF (NOT MSVC)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
ENDIF (NOT MSVC)
ENDIF (BULLET2_USE_THREAD_LOCKS)
IF (NOT WIN32)
FIND_PACKAGE(Threads)
LINK_LIBRARIES( ${CMAKE_THREAD_LIBS_INIT} )
ENDIF (NOT WIN32)
ENDIF (BULLET2_MULTITHREADING)

IF (BULLET2_USE_OPEN_MP_MULTITHREADING)
ADD_DEFINITIONS("-DBT_USE_OPENMP=1")
Expand Down Expand Up @@ -301,25 +328,26 @@ IF (APPLE)
ENDIF()

OPTION(BUILD_BULLET3 "Set when you want to build Bullet 3" ON)

# Optional Python configuration
# builds pybullet automatically if all the requirements are met
SET(PYTHON_VERSION_PYBULLET "" CACHE STRING "Python version pybullet will use.")
SET(Python_ADDITIONAL_VERSIONS 3 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.7.12 2.7.10 2.7.3 )
SET_PROPERTY(CACHE PYTHON_VERSION_PYBULLET PROPERTY STRINGS ${Python_ADDITIONAL_VERSIONS})
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build3/cmake ${CMAKE_MODULE_PATH})
OPTION(EXACT_PYTHON_VERSION "Require Python and match PYTHON_VERSION_PYBULLET exactly, e.g. 2.7.12" OFF)
IF(EXACT_PYTHON_VERSION)
set(EXACT_PYTHON_VERSION_FLAG EXACT REQUIRED)
ENDIF(EXACT_PYTHON_VERSION)
# first find the python interpreter
FIND_PACKAGE(PythonInterp ${PYTHON_VERSION_PYBULLET} ${EXACT_PYTHON_VERSION_FLAG})
# python library should exactly match that of the interpreter
FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
SET(DEFAULT_BUILD_PYBULLET OFF)
IF(PYTHONLIBS_FOUND)
SET(DEFAULT_BUILD_PYBULLET ON)
ENDIF(PYTHONLIBS_FOUND)
OPTION(BUILD_PYBULLET "Set when you want to build pybullet (Python bindings for Bullet)" ${DEFAULT_BUILD_PYBULLET})
# Will not probe environment for Python configuration (which can abort the
# build process) unless you explicitly turn on BUILD_PYBULLET.
OPTION(BUILD_PYBULLET "Set when you want to build pybullet (Python bindings for Bullet)" OFF)
IF(BUILD_PYBULLET)
SET(PYTHON_VERSION_PYBULLET "" CACHE STRING "Python version pybullet will use.")
SET(Python_ADDITIONAL_VERSIONS 3 3.6 3.5 3.4 3.3 3.2 3.1 3.0 2.7 2.7.12 2.7.10 2.7.3 )
SET_PROPERTY(CACHE PYTHON_VERSION_PYBULLET PROPERTY STRINGS ${Python_ADDITIONAL_VERSIONS})
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/build3/cmake ${CMAKE_MODULE_PATH})
OPTION(EXACT_PYTHON_VERSION "Require Python and match PYTHON_VERSION_PYBULLET exactly, e.g. 2.7.12" OFF)
IF(EXACT_PYTHON_VERSION)
set(EXACT_PYTHON_VERSION_FLAG EXACT REQUIRED)
ENDIF(EXACT_PYTHON_VERSION)
# first find the python interpreter
FIND_PACKAGE(PythonInterp ${PYTHON_VERSION_PYBULLET} ${EXACT_PYTHON_VERSION_FLAG})
# python library should exactly match that of the interpreter
# the following can result in fatal error if you don't have the right python configuration
FIND_PACKAGE(PythonLibs ${PYTHON_VERSION_STRING} EXACT)
ENDIF(BUILD_PYBULLET)

OPTION(BUILD_ENET "Set when you want to build apps with enet UDP networking support" ON)
OPTION(BUILD_CLSOCKET "Set when you want to build apps with enet TCP networking support" ON)
Expand Down Expand Up @@ -365,6 +393,13 @@ IF(BUILD_PYBULLET)

ENDIF(BUILD_PYBULLET)

IF(NOT WIN32 AND NOT APPLE)
OPTION(BUILD_EGL "Build OpenGL/EGL" ON)
IF(BUILD_EGL)
ADD_DEFINITIONS(-DBT_USE_EGL)
ENDIF(BUILD_EGL)
ENDIF()

IF(BUILD_BULLET3)
IF(APPLE)
MESSAGE("Mac OSX Version is ${_CURRENT_OSX_VERSION}")
Expand Down Expand Up @@ -455,6 +490,7 @@ IF (BUILD_UNIT_TESTS)
ENDIF()

set (BULLET_CONFIG_CMAKE_PATH lib${LIB_SUFFIX}/cmake/bullet )
list (APPEND BULLET_DEFINITIONS ${BULLET_DOUBLE_DEF})
list (APPEND BULLET_LIBRARIES LinearMath)
list (APPEND BULLET_LIBRARIES Bullet3Common)
list (APPEND BULLET_LIBRARIES BulletInverseDynamics)
Expand Down
Loading

0 comments on commit 62d808c

Please sign in to comment.