Bullet Physics wrapper for Heaps
Supports both HashLink and JS output thanks to WebIDL
-
Clone this repository
-
Run the following commands, they download the Bullet physics library into the lib dir.
git submodule init
git submodule update
- Make sure you have hashlink installed in two directories above the current one:
/hashlink <- hashlink git repo
/libs
/bullet <- the current git repository
- First run
haxe bullet_hl.hxml
, then check the platform specific instructions:
- Run CMake, and make sure the variable
HASHLINK_DIR
is correct. - Compile the created Visual Studio solution.
- Place
bullet.hdll
where you have your other.hdll
s
- Currently compiling only works with
GCC
- Install CMake:
brew install cmake
- Install GCC:
brew install gcc
- Run the following command, and make sure the paths to
gcc
andg++
are correctcmake -DCMAKE_C_COMPILER=/usr/local/bin/gcc-9 -DCMAKE_CXX_COMPILER=/usr/local/bin/g++-9 . -G"Unix Makefiles"
- Build:
make
- If compilation was successful, install the
.hdll
make install
- This should work the same way as MacOS, except install GCC and CMake using your preferred package manager.
-
Install the webidl haxe package:
haxelib git webidl https://github.com/jefvel/webidl.git
. -
Install Emscripten
-
Make sure the env variable
EMSDK
is set, pointing to theemsdk
directory. -
Run
haxe bullet_js.hxml
This should generate the files bullet.js
and bullet.wasm
.
Check out the sample html and haxe file on how to load it.
First compile bullet as shown in the compilation section. Once that is done it should be possible to build the samples.
(You have to add the haxelib locally):
haxelib dev bullet $(pwd)
After building the JS sample, make sure to
copy bullet.js
and bullet.wasm
into the sample directory.