From 10c0b952f8f469c5edaafc7f758c9c06262c62ff Mon Sep 17 00:00:00 2001 From: Dragos Daian Date: Thu, 11 Jul 2024 14:51:53 +0200 Subject: [PATCH] use latest emscripten 3.1.62 (#145) Believe it or not, this fixes web build!!! --- .cargo/config.toml | 26 ++++++++++-- .github/actions/build/action.yml | 7 ---- .github/workflows/godot_builds.yml | 5 +++ .github/workflows/linux_builds.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/web_builds.yml | 16 +++---- Cargo.lock | 42 +++++++++---------- Cargo.toml | 2 +- README.md | 1 + .../godot-rapier2d/godot-rapier2d.gdextension | 4 +- bin2d/export_presets.cfg | 41 ++++++++++++++++++ bin2d/project.godot | 8 +++- bin2d/rigid_body_2d_2.gd | 12 ------ .../godot-rapier3d/godot-rapier3d.gdextension | 4 +- bin3d/rigid_body_2d.gd | 12 ------ bin3d/test.tscn | 37 ---------------- bin3d/test1.tscn | 3 -- rust-toolchain.toml | 3 +- scripts/build-web-2d.sh | 9 ++++ scripts/build-web-3d.sh | 9 ++++ scripts/build-web.sh | 10 ----- 21 files changed, 129 insertions(+), 126 deletions(-) create mode 100644 bin2d/export_presets.cfg delete mode 100644 bin2d/rigid_body_2d_2.gd delete mode 100644 bin3d/rigid_body_2d.gd delete mode 100644 bin3d/test.tscn delete mode 100644 bin3d/test1.tscn create mode 100755 scripts/build-web-2d.sh create mode 100755 scripts/build-web-3d.sh delete mode 100755 scripts/build-web.sh diff --git a/.cargo/config.toml b/.cargo/config.toml index b7a88555..cec1fab5 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -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" diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 4324e784..bbc2d6ec 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -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 @@ -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: | diff --git a/.github/workflows/godot_builds.yml b/.github/workflows/godot_builds.yml index f451f414..8cff893a 100644 --- a/.github/workflows/godot_builds.yml +++ b/.github/workflows/godot_builds.yml @@ -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 diff --git a/.github/workflows/linux_builds.yml b/.github/workflows/linux_builds.yml index 9be396e4..063f52ba 100644 --- a/.github/workflows/linux_builds.yml +++ b/.github/workflows/linux_builds.yml @@ -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: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c85d0db3..491bf77d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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: | diff --git a/.github/workflows/web_builds.yml b/.github/workflows/web_builds.yml index f8e92da1..3e4ea2bc 100644 --- a/.github/workflows/web_builds.yml +++ b/.github/workflows/web_builds.yml @@ -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: | @@ -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 diff --git a/Cargo.lock b/Cargo.lock index 611c2b0f..c1bb82c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -237,7 +237,7 @@ dependencies = [ [[package]] name = "godot" version = "0.1.1" -source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#d1eeda8663dcd2c7ed6f2d216efcc46a48dd7a6f" +source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#dff8622f086e07b172e58cb0db804f61bb368691" dependencies = [ "godot-core", "godot-macros", @@ -246,7 +246,7 @@ dependencies = [ [[package]] name = "godot-bindings" version = "0.1.1" -source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#d1eeda8663dcd2c7ed6f2d216efcc46a48dd7a6f" +source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#dff8622f086e07b172e58cb0db804f61bb368691" dependencies = [ "gdextension-api", "hashbrown", @@ -255,7 +255,7 @@ dependencies = [ [[package]] name = "godot-cell" version = "0.1.1" -source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#d1eeda8663dcd2c7ed6f2d216efcc46a48dd7a6f" +source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#dff8622f086e07b172e58cb0db804f61bb368691" dependencies = [ "hashbrown", ] @@ -263,7 +263,7 @@ dependencies = [ [[package]] name = "godot-codegen" version = "0.1.1" -source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#d1eeda8663dcd2c7ed6f2d216efcc46a48dd7a6f" +source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#dff8622f086e07b172e58cb0db804f61bb368691" dependencies = [ "godot-bindings", "hashbrown", @@ -277,7 +277,7 @@ dependencies = [ [[package]] name = "godot-core" version = "0.1.1" -source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#d1eeda8663dcd2c7ed6f2d216efcc46a48dd7a6f" +source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#dff8622f086e07b172e58cb0db804f61bb368691" dependencies = [ "glam", "godot-bindings", @@ -291,7 +291,7 @@ dependencies = [ [[package]] name = "godot-ffi" version = "0.1.1" -source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#d1eeda8663dcd2c7ed6f2d216efcc46a48dd7a6f" +source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#dff8622f086e07b172e58cb0db804f61bb368691" dependencies = [ "gensym", "godot-bindings", @@ -304,7 +304,7 @@ dependencies = [ [[package]] name = "godot-macros" version = "0.1.1" -source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#d1eeda8663dcd2c7ed6f2d216efcc46a48dd7a6f" +source = "git+https://github.com/ughuuu/gdext?branch=make-stuff-serializable#dff8622f086e07b172e58cb0db804f61bb368691" dependencies = [ "godot-bindings", "hashbrown", @@ -681,7 +681,7 @@ dependencies = [ [[package]] name = "rapier2d" version = "0.21.0" -source = "git+https://github.com/dimforge/rapier?branch=master#66b6b55ea21b6b43fd1870dba0fab3cc96a3fa4b" +source = "git+https://github.com/dimforge/rapier?branch=master#87ada34008f4a1a313ccf8c3040040bab4f10e69" dependencies = [ "approx", "arrayvec", @@ -706,7 +706,7 @@ dependencies = [ [[package]] name = "rapier2d-f64" version = "0.21.0" -source = "git+https://github.com/dimforge/rapier?branch=master#66b6b55ea21b6b43fd1870dba0fab3cc96a3fa4b" +source = "git+https://github.com/dimforge/rapier?branch=master#87ada34008f4a1a313ccf8c3040040bab4f10e69" dependencies = [ "approx", "arrayvec", @@ -731,7 +731,7 @@ dependencies = [ [[package]] name = "rapier3d" version = "0.21.0" -source = "git+https://github.com/dimforge/rapier?branch=master#66b6b55ea21b6b43fd1870dba0fab3cc96a3fa4b" +source = "git+https://github.com/dimforge/rapier?branch=master#87ada34008f4a1a313ccf8c3040040bab4f10e69" dependencies = [ "approx", "arrayvec", @@ -756,7 +756,7 @@ dependencies = [ [[package]] name = "rapier3d-f64" version = "0.21.0" -source = "git+https://github.com/dimforge/rapier?branch=master#66b6b55ea21b6b43fd1870dba0fab3cc96a3fa4b" +source = "git+https://github.com/dimforge/rapier?branch=master#87ada34008f4a1a313ccf8c3040040bab4f10e69" dependencies = [ "approx", "arrayvec", @@ -843,7 +843,7 @@ dependencies = [ [[package]] name = "salva2d" version = "0.9.0" -source = "git+https://github.com/dimforge/salva?branch=master#2c775cfa33bd343c399f58306606e0e9bcfd973b" +source = "git+https://github.com/dimforge/salva?branch=master#8ac39a3cebafed67f70860ddbea2d5faa8fccb30" dependencies = [ "approx", "fnv", @@ -859,7 +859,7 @@ dependencies = [ [[package]] name = "salva3d" version = "0.9.0" -source = "git+https://github.com/dimforge/salva?branch=master#2c775cfa33bd343c399f58306606e0e9bcfd973b" +source = "git+https://github.com/dimforge/salva?branch=master#8ac39a3cebafed67f70860ddbea2d5faa8fccb30" dependencies = [ "approx", "fnv", @@ -874,18 +874,18 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", @@ -946,9 +946,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.68" +version = "2.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" dependencies = [ "proc-macro2", "quote", @@ -1019,9 +1019,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "uuid" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5de17fd2f7da591098415cff336e12965a28061ddace43b59cb3c430179c9439" +checksum = "81dfa00651efa65069b0b6b651f4aaa31ba9e3c3ce0137aaad053604ee7e0314" dependencies = [ "getrandom", ] diff --git a/Cargo.toml b/Cargo.toml index fa435792..9b7e9df6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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] diff --git a/README.md b/README.md index b98b4154..65207fbf 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bin2d/addons/godot-rapier2d/godot-rapier2d.gdextension b/bin2d/addons/godot-rapier2d/godot-rapier2d.gdextension index 492fcc56..3972963e 100644 --- a/bin2d/addons/godot-rapier2d/godot-rapier2d.gdextension +++ b/bin2d/addons/godot-rapier2d/godot-rapier2d.gdextension @@ -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] diff --git a/bin2d/export_presets.cfg b/bin2d/export_presets.cfg new file mode 100644 index 00000000..e9788414 --- /dev/null +++ b/bin2d/export_presets.cfg @@ -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) diff --git a/bin2d/project.godot b/bin2d/project.godot index dbed573e..3d6c1e57 100644 --- a/bin2d/project.godot +++ b/bin2d/project.godot @@ -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] @@ -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" diff --git a/bin2d/rigid_body_2d_2.gd b/bin2d/rigid_body_2d_2.gd deleted file mode 100644 index e5003ec8..00000000 --- a/bin2d/rigid_body_2d_2.gd +++ /dev/null @@ -1,12 +0,0 @@ -extends PhysicsBody2D - - -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - print(get_rid()) - RapierPhysicsServer2D.body_set_extra_param(self.get_rid(), 0, 0) - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - pass diff --git a/bin3d/addons/godot-rapier3d/godot-rapier3d.gdextension b/bin3d/addons/godot-rapier3d/godot-rapier3d.gdextension index bfe83eaf..cf6704f4 100644 --- a/bin3d/addons/godot-rapier3d/godot-rapier3d.gdextension +++ b/bin3d/addons/godot-rapier3d/godot-rapier3d.gdextension @@ -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] diff --git a/bin3d/rigid_body_2d.gd b/bin3d/rigid_body_2d.gd deleted file mode 100644 index f9e526cc..00000000 --- a/bin3d/rigid_body_2d.gd +++ /dev/null @@ -1,12 +0,0 @@ -extends RigidBody2D - - -# Called when the node enters the scene tree for the first time. -func _ready() -> void: - pass - - -# Called every frame. 'delta' is the elapsed time since the previous frame. -func _process(delta: float) -> void: - #print(PhysicsServer2D.body_get_state(self, PhysicsServer2D.BODY_STATE_TRANSFORM)) - pass diff --git a/bin3d/test.tscn b/bin3d/test.tscn deleted file mode 100644 index 63737c51..00000000 --- a/bin3d/test.tscn +++ /dev/null @@ -1,37 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://d4exls53gi0df"] - -[ext_resource type="Script" path="res://rigid_body_2d.gd" id="1_4sybc"] - -[sub_resource type="CircleShape2D" id="CircleShape2D_r2n1f"] -radius = 16.6667 - -[sub_resource type="RectangleShape2D" id="RectangleShape2D_4v4tp"] - -[node name="Test" type="Node2D"] - -[node name="PinJoint2D" type="PinJoint2D" parent="."] -position = Vector2(119, -47) -node_a = NodePath("../RigidBody2D") -node_b = NodePath("../RigidBody2D5") - -[node name="RigidBody2D" type="StaticBody2D" parent="."] -position = Vector2(118, -46) - -[node name="CollisionShape2D4" type="CollisionShape2D" parent="RigidBody2D"] -shape = SubResource("CircleShape2D_r2n1f") - -[node name="RigidBody2D5" type="RigidBody2D" parent="."] -position = Vector2(54, -53) -script = ExtResource("1_4sybc") - -[node name="CollisionShape2D4" type="CollisionShape2D" parent="RigidBody2D5"] -shape = SubResource("RectangleShape2D_4v4tp") - -[node name="Camera2D" type="Camera2D" parent="."] -zoom = Vector2(4, 4) - -[node name="Timer" type="Timer" parent="."] -wait_time = 10.0 -autostart = true - -[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"] diff --git a/bin3d/test1.tscn b/bin3d/test1.tscn deleted file mode 100644 index 4a73a1be..00000000 --- a/bin3d/test1.tscn +++ /dev/null @@ -1,3 +0,0 @@ -[gd_scene format=3 uid="uid://b8gvpva4ku5n0"] - -[node name="Test1" type="Node3D"] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index b6b37c03..90e08579 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,2 @@ [toolchain] -channel = "nightly-2024-06-01" -components = [ "rustfmt", "rustc-dev" ] \ No newline at end of file +channel = "nightly-2024-07-10" diff --git a/scripts/build-web-2d.sh b/scripts/build-web-2d.sh new file mode 100755 index 00000000..d1e85121 --- /dev/null +++ b/scripts/build-web-2d.sh @@ -0,0 +1,9 @@ +cargo fmt -- --config-path rustfmt.toml +cargo clippy --fix --allow-dirty +cargo build -Zbuild-std --features="single-dim2,experimental-wasm,serde-serialize" --target wasm32-unknown-emscripten --no-default-features --release + +cp target/wasm32-unknown-emscripten/release/godot_rapier.wasm bin2d/addons/godot-rapier2d/bin/godot_rapier.wasm +cp target/wasm32-unknown-emscripten/release/godot_rapier.wasm /Users/dragosdaian/Documents/Godot-Physics-Tests/addons/godot-rapier2d/bin/godot_rapier.wasm + +#cp target/wasm32-unknown-emscripten/debug/godot_rapier.wasm bin2d/addons/godot-rapier2d/bin/godot_rapier.wasm +#cp target/wasm32-unknown-emscripten/debug/godot_rapier.wasm /Users/dragosdaian/Documents/Godot-Physics-Tests/addons/godot-rapier2d/bin/godot_rapier.wasm diff --git a/scripts/build-web-3d.sh b/scripts/build-web-3d.sh new file mode 100755 index 00000000..92b56803 --- /dev/null +++ b/scripts/build-web-3d.sh @@ -0,0 +1,9 @@ +cargo fmt -- --config-path rustfmt.toml +cargo clippy --fix --allow-dirty +cargo build -Zbuild-std --features="single-dim3,experimental-wasm,serde-serialize" --target wasm32-unknown-emscripten --no-default-features --release + +cp target/wasm32-unknown-emscripten/release/godot_rapier.wasm bin3d/addons/godot-rapier3d/bin/godot_rapier.wasm +cp target/wasm32-unknown-emscripten/release/godot_rapier.wasm /Users/dragosdaian/Documents/Godot-Physics-Tests/addons/godot-rapier3d/bin/godot_rapier.wasm + +#cp target/wasm32-unknown-emscripten/debug/godot_rapier.wasm bin2d/addons/godot-rapier2d/bin/godot_rapier.wasm +#cp target/wasm32-unknown-emscripten/debug/godot_rapier.wasm /Users/dragosdaian/Documents/Godot-Physics-Tests/addons/godot-rapier2d/bin/godot_rapier.wasm diff --git a/scripts/build-web.sh b/scripts/build-web.sh deleted file mode 100755 index d012c9a6..00000000 --- a/scripts/build-web.sh +++ /dev/null @@ -1,10 +0,0 @@ -cargo fmt -- --config-path rustfmt.toml -cargo clippy --fix --allow-dirty -set EMCC_CFLAGS=-s ERROR_ON_UNDEFINED_SYMBOLS=0 --no-entry -gsource-map -cargo build -Z build-std=panic_abort,std --features="single-dim2,experimental-wasm,wasm-bindgen" --target wasm32-unknown-emscripten --no-default-features # --release - -#cp target/wasm32-unknown-emscripten/release/godot_rapier.wasm bin2d/addons/godot-rapier2d/bin/libgodot_rapier.web.wasm32.wasm -#cp target/wasm32-unknown-emscripten/release/godot_rapier.wasm /Users/dragosdaian/Documents/Godot-Physics-Tests/addons/godot-rapier2d/bin/libgodot_rapier.web.wasm32.wasm - -cp target/wasm32-unknown-emscripten/debug/godot_rapier.wasm bin2d/addons/godot-rapier2d/bin/libgodot_rapier.web.wasm32.wasm -cp target/wasm32-unknown-emscripten/debug/godot_rapier.wasm /Users/dragosdaian/Documents/Godot-Physics-Tests/addons/godot-rapier2d/bin/libgodot_rapier.web.wasm32.wasm