BulletSim: update for building with newest version (v3.35+) of Bullet physics engine.

Updated README.md and BUILD.md.
Built filenames include version info.
Updated build parameters for IOS and Linux.
Functional update of properly returning version information of binary code.
Scripts for building using Github actions.
This commit is contained in:
Robert Adams
2023-12-08 21:30:16 +00:00
parent 64398cfa3d
commit 10525ea51d
25 changed files with 773 additions and 670 deletions
@@ -1,28 +1,26 @@
From 4dec1c667448dc2518a38212484c8a39dc203c65 Mon Sep 17 00:00:00 2001
From: Robert Adams <Robert.Adams@intel.com>
Date: Tue, 4 Dec 2012 08:17:53 -0800
Subject: [PATCH 1/2] Call setWorldTransform when object is going inactive.
Creates property update event when velocities are set
to zero.
From 9e8f6c61e1cd05bc211297c1edcadecfa20779c6 Mon Sep 17 00:00:00 2001
From: Robert Adams <misterblue@misterblue.com>
Date: Wed, 14 Dec 2022 04:23:51 +0000
Subject: [PATCH] Add island sleeping transform event
---
.../Dynamics/btDiscreteDynamicsWorld.cpp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
index 48ba8bd..be14294 100755
index 9e99c154f..71af633b4 100644
--- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
+++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
@@ -634,6 +634,9 @@ void btDiscreteDynamicsWorld::updateActivationState(btScalar timeStep)
@@ -616,6 +616,9 @@ void btDiscreteDynamicsWorld::updateActivationState(btScalar timeStep)
{
body->setAngularVelocity(btVector3(0,0,0));
body->setLinearVelocity(btVector3(0,0,0));
body->setAngularVelocity(btVector3(0, 0, 0));
body->setLinearVelocity(btVector3(0, 0, 0));
+ // when sleeping, force the motion state to be called/updated
+ if (body->getMotionState())
+ body->getMotionState()->setWorldTransform(body->getWorldTransform());
}
}
}
--
1.7.9
2.25.1
@@ -1,25 +0,0 @@
From 2a2bb8512bc0b7c804b30f5bf8eaf10ea721eb14 Mon Sep 17 00:00:00 2001
From: Robert Adams <Robert.Adams@intel.com>
Date: Sun, 27 Jan 2013 21:07:13 -0800
Subject: [PATCH 2/2] Disable internal profile gathering
---
src/LinearMath/btQuickprof.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/LinearMath/btQuickprof.h b/src/LinearMath/btQuickprof.h
index 8691400..a688912 100755
--- a/src/LinearMath/btQuickprof.h
+++ b/src/LinearMath/btQuickprof.h
@@ -16,7 +16,7 @@
#define BT_QUICK_PROF_H
//To disable built-in profiling, please comment out next line
-//#define BT_NO_PROFILE 1
+#define BT_NO_PROFILE 1
#ifndef BT_NO_PROFILE
#include <stdio.h>//@todo remove this, backwards compatibility
#include "btScalar.h"
--
1.7.9
@@ -0,0 +1,28 @@
From 4dec1c667448dc2518a38212484c8a39dc203c65 Mon Sep 17 00:00:00 2001
From: Robert Adams <Robert.Adams@intel.com>
Date: Tue, 4 Dec 2012 08:17:53 -0800
Subject: [PATCH 1/2] Call setWorldTransform when object is going inactive.
Creates property update event when velocities are set
to zero.
---
.../Dynamics/btDiscreteDynamicsWorld.cpp | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
index 48ba8bd..be14294 100755
--- a/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
+++ b/src/BulletDynamics/Dynamics/btDiscreteDynamicsWorld.cpp
@@ -642,6 +642,9 @@ void btDiscreteDynamicsWorld::updateActivationState(btScalar timeStep)
{
body->setAngularVelocity(btVector3(0,0,0));
body->setLinearVelocity(btVector3(0,0,0));
+ // when sleeping, force the motion state to be called/updated
+ if (body->getMotionState())
+ body->getMotionState()->setWorldTransform(body->getWorldTransform());
}
}
--
1.7.9
@@ -0,0 +1,40 @@
diff -crB bullet3-2.86.1/src/Bullet3Common/b3Vector3.h bullet3-2.86.1new/src/Bullet3Common/b3Vector3.h
*** bullet3-2.86.1/src/Bullet3Common/b3Vector3.h 2017-02-17 15:43:38.000000000 -0800
--- bullet3-2.86.1new/src/Bullet3Common/b3Vector3.h 2022-12-04 21:49:54.000000000 -0800
***************
*** 39,45 ****
#endif
! #define B3_SHUFFLE(x,y,z,w) ((w)<<6 | (z)<<4 | (y)<<2 | (x))
//#define b3_pshufd_ps( _a, _mask ) (__m128) _mm_shuffle_epi32((__m128i)(_a), (_mask) )
#define b3_pshufd_ps( _a, _mask ) _mm_shuffle_ps((_a), (_a), (_mask) )
#define b3_splat3_ps( _a, _i ) b3_pshufd_ps((_a), B3_SHUFFLE(_i,_i,_i, 3) )
--- 39,45 ----
#endif
! #define B3_SHUFFLE(x, y, z, w) (((w) << 6 | (z) << 4 | (y) << 2 | (x)) & 0xff)
//#define b3_pshufd_ps( _a, _mask ) (__m128) _mm_shuffle_epi32((__m128i)(_a), (_mask) )
#define b3_pshufd_ps( _a, _mask ) _mm_shuffle_ps((_a), (_a), (_mask) )
#define b3_splat3_ps( _a, _i ) b3_pshufd_ps((_a), B3_SHUFFLE(_i,_i,_i, 3) )
diff -crB bullet3-2.86.1/src/LinearMath/btVector3.h bullet3-2.86.1new/src/LinearMath/btVector3.h
*** bullet3-2.86.1/src/LinearMath/btVector3.h 2017-02-17 15:43:38.000000000 -0800
--- bullet3-2.86.1new/src/LinearMath/btVector3.h 2022-12-04 21:46:59.000000000 -0800
***************
*** 39,45 ****
#endif
! #define BT_SHUFFLE(x,y,z,w) ((w)<<6 | (z)<<4 | (y)<<2 | (x))
//#define bt_pshufd_ps( _a, _mask ) (__m128) _mm_shuffle_epi32((__m128i)(_a), (_mask) )
#define bt_pshufd_ps( _a, _mask ) _mm_shuffle_ps((_a), (_a), (_mask) )
#define bt_splat3_ps( _a, _i ) bt_pshufd_ps((_a), BT_SHUFFLE(_i,_i,_i, 3) )
--- 39,45 ----
#endif
! #define BT_SHUFFLE(x, y, z, w) (((w) << 6 | (z) << 4 | (y) << 2 | (x)) & 0xff)
//#define bt_pshufd_ps( _a, _mask ) (__m128) _mm_shuffle_epi32((__m128i)(_a), (_mask) )
#define bt_pshufd_ps( _a, _mask ) _mm_shuffle_ps((_a), (_a), (_mask) )
#define bt_splat3_ps( _a, _i ) bt_pshufd_ps((_a), BT_SHUFFLE(_i,_i,_i, 3) )
+10 -9
View File
@@ -35,13 +35,14 @@
#include <map>
#ifdef WIN32
#define DLL_EXPORT __declspec( dllexport )
#define DLL_IMPORT __declspec( dllimport )
#if defined(_WIN32) || defined(_WIN64)
#define DLL_EXPORT __declspec( dllexport )
#define DLL_IMPORT __declspec( dllimport )
#else
#define DLL_EXPORT
#define DLL_IMPORT
#define DLL_EXPORT
#define DLL_IMPORT
#endif
#ifdef __cplusplus
#define EXTERN_C extern "C"
#else
@@ -56,12 +57,12 @@ EXTERN_C DLL_EXPORT void DumpConstraint2(BulletSim* sim, btTypedConstraint* cons
#define TERRAIN_MIN_THICKNESS (0.2)
/**
* Returns a string that identifies the version of the BulletSim.dll
* @return static string of version information
* Returns a pointer to a string that identifies the version of the BulletSim.dll
* @return pointer to zero terminated static string of format BULLETENGINEVERSION,BULLETSIMVERSION ("3.25,1.3")
*/
EXTERN_C DLL_EXPORT char* GetVersion2()
EXTERN_C DLL_EXPORT const char* GetVersion2()
{
return &BulletSimVersionString[0];
return BulletSimVersionString.c_str();
}
// DEBUG DEBUG DEBUG =========================================================================================
+21 -7
View File
@@ -29,7 +29,16 @@
#ifndef ARCH_STUFF_H
#define ARCH_STUFF_H
// define types that are always 32bits (don't change on 64 bit systems)
// 20230107 RA: This file exists to create definitions for 32 vs 64 bit
// architectures. Since we're moving into the future, 32bit is old
// and is no longer a supported machine architecture.
// That said, C# floats are 32bits and, for reporting collisions and
// other interactions, item IDs are presumed to be the same size
// as a float. Therefore, IDTYPE must be 32bits.
// Define types that are always 32bits (don't change on 64 bit systems)
// 20230107 RA: the symbol _MSC_VER is only defined for Win32 and thus will
// never be true. Test and code kept for historical reference.
#ifdef _MSC_VER
typedef signed __int32 int32_t;
typedef unsigned __int32 uint32_t;
@@ -37,15 +46,20 @@
#include <inttypes.h>
#endif
// See above discussion about IDTYPE needing to be same size as a float.
#define IDTYPE uint32_t
#ifdef __x86_64__
// 64bit systems don't allow you to cast directly from a void* to an unsigned int
#define PACKLOCALID(xx) ((void*)((uint64_t)(xx)))
#define CONVLOCALID(xx) ((IDTYPE)((uint64_t)(xx)))
#else
#ifdef __x86_32__
#define PACKLOCALID(xx) ((void*)(xx))
#define CONVLOCALID(xx) ((IDTYPE)(xx))
#else
// CONVLOCALID is usually called operating on a void* which will
// be 64bit on most modern systems.
// 64bit systems don't allow you to cast directly from a void* to an
// unsigned int thus we cast it to uint64_t before chopping it to a
// IDTYPE (uint32_t).
#define PACKLOCALID(xx) ((void*)((uint64_t)(xx)))
#define CONVLOCALID(xx) ((IDTYPE)((uint64_t)(xx)))
#endif
// key used for identifying meshes and hulls
@@ -53,4 +67,4 @@
// key used to identify collisions based on the IDs of the colliding objects
#define COLLIDERKEYTYPE unsigned long long
#endif // ARCH_STUFF_H
#endif // ARCH_STUFF_H
-64
View File
@@ -1,64 +0,0 @@
The OpenSimulator BulletSPlugin expects to use a "BulletSim.dll" which provides the
linkage to the Bullet physics engine.
BulletSim.dll is written in C++ and is statically linked with the Bullet engine.
BulletSim.dll must be compiled separately as the OpenSimulator build
environment only builds the C# code.
For Windows, the steps are:
1) Fetch the latest version from GitHub: https://github.com/bulletphysics/bullet3.
cd trunk/unmanaged/BulletSim
git clone https://github.com/bulletphysics/bullet3 bullet-2
As of this writing (August 7, 2017), Bullet development is mostly doing
bug fixes on the v2 branch and new development is happening
on a new v3 branch. When Bullet advances to v3, BulletSim
will probably not build or link and will require rework.
In the mean time, any of the v2.8+ versions should work.
2) Apply all the patches for bullet:
cd bullet-2 ; for file in ../*.patch ; do cat $file | patch -p1 ; done
3) Build Bullet
3a) Windows:
The Bullet distribution has an instance of PreMake (https://premake.github.io/)
to build the Visual Studio project files.
The script buildBulletVS.bat will call premake and generate the project files.
As of August 2017, premake version 4 worked but would only generate for VS2010 (v100).
I build the BulletSim libraries with VS2012 (v110) for downward compatibility.
I let VS2012 upgrade the VS2010 project files for VS2012.
Once the project files have been built, open
"bullet-2/build3/vs2010/0_Bullet3Solution.sln" with VS2012
and do a batch compile for a Release version for 'Win32' and 'x64'.
3b) Linux and IOS:
(http://bulletphysics.org/mediawiki-1.5.8/index.php/Installation).
The script "buildBulletCMake.sh" has the appropriate cmake and compilation
commands for Linux and IOS.
(for 64bit systems, you must also add the cmake flag -DCMAKE_CXX_FLAGS="-fPIC" )
(for Mac OSX systems, you must also add the cmake flag
-DCMAKE_OSX_ARCHITECTURES=i386 as mono runs as a 32bit process on OSX)
The script builds bullet static libraries and copies them into local directories.
4) Build BulletSim
4a) Windows:
Use VS2012 to open "BulletSim.sln". Build Release version for 'Win32'
and 'x64'. The resulting DLLs will be in "Release/BulletSim.dll"
and "x64/Release/BulletSim.dll". These files are copied to
"bin/lib32/BulletSim.dll" and "bin/lib64/BulletSim.dll" in the
OpenSimulator execution tree.
4b) Linux and IOS:
Use the 'Makefile' to build BulletSim. A simple 'make' should build it.
On Linux, copy "libBulletSim.so" into the OpenSimulator "bin/lib32" or "bin/lib64"
directories depending on the architecture of your system.
On Mac OSX, copy "libBulletSim.dylib" into the OpenSimulator "bin/lib32" directory
This was developed with Bullet v2.86. If you use a different version, you will
need to change the include and library directories for the BulletSim compilation.
+127
View File
@@ -0,0 +1,127 @@
# BUILDING THINGS
The [Bullet physics engine](https://github.com/bulletphysics/bullet3) is
available for OpenSimulator using the BulletSim plugin. This functionality
is provided by several pre-built binary executables for various target
architectures. These executables include DLL's, SO's, and DYNLIB's.
BulletSim consists of the C# code that is included in the OpenSimulator
sources, this C++ "glue" code which provides the interface between the C# code
and the Bullet physics engine, and the Bullet physics engine itself.
The steps are to fetch the Bullet physics engine sources, build it, then
build the BulletSim C++ glue code and staticlly link it with the built
Bullet physics engine.
Since Bullet is supplied as a binary, there are separate versions built
for different target operating systems and machine architectures. Thus
the built binary filename includes the version of Bullet used, the build
date, and the target machine architecture. Expect to see filenames like:
- `libBulletSim-3.25-20230122-x86_64.so` (Intel arch, Linux)
- `libBulletSim-3.25-20230122-aarch64.so` (ARM 64 bit arch, Linux)
- `libBulletSim-3.25-20230122-universal.dynlib` (either x86 or ARM, IOS)
- `libBulletSim-3.25-20230122-x86.64.dll` (Intel arch, Windows)
The selection of which binary to use must be configured in OpenSimulator.
This either requires copying the correct file to as default name or
editing a `.config` file.
# NOTES
- This builds with Bullet physics engine version 3+. Before 2023,
`BulletSim.dll` was built with Bullet version 2.86. The 3.25 version
of Bullet has been tested and does not seem to make any
difference to OpenSimulator operation as most of the Bullet changes
have to do with APIs and integration with Python (thus PyBullet).
Refer to some of the `.sh` files for the process of building the
BulletSim binary with the previous version of Bullet.
- Only 64 bit architectures are supported.
# BUILDING
This "official" build scripts are called from `.github/workflows/build-dotnet6.yml`
which builds all the pieces using the Github action system.
For Linux, the script `makeBullets.sh` has the following build steps captured
in one script.
To build by hand, several scripts that are used in `build.yml`
are available. This builds the latest version of BulletSim with the latest
version of the Bullet physics engine.
1) Fetch the latest version from GitHub: https://github.com/bulletphysics/bullet3.
```
cd trunk/unmanaged/BulletSim
git clone --depth 1 --single-branch https://github.com/bulletphysics/bullet3.git
```
2) Apply all the patches for bullet:
```
cd bullet3 ; for file in ../*.patch ; do cat $file | patch -p1 ; done
```
There are some small changes that are needed for the using Bullet for
distributed physics (physics simulation in both the serve and the client).
There are separate patch files for Bullet version 2.86. These all start
with the string "2.86-". Refer to `makeBullets.sh` for an example of pulling
and patching the 2.86 version of Bullet.
3) Build the Bullet physics engine
a) Windows:
Install CMake for Windows.
`buildBulletCMake.ps1` builds the Bullet physics engine. Note that this
is a PowerShell script.
If one can not install `CMake` but has Visual Studio, `buildBulletVS.bat` will
build `bullet3/build3/vs2010/0Bullet3Solution.sln` which can be used by
any modern Visual Studio to build the Bullet physics engine.
Note that after this step, the Bullet physics engine binaries will be in
the `lib` directory and the include files must be copied into `include/`.
b) Linux and IOS:
The script "buildBulletCMake.sh" has the appropriate cmake and compilation
commands for Linux and IOS.
The script builds bullet static libraries and copies them into local directories.
```
./buildBulletCMake.sh
```
4) Build BulletSim
a) Windows:
Generate version file information:
```
bash buildVersionInfo.sh
```
Build BulletSim:
```
.\buildBulletSim.ps1
```
b) Linux and IOS:
Run BulletSim compile and link script:
```
./buildBulletSim.sh
```
This builds a file with a name like: `libBulletSim-3.25-20230111-x86_64.so`.
Copy this file in to the OpenSimulator `bin/lib64` directory and edit
`OpenSim.Region.PhysicsModule.BulletS.dll.config` to point to this file for
the machine architecture you are running on.
@@ -1,31 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BulletSim", "BulletSim-vhacd.vcxproj", "{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|Any CPU.ActiveCfg = Debug|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|Win32.ActiveCfg = Debug|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|Win32.Build.0 = Debug|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|x64.ActiveCfg = Debug|x64
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|x64.Build.0 = Debug|x64
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|Any CPU.ActiveCfg = Release|x64
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|Any CPU.Build.0 = Release|x64
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|Win32.ActiveCfg = Release|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|Win32.Build.0 = Release|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|x64.ActiveCfg = Release|x64
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -1,200 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}</ProjectGuid>
<RootNamespace>BulletSim</RootNamespace>
<Keyword>ManagedCProj</Keyword>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>false</CLRSupport>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>false</CLRSupport>
<WholeProgramOptimization>true</WholeProgramOptimization>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>false</CLRSupport>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>false</CLRSupport>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(PlatformName)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(PlatformName)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(PlatformName)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(PlatformName)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<RunCodeAnalysis Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</RunCodeAnalysis>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\bullet-2.82\src;.\vhacd;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_HAS_ITERATOR_DEBUGGING=0;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>BulletCollision_vs2010.lib;BulletDynamics_vs2010.lib;LinearMath_vs2010.lib;HACD_vs2010.lib;VHACD_Lib.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>.\bullet-2.82\lib;.\vhacd\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>true</AssemblyDebug>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\bullet-2.82\src;.\vhacd;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;_HAS_ITERATOR_DEBUGGING=0;_ITERATOR_DEBUG_LEVEL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>BulletCollision_vs2010_x64_release.lib;BulletDynamics_vs2010_x64_release.lib;LinearMath_vs2010_x64_release.lib;HACD_vs2010_x64_release.lib;VHACD_Lib_x64.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>.\bullet-2.82\lib;.\vhacd\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>true</AssemblyDebug>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.\bullet-2.82\src;.\vhacd;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>BulletCollision_vs2010.lib;BulletDynamics_vs2010.lib;LinearMath_vs2010.lib;HACD_vs2010.lib;VHACD_Lib.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>.\bullet-2.82\lib;.\vhacd\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\bullet-2.82\src;.\vhacd;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<EnablePREfast>false</EnablePREfast>
</ClCompile>
<Link>
<AdditionalDependencies>BulletCollision_vs2010_x64_release.lib;BulletDynamics_vs2010_x64_release.lib;LinearMath_vs2010_x64_release.lib;HACD_vs2010_x64_release.lib;VHACD_Lib_x64.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>.\bullet-2.82\lib;.\vhacd\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="System">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.Data">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.Xml">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="API2.cpp" />
<ClCompile Include="BulletSim.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="APIData.h" />
<ClInclude Include="ArchStuff.h" />
<ClInclude Include="BulletSim.h" />
<ClInclude Include="DebugLogic.h" />
<ClInclude Include="Util.h" />
<ClInclude Include="WorldData.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
+3 -3
View File
@@ -39,7 +39,7 @@
#if defined(__linux__) || defined(__APPLE__)
#include "HACD/hacdHACD.h"
#elif defined(_WIN32) || defined(_WIN64)
#include "../extras/HACD/hacdHACD.h"
#include "HACD/hacdHACD.h"
#else
#error "Platform type not understood."
#endif
@@ -170,8 +170,8 @@ void BulletSim::initPhysics2(ParamBlock* parms,
{
// Tell the world we're initializing and output size of types so we can
// debug mis-alignments when changing architecture.
// m_worldData.BSLog("InitPhysics: sizeof(int)=%d, sizeof(long)=%d, sizeof(long long)=%d, sizeof(float)=%d",
// sizeof(int), sizeof(long), sizeof(long long), sizeof(float));
m_worldData.BSLog("InitPhysics: sizeof(int)=%d, sizeof(long)=%d, sizeof(long long)=%d, sizeof(float)=%d",
sizeof(int), sizeof(long), sizeof(long long), sizeof(float));
// remember the pointers to pinned memory for returning collisions and property updates
maxCollisionsPerFrame = maxCollisions;
+7 -2
View File
@@ -56,8 +56,13 @@
// If defined, use the external VHACD library
// #define USEVHACD 1
// TODO: find a way to build this
static char BulletSimVersionString[] = "v0003";
// Build version string of format BULLETSIMVERSION,BULLETENGINEVERSION ("1.3,3.25")
// This expects the version information to be passed in as defined variables (-D BULLETVERSION=...)
// If the version variables are not defined, the version string is just a comma.
// This uses the "#" pre-processor operator to stringify the variable and that adjacent strings are concatinated.
#define MACRO_AS_STRING1(X) #X
#define MACRO_AS_STRING(X) MACRO_AS_STRING1(X)
static std::string BulletSimVersionString = MACRO_AS_STRING(BULLETSIMVERSION) "," MACRO_AS_STRING(BULLETVERSION);
// Helper method to determine if an object is phantom or not
static bool IsPhantom(const btCollisionObject* obj)
+12 -23
View File
@@ -1,36 +1,25 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BulletSim", "BulletSim.vcxproj", "{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}"
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33122.133
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BulletSim", "BulletSim.vcxproj", "{896C2106-25E8-49E7-822A-6E02F04F6C0B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|Any CPU.ActiveCfg = Debug|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|Win32.ActiveCfg = Debug|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|Win32.Build.0 = Debug|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|x64.ActiveCfg = Debug|x64
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Debug|x64.Build.0 = Debug|x64
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|Any CPU.ActiveCfg = Release|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|Mixed Platforms.Build.0 = Release|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|Win32.ActiveCfg = Release|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|Win32.Build.0 = Release|Win32
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|x64.ActiveCfg = Release|x64
{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}.Release|x64.Build.0 = Release|x64
{896C2106-25E8-49E7-822A-6E02F04F6C0B}.Debug|x64.ActiveCfg = Debug|x64
{896C2106-25E8-49E7-822A-6E02F04F6C0B}.Debug|x64.Build.0 = Debug|x64
{896C2106-25E8-49E7-822A-6E02F04F6C0B}.Release|x64.ActiveCfg = Release|x64
{896C2106-25E8-49E7-822A-6E02F04F6C0B}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DDE25DAE-34CA-4768-A175-A587C8FFF265}
EndGlobalSection
EndGlobal
+56 -141
View File
@@ -1,191 +1,90 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C2C20743-0BB8-4BEC-A6D1-54C516BD9040}</ProjectGuid>
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{896c2106-25e8-49e7-822a-6e02f04f6c0b}</ProjectGuid>
<RootNamespace>BulletSim</RootNamespace>
<Keyword>ManagedCProj</Keyword>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>false</CLRSupport>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>false</CLRSupport>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<UseOfMfc>false</UseOfMfc>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>false</CLRSupport>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<CLRSupport>false</CLRSupport>
<PlatformToolset>v110</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup>
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(PlatformName)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(PlatformName)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
<OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(PlatformName)\$(Configuration)\</OutDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
<IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(PlatformName)\$(Configuration)\</IntDir>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
<LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" />
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRuleSet Condition="'$(Configuration)|$(Platform)'=='Release|x64'">AllRules.ruleset</CodeAnalysisRuleSet>
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRules Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'" />
<RunCodeAnalysis Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</RunCodeAnalysis>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\bullet-2\src;.\bullet-2\Extras\ConvexDecomposition;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>BulletCollision_vs2010_debug.lib;BulletDynamics_vs2010_debug.lib;LinearMath_vs2010_debug.lib;HACD_vs2010_debug.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>.\bullet-2\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>true</AssemblyDebug>
<TargetMachine>MachineX86</TargetMachine>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>.\bullet-2\src;.\bullet-2\Extras\ConvexDecomposition;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>BulletCollision_vs2010_x64_debug.lib;BulletDynamics_vs2010_x64_debug.lib;LinearMath_vs2010_x64_debug.lib;HACD_vs2010_x64_debug.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>.\bullet-2\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AssemblyDebug>true</AssemblyDebug>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<AdditionalIncludeDirectories>.\bullet-2\src;.\bullet-2\Extras\ConvexDecomposition;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;BULLETSIM_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalIncludeDirectories>./include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>BulletCollision_vs2010.lib;BulletDynamics_vs2010.lib;LinearMath_vs2010.lib;HACD_vs2010.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>.\bullet-2\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<TargetMachine>MachineX86</TargetMachine>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<EnableUAC>false</EnableUAC>
<AdditionalLibraryDirectories>.\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>lib/BulletDynamics.lib;lib/BulletCollision.lib;lib/LinearMath.lib;lib/HACD.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalIncludeDirectories>.\bullet-2\src;.\bullet-2\Extras\ConvexDecomposition;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
<PrecompiledHeader>
</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<EnablePREfast>false</EnablePREfast>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;BULLETSIM_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<AdditionalIncludeDirectories>./include</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<AdditionalDependencies>BulletCollision_vs2010_x64_release.lib;BulletDynamics_vs2010_x64_release.lib;LinearMath_vs2010_x64_release.lib;HACD_vs2010_x64_release.lib</AdditionalDependencies>
<AdditionalLibraryDirectories>.\bullet-2\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<EnableUAC>false</EnableUAC>
<AdditionalLibraryDirectories>.\lib</AdditionalLibraryDirectories>
<AdditionalDependencies>lib/BulletDynamics.lib;lib/BulletCollision.lib;lib/LinearMath.lib;lib/HACD.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<Reference Include="System">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.Data">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
<Reference Include="System.Xml">
<CopyLocalSatelliteAssemblies>true</CopyLocalSatelliteAssemblies>
<ReferenceOutputAssembly>true</ReferenceOutputAssembly>
</Reference>
</ItemGroup>
<ItemGroup>
<ClCompile Include="API2.cpp" />
<ClCompile Include="BulletSim.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="APIData.h" />
<ClInclude Include="ArchStuff.h" />
@@ -193,6 +92,22 @@
<ClInclude Include="DebugLogic.h" />
<ClInclude Include="Util.h" />
<ClInclude Include="WorldData.h" />
<ClInclude Include="btBulletDynamicsCommon.h" />
<ClInclude Include="BulletCollision/CollisionDispatch/btGhostObject.h" />
<ClInclude Include="BulletCollision/CollisionDispatch/btSimulationIslandManager.h" />
<ClInclude Include="BulletCollision/CollisionShapes/btHeightfieldTerrainShape.h" />
<ClInclude Include="BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" />
<ClInclude Include="BulletCollision/CollisionShapes/btTriangleShape.h" />
<ClInclude Include="BulletCollision/Gimpact/btGImpactCollisionAlgorithm.h" />
<ClInclude Include="BulletCollision/Gimpact/btGImpactShape.h" />
<ClInclude Include="LinearMath/btAlignedObjectArray.h" />
<ClInclude Include="LinearMath/btMotionState.h" />
<ClInclude Include="LinearMath/btGeometryUtil.h" />
<ClInclude Include="HACD/hacdHACD.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="API2.cpp" />
<ClCompile Include="BulletSim.cpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
-69
View File
@@ -1,69 +0,0 @@
# Build BulletSim
# IDIR = /usr/local/include/bullet
# LDIR = /usr/local/lib
IDIR = ./include
LDIR = ./lib
# the Bullet libraries are linked statically so we don't have to also distribute the shared binaries
BULLETLIBS = $(LDIR)/libBulletDynamics.a $(LDIR)/libBulletCollision.a $(LDIR)/libLinearMath.a $(LDIR)/libHACD.a
#CC = gcc
CC = /usr/bin/g++
LD = /usr/bin/g++
UNAME := $(shell uname)
UNAMEPROCESSOR := $(shell uname -m)
# Kludge for building libBulletSim.so with different library dependencies
# As of 20130424, 64bit Ubuntu needs to wrap memcpy so it doesn't pull in glibc 2.14.
# The wrap is not needed on Ubuntu 32bit and, in fact, causes crashes.
ifeq ($(UNAMEPROCESSOR), x86_64)
WRAPMEMCPY = -Wl,--wrap=memcpy
else
WRAPMEMCPY =
endif
# Linux build.
ifeq ($(UNAME), Linux)
TARGET = libBulletSim-$(UNAMEPROCESSOR).so
CFLAGS = -I$(IDIR) -fPIC -g -fpermissive
LFLAGS = $(WRAPMEMCPY) -shared -Wl,-soname,$(TARGET) -o $(TARGET)
endif
# OSX build. Builds 32bit dylib on 64bit system. (Need 32bit because Mono is 32bit only).
ifeq ($(UNAME), Darwin)
TARGET = libBulletSim.dylib
# CC = clang
# LD = clang
#CFLAGS = -m32 -I$(IDIR) -fPIC -g
#LFLAGS = -m32 -dynamiclib -Wl -o $(TARGET)
#CFLAGS = -m32 -arch i386 -stdlib=libstdc++ -mmacosx-version-min=10.6 -I$(IDIR) -g
#LFLAGS = -v -m32 -arch i386 -std=c++11 -stdlib=libstdc++ -mmacosx-version-min=10.6 -dynamic -o $(TARGET)
CFLAGS = -arch i386 -arch x86_64 -std=c++11 -O3 -I$(IDIR) -g
LFLAGS = -v -dynamiclib -arch i386 -arch x86_64 -o $(TARGET)
endif
BASEFILES = API2.cpp BulletSim.cpp
SRC = $(BASEFILES)
# SRC = $(wildcard *.cpp)
BIN = $(patsubst %.cpp, %.o, $(SRC))
all: $(TARGET)
$(TARGET) : $(BIN)
$(LD) $(LFLAGS) $(BIN) $(BULLETLIBS)
%.o: %.cpp
$(CC) $(CFLAGS) -c $?
BulletSim.cpp : BulletSim.h Util.h
BulletSim.h: ArchStuff.h APIData.h WorldData.h
API2.cpp : BulletSim.h
clean:
rm -f *.o $(TARGET)
+37
View File
@@ -0,0 +1,37 @@
# BulletSim Binary Build
The BulletSim physics module for [OpenSimulator](http:opensimulator.org)
is distributed as a binary file.
The filenames are different for the various architectures and operating
system types. Names are usually:
- `BulletSim*.dll` - Windows
- `libBulletSims*.so` - Linux
- `libBulletSim*.dynlib` - IOS
The names could have architecture info in them like `x86_64`, `aarch64`, or
`universal` (with the `universal` possibly containing the images for multiple
Apple architectures).
The binary file that is selected and run is specified in the OpenSimulator
file `bin/OpenSim.Region.PhysicsModule.BulletS.dll.config` which selects
the binary file to load based on the operating system.
See the file in this directory named `BUILD.md`
for instructions on how to build the binary files.
The build steps include downloading and building the Bullet physics engine binaries
and then building and linking in the BulletSim wrapper.
There are many files in this directory related to building BulletSim using
Github actions.
Development on BulletSim is also done in
[Misterblue's BulletSim repository](https://github.com/Misterblue/BulletSim)
which has Github actions to build BulletSim for the various target
architectures.
Development for IOS has been done by
Cuga-rajal so refer to the
[opensim-apple-arm64](https://github.com/cuga-rajal/opensim_apple_arm64) repository
for that part of the world.
Cuga built and signed a BulletSim release for OpenSimulator which can
be found in the released `bin/lib64` directory of OpenSimulator.
+1
View File
@@ -0,0 +1 @@
1.3
+55
View File
@@ -0,0 +1,55 @@
# Script to build Bullet on a Windows system
$MACH="x64"
$BULLETDIR="bullet3"
$BUILDDIR="bullet-build"
cd $BULLETDIR
New-Item -ItemType Directory -Path $BUILDDIR -Force
cd $BUILDDIR
echo "=== Building Bullet in dir $BULLETDIR for arch $MACH into $BUILDDIR"
cmake -G "Visual Studio 17 2022" -A $MACH -DDOTNET_SDK=ON -DBUILD_BULLET3=ON -DBUILD_EXTRAS=ON -DBUILD_INVERSE_DYNAMIC_EXTRA=OFF -DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF -DBUILD_BULLET_ROBOTICS_EXTRA=OFF -DBUILD_OBJ2SDF_EXTRA=OFF -DBUILD_SERIALIZE_EXTRA=OFF -DBUILD_CONVEX_DECOMPOSITION_EXTRA=ON -DBUILD_HACD_EXTRA=ON -DBUILD_GIMPACTUTILS_EXTRA=OFF -DBUILD_CPU_DEMOS=OFF -DBUILD_BULLET2_DEMOS=OFF -DBUILD_ENET=OFF -DBUILD_PYBULLET=OFF -DBUILD_UNIT_TESTS=OFF -DBUILD_SHARED_LIBS=OFF -DINSTALL_EXTRA_LIBS=ON -DINSTALL_LIBS=ON -DCMAKE_BUILD_TYPE=Release ..
msbuild -p:Configuration=Release BULLET_PHYSICS.sln
# Copy the .lib files into the target lib directory
Set-Location ..\..
New-Item -ItemType Directory -Path lib -Force
Write-Host "=== Copy .lib files into the lib dir"
Get-ChildItem -Path bullet3\bullet-build\* -Include *.lib -Recurse | ForEach-Object {
# echo "----- copying $_ to lib"
Copy-Item $_ -Destination lib -Force
}
# Copy the .h and .inl files into the target include directory
Write-Host "=== Copy .h files into the include dir"
Get-ChildItem -Path bullet3\src\* -Include *.h,*.inl -Recurse | ForEach-Object {
$xxxx = $_.Fullname -replace ".*\\bullet3\\src\\","include\"
$xxxxDir = Split-Path -parent $xxxx
if ( -not (Test-Path "$xxxxDir" -PathType container)) {
echo "----- creating directory $xxxxDir"
New-Item -ItemType Directory -Path $xxxxDir -Force | Out-Null
}
echo "----- copying $_ to $xxxx"
Copy-Item $_ -Destination $xxxx -Force
}
# Copy the .h files from Extras into the target include directory
Write-Host "=== Copy Extras .h files into the include dir"
Get-ChildItem -Path bullet3\Extras\* -Include *.h,*.inl -Recurse | ForEach-Object {
$xxxx = $_.Fullname -replace ".*\\bullet3\\Extras\\","include\"
$xxxxDir = Split-Path -parent $xxxx
if ( -not (Test-Path "$xxxxDir" -PathType container)) {
echo "----- creating Extras directory $xxxxDir"
New-Item -ItemType Directory -Path $xxxxDir -Force | Out-Null
}
echo "----- copying Extras $_ to $xxxx"
Copy-Item $_ -Destination $xxxx -Force
}
# Copy Bullet's VERSION file into lib/ so BulletSim can reference it
Copy-Item -Path bullet3\VERSION -Destination lib
+159 -81
View File
@@ -3,128 +3,206 @@
STARTDIR=$(pwd)
UNAME=$(uname)
MACH=$(uname -m)
BULLET=bullet-2
# The UNAME is either "Darwin" or otherwise. Note that env variable overrides
UNAME=${BULLETUNAME:-$(uname)}
# The MACH is either 'x86_64', 'aarch64', or assumed generic. Note env variable overrides.
MACH=${BULLETMACH:-$(uname -m)}
# Note that this sets BULLETDIR unless there is an environment variable of the same name
BULLETDIR=${BULLETDIR:-bullet3}
cd $BULLET
mkdir -p bullet-build
cd bullet-build
BUILDDIR=bullet-build
cd "${BULLETDIR}"
mkdir -p "${BUILDDIR}"
cd "${BUILDDIR}"
echo "=== Building Bullet in dir ${BULLETDIR} for uname ${UNAME} and arch ${MACH} into ${BUILDDIR}"
if [[ "$UNAME" == "Darwin" ]] ; then
echo "=== Running cmake for Darwin"
cmake .. -G "Unix Makefiles" \
-DBUILD_BULLET2_DEMOS=off \
-DBUILD_BULLET3=on \
-DBUILD_CLSOCKET=off \
-DBUILD_CPU_DEMOS=off \
-DBUILD_ENET=off \
-DBUILD_EXTRAS=on \
-DBUILD_DEMOS=off \
-DBUILD_OPENGL_DEMOS=off \
-DBUILD_PYBULLET=off \
-DBUILD_SHARED_LIBS=off \
-DBUILD_UNIT_TESTS=off \
-DINSTALL_EXTRA_LIBS=on \
-DINSTALL_LIBS=on \
-DCMAKE_OSX_ARCHITECTURES="i386; x86_64" \
-DCMAKE_CXX_FLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.11" \
-DCMAKE_C_FLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.11" \
-DCMAKE_EXE_LINKER_FLAGS="-arch i386 -arch x86_64 -mmacosx-version-min=10.11" \
-DCMAKE_VERBOSE_MAKEFILE="on" \
-DBUILD_BULLET3=ON \
-DBUILD_EXTRAS=ON \
-DBUILD_INVERSE_DYNAMIC_EXTRA=OFF \
-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF \
-DBUILD_BULLET_ROBOTICS_EXTRA=OFF \
-DBUILD_OBJ2SDF_EXTRA=OFF \
-DBUILD_SERIALIZE_EXTRA=OFF \
-DBUILD_CONVEX_DECOMPOSITION_EXTRA=ON \
-DBUILD_HACD_EXTRA=ON \
-DBUILD_GIMPACTUTILS_EXTRA=OFF \
-DBUILD_CPU_DEMOS=OFF \
-DBUILD_BULLET2_DEMOS=OFF \
-DBUILD_ENET=OFF \
-DBUILD_PYBULLET=OFF \
-DBUILD_UNIT_TESTS=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DINSTALL_EXTRA_LIBS=ON \
-DINSTALL_LIBS=ON \
-DCMAKE_OSX_ARCHITECTURES="arm64; x86_64" \
-DCMAKE_CXX_FLAGS="-arch arm64 -arch x86_64" \
-DCMAKE_C_FLAGS="-arch arm64 -arch x86_64 -fPIC -O2" \
-DCMAKE_EXE_LINKER_FLAGS="-arch arm64 -arch x86_64" \
-DCMAKE_VERBOSE_MAKEFILE="on" \
-DCMAKE_BUILD_TYPE=Release
elif [[ "$UNAME" =~ "MINGW64*" ]] ; then
cmake .. -G "Visual Studio 17 2022" \
-DBUILD_BULLET3=ON \
-DBUILD_EXTRAS=ON \
-DBUILD_INVERSE_DYNAMIC_EXTRA=OFF \
-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF \
-DBUILD_BULLET_ROBOTICS_EXTRA=OFF \
-DBUILD_OBJ2SDF_EXTRA=OFF \
-DBUILD_SERIALIZE_EXTRA=OFF \
-DBUILD_CONVEX_DECOMPOSITION_EXTRA=ON \
-DBUILD_HACD_EXTRA=ON \
-DBUILD_GIMPACTUTILS_EXTRA=OFF \
-DBUILD_CPU_DEMOS=OFF \
-DBUILD_BULLET2_DEMOS=OFF \
-DBUILD_ENET=OFF \
-DBUILD_PYBULLET=OFF \
-DBUILD_UNIT_TESTS=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DINSTALL_EXTRA_LIBS=ON \
-DINSTALL_LIBS=ON \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_BUILD_TYPE=Release
else
if [[ "$MACH" == "x86_64" ]]
then
echo "=== Running cmake for arch $MACH"
cmake .. -G "Unix Makefiles" \
-DBUILD_BULLET2_DEMOS=off \
-DBUILD_BULLET3=on \
-DBUILD_CLSOCKET=off \
-DBUILD_CPU_DEMOS=off \
-DBUILD_ENET=off \
-DBUILD_EXTRAS=on \
-DBUILD_DEMOS=off \
-DBUILD_OPENGL_DEMOS=off \
-DBUILD_PYBULLET=off \
-DBUILD_SHARED_LIBS=off \
-DBUILD_UNIT_TESTS=off \
-DINSTALL_EXTRA_LIBS=on \
-DINSTALL_LIBS=on \
-DBUILD_BULLET3=ON \
-DBUILD_EXTRAS=ON \
-DBUILD_INVERSE_DYNAMIC_EXTRA=OFF \
-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF \
-DBUILD_BULLET_ROBOTICS_EXTRA=OFF \
-DBUILD_OBJ2SDF_EXTRA=OFF \
-DBUILD_SERIALIZE_EXTRA=OFF \
-DBUILD_CONVEX_DECOMPOSITION_EXTRA=ON \
-DBUILD_HACD_EXTRA=ON \
-DBUILD_GIMPACTUTILS_EXTRA=OFF \
-DBUILD_CPU_DEMOS=OFF \
-DBUILD_BULLET2_DEMOS=OFF \
-DBUILD_ENET=OFF \
-DBUILD_PYBULLET=OFF \
-DBUILD_UNIT_TESTS=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DINSTALL_EXTRA_LIBS=ON \
-DINSTALL_LIBS=ON \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_BUILD_TYPE=Release
elif [[ "$MACH" == "aarch64" ]]
then
echo "=== Running cmake for arch $MACH"
cmake .. -G "Unix Makefiles" \
-DBUILD_BULLET2_DEMOS=off \
-DBUILD_BULLET3=on \
-DBUILD_CLSOCKET=off \
-DBUILD_CPU_DEMOS=off \
-DBUILD_ENET=off \
-DBUILD_EXTRAS=on \
-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=off \
-DBUILD_BULLET_ROBOTICS_EXTRA=off \
-DBUILD_DEMOS=off \
-DBUILD_OPENGL_DEMOS=off \
-DBUILD_PYBULLET=off \
-DBUILD_SHARED_LIBS=off \
-DBUILD_UNIT_TESTS=off \
-DENABLE_VHACD=off \
-DUSE_GRAPHICAL_BENCHMARK=off \
-DBUILD_EGL=off \
-DBUILD_OPENGL3_DEMOS=off \
-DBUILD_BULLET2_DEMOS=off \
-DINSTALL_EXTRA_LIBS=on \
-DINSTALL_LIBS=on \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DBUILD_BULLET3=ON \
-DBUILD_EXTRAS=ON \
-DBUILD_INVERSE_DYNAMIC_EXTRA=OFF \
-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF \
-DBUILD_BULLET_ROBOTICS_EXTRA=OFF \
-DBUILD_OBJ2SDF_EXTRA=OFF \
-DBUILD_SERIALIZE_EXTRA=OFF \
-DBUILD_CONVEX_DECOMPOSITION_EXTRA=ON \
-DBUILD_HACD_EXTRA=ON \
-DBUILD_GIMPACTUTILS_EXTRA=OFF \
-DBUILD_CPU_DEMOS=OFF \
-DBUILD_BULLET2_DEMOS=OFF \
-DBUILD_ENET=OFF \
-DBUILD_PYBULLET=OFF \
-DBUILD_UNIT_TESTS=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DINSTALL_EXTRA_LIBS=ON \
-DINSTALL_LIBS=ON \
-DCMAKE_OSX_ARCHITECTURES="arm64" \
-DCMAKE_CXX_FLAGS="-arch arm64" \
-DCMAKE_C_FLAGS="-arch arm64 -fPIC -O2" \
-DCMAKE_EXE_LINKER_FLAGS="-arch arm64" \
-DCMAKE_BUILD_TYPE=Release
else
echo "=== Running cmake for generic arch"
cmake .. -G "Unix Makefiles" \
-DBUILD_BULLET2_DEMOS=off \
-DBUILD_BULLET3=on \
-DBUILD_CLSOCKET=off \
-DBUILD_CPU_DEMOS=off \
-DBUILD_ENET=off \
-DBUILD_EXTRAS=on \
-DBUILD_DEMOS=off \
-DBUILD_OPENGL_DEMOS=off \
-DBUILD_PYBULLET=off \
-DBUILD_SHARED_LIBS=off \
-DBUILD_UNIT_TESTS=off \
-DINSTALL_EXTRA_LIBS=on \
-DINSTALL_LIBS=on \
-DBUILD_BULLET3=ON \
-DBUILD_EXTRAS=ON \
-DBUILD_INVERSE_DYNAMIC_EXTRA=OFF \
-DBUILD_BULLET_ROBOTICS_GUI_EXTRA=OFF \
-DBUILD_BULLET_ROBOTICS_EXTRA=OFF \
-DBUILD_OBJ2SDF_EXTRA=OFF \
-DBUILD_SERIALIZE_EXTRA=OFF \
-DBUILD_CONVEX_DECOMPOSITION_EXTRA=ON \
-DBUILD_HACD_EXTRA=ON \
-DBUILD_GIMPACTUTILS_EXTRA=OFF \
-DBUILD_CPU_DEMOS=OFF \
-DBUILD_BULLET2_DEMOS=OFF \
-DBUILD_ENET=OFF \
-DBUILD_PYBULLET=OFF \
-DBUILD_UNIT_TESTS=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DINSTALL_EXTRA_LIBS=ON \
-DINSTALL_LIBS=ON \
-DCMAKE_CXX_FLAGS="-fPIC" \
-DCMAKE_BUILD_TYPE=Release
fi
fi
make -j4
# DEBUG DEBUG
echo "=== $(pwd)"
ls -l
echo "=== END"
# END DEBUG DEBUG
if [[ -e Makefile ]] ; then
echo "=== Building Makefile"
make -j4
fi
if [[ -e "BULLET_PHYSICS.sln" ]] ; then
echo "=== Building BULLET_PHYSICS.sln"
dotnet build -c Release BULLET_PHYSICS.sln
fi
# make install
# As an alternative to installation, move the .a files in to a local directory
# Good as it doesn't require admin privilages
echo "=== Cleaning out any existing lib and include directories"
cd "$STARTDIR"
rm -rf lib
rm -rf include
echo "=== Moving .a files into ../lib"
cd "$STARTDIR"
mkdir -p lib
cd "${BULLET}"
cp */*/*/*.a ../lib
#cp */*/*.a */*/*/*.a ../lib
for afile in $(find "${BULLETDIR}/${BUILDDIR}" -name *.a) ; do
cp "$afile" lib
done
echo "=== Moving .h files into ../include"
cd "$STARTDIR"
mkdir -p include
cd "${BULLET}/src"
cp *.h ../../include
cd "${BULLETDIR}/src"
for file in $(find . -name \*.h) ; do
xxxx="../../include/$(dirname $file)"
xxxx="${STARTDIR}/include/$(dirname $file)"
mkdir -p "$xxxx"
cp "$file" "$xxxx"
done
cd ../Extras
# Move Bullet's VERSION file into lib/ so BulletSim can reference it
echo "=== Moving Bullet's VERSION file into ../lib"
cd "$STARTDIR"
mkdir -p lib
cp "${BULLETDIR}/VERSION" lib/
echo "=== Moving .h files from Extras into ../include"
cd "$STARTDIR"
cd "${BULLETDIR}/Extras"
for file in $(find . -name \*.h) ; do
xxxx="../../include/$(dirname $file)"
xxxx="${STARTDIR}/include/$(dirname $file)"
mkdir -p "$xxxx"
cp "$file" "$xxxx"
done
echo "=== Moving .inl files from Extras into ../include"
for file in $(find . -name \*.inl) ; do
xxxx="../../include/$(dirname $file)"
xxxx="${STARTDIR}/include/$(dirname $file)"
mkdir -p "$xxxx"
cp "$file" "$xxxx"
done
+6
View File
@@ -0,0 +1,6 @@
set /p BULLETVERSION=<lib\VERSION
set /p BULLETSIMVERSION=<VERSION
set CL=/D BULLETVERSION=%BULLETVERSION% /D BULLETSIMVERSION=%BULLETSIMVERSION%
msbuild -p:Configuration=Release BulletSim.sln
+7
View File
@@ -0,0 +1,7 @@
$BULLETVERSION = Get-Content -Path .\lib\VERSION
$BULLETSIMVERSION = Get-Content -Path .\VERSION
Set-Item -Path Env:CL -Value "/DBULLETVERSION#$BULLETVERSION /DBULLETSIMVERSION#$BULLETSIMVERSION"
msbuild -p:Configuration=Release BulletSim.sln
+68
View File
@@ -0,0 +1,68 @@
#! /bin/bash
# Script to build BulletSim Linux binaries.
# This presumes the bins and includes for Bullet are in BLIBDIR and BINCLUDEDIR
BASE=$(pwd)
BLIBDIR=${BLIBDIR:-./lib}
BINCLUDEDIR=${BINCLUDEDIR:-./include}
# Output file is ${TARGETBASE}-${BULLETVERSION}-${BUILDDATE}-${ARCH}.so
TARGETBASE=${TARGETBASE:-libBulletSim}
# CC=gcc
# CC=/usr/bin/g++
CC=/usr/bin/c++
# LD=/usr/bin/g++
LD=/usr/bin/c++
UNAME=${UNAME:-$(uname)}
ARCH=${ARCH:-$(uname -m)}
# Version of the Bullet engine that is being statically linked
BULLETVERSION=$(cat "${BLIBDIR}/VERSION")
# Version of the BulletSim glue that is being built and included
BULLETSIMVERSION=$(cat "VERSION")
BUILDDATE=$(date "+%Y%m%d")
# Kludge for building libBulletSim.so with different library dependencies
# As of 20130424, 64bit Ubuntu needs to wrap memcpy so it doesn't pull in glibc 2.14.
# The wrap is not needed on Ubuntu 32bit and, in fact, causes crashes.
if [[ "$ARCH" == "x86_64" ]] ; then
WRAPMEMCPY=-Wl,--wrap=memcpy
else
WRAPMEMCPY=
fi
# Pass version information into compilations as C++ variables
VERSIONCFLAGS="-D BULLETVERSION=$BULLETVERSION -D BULLETSIMVERSION=$BULLETSIMVERSION"
case $UNAME in
"Linux")
TARGET=${TARGETBASE}-${BULLETVERSION}-${BUILDDATE}-${ARCH}.so
CFLAGS="-I${BINCLUDEDIR} -fPIC -g -fpermissive ${VERSIONCFLAGS}"
LFLAGS="${WRAPMEMCPY} -shared -Wl,-soname,${TARGET} -o ${TARGET}"
;;
"Darwin")
CC=gcc
LD=g++
TARGET=${TARGETBASE}-${BULLETVERSION}-${BUILDDATE}-universal.dylib
CFLAGS="-arch arm64 -arch x86_64 -O3 -I${BINCLUDEDIR} -g ${VERSIONCFLAGS}"
LFLAGS="-v -dynamiclib -arch arm64 -arch x86_64 -o ${TARGET}"
;;
*)
TARGET=${TARGETBASE}-${BULLETVERSION}-${BUILDDATE}-${ARCH}.so
CFLAGS="-I${IDIR} -fPIC -g -fpermissive ${VERSIONCFLAGS}"
LFLAGS="${WRAPMEMCPY} -shared -Wl,-soname,${TARGET} -o ${TARGET}"
;;
esac
# All of the Bullet bin files
# BULLETLIBS=$(ls ${BLIBDIR}/*.a)
BULLETLIBS="${BLIBDIR}/libBulletDynamics.a ${BLIBDIR}/libBulletCollision.a ${BLIBDIR}/libLinearMath.a ${BLIBDIR}/libHACD.a"
# Just build everything
echo "=== Building target $TARGET from BulletSim glue ${BULLETSIMVERSION} and Bullet ${BULLETVERSION}"
${CC} ${CFLAGS} -c API2.cpp
${CC} ${CFLAGS} -c BulletSim.cpp
${LD} ${LFLAGS} API2.o BulletSim.o ${BULLETLIBS}
+2 -1
View File
@@ -1,4 +1,5 @@
cd bullet-2/build3
cd bullet3/build3
.\premake4.exe --no-clsocket --no-demos --no-enet --no-gtest --no-test --noopengl3 --os=windows --targetdir=../lib vs2010
+25
View File
@@ -0,0 +1,25 @@
#! /bin/bash
# Script for building "BulletSimVersionInfoFile" which contains application and git
# version information.
# Also sets this information into the environment
# This file exists as an alternative to the building of the version info file in
# .github/workflows/build.yml
export BuildDate=$(date +%Y%m%d)
export BulletSimVersion=$(cat VERSION)
export BulletSimGitVersion=$(git rev-parse HEAD)
export BulletSimGitVersionShort=$(git rev-parse --short HEAD)
cd bullet3
export BulletVersion=$(cat VERSION)
export BulletGitVersion=$(git rev-parse HEAD)
export BulletGitVersionShort=$(git rev-parse --short HEAD)
cd ..
echo "BuildDate=$BuildDate" > BulletSimVersionInfo
echo "BulletSimVersion=$BulletSimVersion" >> BulletSimVersionInfo
echo "BulletSimGitVersion=$BulletSimGitVersion" >> BulletSimVersionInfo
echo "BulletSimGitVersionShort=$BulletSimGitVersionShort" >> BulletSimVersionInfo
echo "BulletVersion=$BulletVersion" >> BulletSimVersionInfo
echo "BulletGitVersion=$BulletGitVersion" >> BulletSimVersionInfo
echo "BulletGitVersionShort=$BulletGitVersionShort" >> BulletSimVersionInfo
+97
View File
@@ -0,0 +1,97 @@
#! /bin/bash
# Script to fetch the Bullet Physics Engine sources, build same
# using the 'buildBulletSMake.sh' script, and then build BulletSim
# .so's using 'buildBulletSim.sh'.
# This captures the steps needed and will be replaced by better scripts
# and Github actions.
#
# This can build two versions of Bullet: one of current version and another
# of Bullet version 2.86 which is the version of Bullet that was
# used in the BulletSim binaries distributed with OpenSimulator
# from 2015 to 2022.
# This also applies the BulletSim patches to the Bullet sources.
# Set these values to 'yes' or 'no' to enable/disable fetching and building
FETCHBULLETSOURCES=${FETCHBULLETSOURCES:-no}
BUILDBULLET2=${BUILDBULLET2:-no} # usually don't need the old version
BUILDBULLET3=${BUILDBULLET3:-yes}
# Note that Bullet3 sources are build in "bullet3/" and the
# these are copied into "bullet2/" and checkouted to the version 2 sources.
BASE=$(pwd)
if [[ "$FETCHBULLETSOURCES" == "yes" ]] ; then
cd "$BASE"
rm -rf bullet3
echo "=== Fetching Bullet Physics Engine sources into bullet3/"
git clone https://github.com/bulletphysics/bullet3.git
if [[ "$BUILDBULLET2" == "yes" ]] ; then
cd "$BASE"
echo "=== Creating bullet2/ of Bullet version 2.86"
rm -rf bullet2
cp -r bullet3 bullet2
cd bullet2
git checkout tags/2.86 -b tag-2.86
fi
echo "=== Applying BulletSim patches to bullet3"
cd "$BASE"
cd bullet3
for file in ../000* ; do cat $file | patch -p1 ; done
if [[ "$BUILDBULLET2" == "yes" ]] ; then
echo "=== Applying BulletSim patches to bullet2"
cd "$BASE"
cd bullet2
for file in ../2.86-00* ; do cat $file | patch -p1 ; done
fi
fi
cd "$BASE"
echo "=== Setting environment variables"
export BuildDate=$(date +%Y%m%d)
export BulletSimVersion=$(cat VERSION)
export BulletSimGitVersion=$(git rev-parse HEAD)
export BulletSimGitVersionShort=$(git rev-parse --short HEAD)
cd bullet3
export BulletVersion=$(cat VERSION)
export BulletGitVersion=$(git rev-parse HEAD)
export BulletGitVersionShort=$(git rev-parse --short HEAD)
echo "=== Creating version information file"
cd "$BASE"
rm BulletSimVersionInfo
touch BulletSimVersionInfo
echo "BuildDate=$BuildDate" > BulletSimVersionInfo
echo "BulletSimVersion=$BulletSimVersion" >> BulletSimVersionInfo
echo "BulletSimGitVersion=$BulletSimGitVersion" >> BulletSimVersionInfo
echo "BulletSimGitVersionShort=$BulletSimGitVersionShort" >> BulletSimVersionInfo
echo "BulletVersion=$BulletVersion" >> BulletSimVersionInfo
echo "BulletGitVersion=$BulletGitVersion" >> BulletSimVersionInfo
echo "BulletGitVersionShort=$BulletGitVersionShort" >> BulletSimVersionInfo
cat BulletSimVersionInfo
echo "=== removing libBulletSim-*"
rm libBulletSim-*.so
if [[ "$BUILDBULLET2" == "yes" ]] ; then
echo "=== building bullet2"
cd "$BASE"
# Build the Bullet physics engine
BULLETDIR=bullet2 ./buildBulletCMake.sh
# Build the BulletSim glue/wrapper statically linked to Bullet
./buildBulletSim.sh
fi
if [[ "$BUILDBULLET3" == "yes" ]] ; then
echo "=== building bullet3"
cd "$BASE"
# Build the Bullet physics engine
BULLETDIR=bullet3 ./buildBulletCMake.sh
# Build the BulletSim glue/wrapper statically linked to Bullet
./buildBulletSim.sh
fi