Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use latest emscripten 3.1.62 #145

Merged
merged 16 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,27 @@
[target.wasm32-unknown-emscripten]
rustflags = [
"-C", "link-args=-sSIDE_MODULE=2",
#"-C", "link-args=-pthread", # was -sUSE_PTHREADS=1 in earlier emscripten versions
"-C", "target-feature=+atomics,+bulk-memory,+mutable-globals",
"-Zlink-native-libraries=no"
"-C",
"link-args=-sSIDE_MODULE=2",
"-C",
"link-args=-pthread", # was -sUSE_PTHREADS=1 in earlier emscripten versions
"-C",
"target-feature=+atomics,+bulk-memory,+mutable-globals",
"-Clink-args=-sEXPORT_ALL=1",
# Trying out stuff
# "-Clink-arg=-O0",
# "-Clink-arg=-g",
# "-Clink-arg=-sASSERTIONS=2",
# "-Clink-arg=-sDEMANGLE_SUPPORT=1",
# "-Clink-arg=-sEMULATE_FUNCTION_POINTER_CASTS",
# ---
"-Clink-arg=-fwasm-exceptions",
"-C",
"link-args=-sSUPPORT_LONGJMP=wasm",
"-Cllvm-args=-enable-emscripten-cxx-exceptions=0",
"-Cllvm-args=-wasm-enable-sjlj",
"-C",
"link-args=-sDISABLE_EXCEPTION_CATCHING=1",
"-Zlink-native-libraries=no",
]
[target.armv7-linux-androideabi]
linker = "armv7a-linux-androideabi31-clang"
Expand Down
7 changes: 0 additions & 7 deletions .github/actions/build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ inputs:
required: false
default: ''
description: Rust extra flags.
env_flags:
required: false
default: ''
description: RUSTFLAGS env var.
features:
required: true
description: simd-nightly,simd-stable,parallel,enhanced-determinism
Expand All @@ -29,9 +25,6 @@ runs:
shell: sh
run: |
cargo build --target=${{ inputs.arch }} --release --features="${{ inputs.features }}" ${{ inputs.extra_flags}} --no-default-features
env:
RUSTFLAGS: ${{ inputs.env_flags }}
EMCC_CFLAGS: "-s ERROR_ON_UNDEFINED_SYMBOLS=0 --no-entry -gsource-map -s STANDALONE_WASM"
- name: Copy to release
shell: sh
run: |
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/godot_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ jobs:
name: godot-rapier-${{ matrix.dimensions }}-${{ matrix.precision }}-${{ matrix.features }}-gdext
path: |
bin${{ matrix.dimensions }}
!bin${{ matrix.dimensions }}/test/*
!bin${{ matrix.dimensions }}/export_presets.cfg
!bin${{ matrix.dimensions }}/project.godot
!bin${{ matrix.dimensions }}/test.gd
!bin${{ matrix.dimensions }}/test.tscn
if-no-files-found: error
2 changes: 1 addition & 1 deletion .github/workflows/linux_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Copy to bin
shell: sh
run: |
mv target/release/libgodot_rapier.so bin${{ matrix.dimensions.short }}/addons/godot-rapier${{ matrix.dimensions.short }}/bin/libgodot_rapier.linux.so
mv target/release/libgodot_rapier.so bin${{ matrix.dimensions.short }}/addons/godot-rapier${{ matrix.dimensions.short }}/bin/libgodot_rapier.linux.${{ matrix.arch }}.so
- name: Upload
uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
zip -r "godot-rapier-3d-single-enhanced-determinism.zip" godot-rapier-3d-single-enhanced-determinism
zip -r "godot-rapier-3d-single-simd-parallel.zip" godot-rapier-3d-single-simd-parallel
- name: Release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
name: Godot Rapier Nightly
files: |
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/web_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,15 @@ jobs:
arch: ["wasm32-unknown-emscripten"]
precision: [single]
dimensions: [{"feature": "dim2", "short": "2d"}, {"feature": "dim3", "short": "3d"}]
features: [{"feature":"serde-serialize", "name": "normal"}, {"feature":"enhanced-determinism,serde-serialize", "name": "enhanced-determinism"}]
features: [{"feature":"serde-serialize", "name": "simd-parallel"}, {"feature":"enhanced-determinism,serde-serialize", "name": "enhanced-determinism"}]

steps:
- uses: actions/checkout@v4

- name: Set up Emscripten latest
uses: mymindstorm/setup-emsdk@v12
uses: mymindstorm/setup-emsdk@v14
with:
#version: 3.1.62
version: 3.1.39
no-cache: false
version: 3.1.62

- name: Verify Emscripten setup
run: |
Expand All @@ -31,24 +29,22 @@ jobs:
- name: Rust Install Nightly
run: |
rustup component add rust-src
rustup target add wasm32-unknown-emscripten

- name: Build
uses: ./.github/actions/build
with:
arch: ${{ matrix.arch }}
extra_flags: "-Z build-std=panic_abort,std"
extra_flags: "-Z build-std=std"
precision: ${{ matrix.precision }}
features: ${{ matrix.features.feature }},${{ matrix.precision }}-${{ matrix.dimensions.feature }},experimental-wasm,wasm-bindgen
env_flags: "-C target-feature=+atomics,+bulk-memory"
- name: Copy to bin
shell: sh
run: |
mv target/release/godot_rapier.wasm bin${{ matrix.dimensions.short }}/addons/godot-rapier${{ matrix.dimensions.short }}/bin/libgodot_rapier.wasm
mv target/release/godot_rapier.wasm bin${{ matrix.dimensions.short }}/addons/godot-rapier${{ matrix.dimensions.short }}/bin/godot_rapier.wasm
- name: Upload
uses: actions/upload-artifact@v4
with:
name: godot-rapier-${{ matrix.dimensions.short }}-${{ matrix.precision }}-${{ matrix.features.name }}-${{ matrix.arch}}
name: godot-rapier-${{ matrix.dimensions.short }}-${{ matrix.precision }}-${{ matrix.features.name }}-${{ matrix.arch }}
path: |
bin${{ matrix.dimensions.short }}/**/*.wasm
if-no-files-found: error
Expand Down
42 changes: 21 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "godot-rapier"
version = "0.7.0"
edition = "2021"
license = "MIT"
rust-version = "1.78"
rust-version = "1.81"
publish = false

[lib]
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ After installing, go to `Advanced Settings` -> `Physics` -> `2D` or `3D`. Change
- No support for asymetric collisions (eg. object 1 hitting object 2 but object 2 not hitting object 1). More info here [Rapier Collision groups and solver groups](https://rapier.rs/docs/user_guides/rust/colliders/#collision-groups-and-solver-groups). This is the exact check rapier does: `(A.layer & B.mask) != 0 && (B.layer & A.mask) != 0`
- Friction works differently than it does in Godot. The current formula is: friction is multiplied by other friction, bounce is taken the max value.
- Setting Center of Mass to Custom or Custom Inertia doesn't work right now.
- On web you cannot run both Rapier2D and Rapier3D at the same time.

# Platforms

Expand Down
4 changes: 2 additions & 2 deletions bin2d/addons/godot-rapier2d/godot-rapier2d.gdextension
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ linux.release.x86_64 = "bin/libgodot_rapier.linux.x86_64-unknown-linux-gnu.so"
#android.release.arm64 = "bin/libgodot_rapier.android.arm64.so"
ios.debug = "bin/libgodot_rapier.ios.framework"
ios.release = "bin/libgodot_rapier.ios.framework"
web.debug.wasm32 = "bin/libgodot_rapier.web.wasm32.wasm"
web.release.wasm32 = "bin/libgodot_rapier.web.wasm32.wasm"
web.debug.wasm32 = "bin/godot_rapier.wasm"
web.release.wasm32 = "bin/godot_rapier.wasm"

[icons]

Expand Down
41 changes: 41 additions & 0 deletions bin2d/export_presets.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
[preset.0]

name="Web"
platform="Web"
runnable=true
advanced_options=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path=""
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
script_export_mode=2

[preset.0.options]

custom_template/debug=""
custom_template/release=""
variant/extensions_support=true
variant/thread_support=true
vram_texture_compression/for_desktop=true
vram_texture_compression/for_mobile=false
html/export_icon=true
html/custom_html_shell=""
html/head_include=""
html/canvas_resize_policy=2
html/focus_canvas_on_start=true
html/experimental_virtual_keyboard=false
progressive_web_app/enabled=false
progressive_web_app/ensure_cross_origin_isolation_headers=true
progressive_web_app/offline_page=""
progressive_web_app/display=1
progressive_web_app/orientation=0
progressive_web_app/icon_144x144=""
progressive_web_app/icon_180x180=""
progressive_web_app/icon_512x512=""
progressive_web_app/background_color=Color(0, 0, 0, 1)
8 changes: 7 additions & 1 deletion bin2d/project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ config_version=5
[application]

config/name="Godot Rapier 2D"
config/features=PackedStringArray("4.3", "Forward Plus")
run/main_scene="res://samples/softbody2d/create-a-softbody/create.tscn"
config/features=PackedStringArray("4.3")
config/icon="res://addons/godot-rapier2d/logo_square_2d.png"

[display]

Expand All @@ -27,3 +29,7 @@ enabled=PackedStringArray()
2d/physics_engine="Rapier2D"
3d/default_gravity=10.0
rapier/solver/polygon_contact_skin=5.62998

[rendering]

renderer/rendering_method="mobile"
12 changes: 0 additions & 12 deletions bin2d/rigid_body_2d_2.gd

This file was deleted.

Loading
Loading