ssarg fix the ae2 conflict and the raper3d getpose non-unwinding panic#1396
Open
mynameisgrass wants to merge 1 commit into
Open
ssarg fix the ae2 conflict and the raper3d getpose non-unwinding panic#1396mynameisgrass wants to merge 1 commit into
mynameisgrass wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens the Rapier JNI bridge and related pipeline code to avoid crashes/panics when physics objects are missing or native calls fail, and adds additional diagnostics while adjusting build metadata.
Changes:
- Rust: make rigid-body lookups fallible (
Option) and guard multiple JNI entrypoints against missing IDs. - Rust: make joint and box removal paths tolerate missing rigid body mappings.
- Java: add
[SableDebug]logging and exception logging around key native calls; update project version/credits.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sable_rapier/src/main/rust/rapier/src/lib.rs | Switch rigid body accessors to Option and guard several JNI functions from panicking on missing IDs. |
| sable_rapier/src/main/rust/rapier/src/joints.rs | Add helper to resolve rigid bodies (including ground) and return sentinel on missing mapping instead of panicking. |
| sable_rapier/src/main/rust/rapier/src/boxes.rs | Make removeBox tolerant of missing rigid-body mapping. |
| sable_rapier/src/main/java/dev/ryanhcode/sable/physics/impl/rapier/RapierPhysicsPipeline.java | Add debug/error logging and try/catch around native calls; adjust wake-up path to use Rapier3D.getID. |
| gradle.properties | Update version suffix and credits list. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+524
to
+536
| if let Some(rb) = get_rigid_body(&sim_data, &sable_data, id as LevelColliderID) { | ||
| let arr: [jdouble; 7] = [ | ||
| rb.translation().x as jdouble, | ||
| rb.translation().y as jdouble, | ||
| rb.translation().z as jdouble, | ||
| rb.rotation().x as jdouble, | ||
| rb.rotation().y as jdouble, | ||
| rb.rotation().z as jdouble, | ||
| rb.rotation().w as jdouble, | ||
| ]; | ||
|
|
||
| let _ = env.set_double_array_region(&store, 0, &arr); | ||
| } |
Comment on lines
+1359
to
+1363
| if let Some(rb) = get_rigid_body(&sim_data, &sable_data, id as LevelColliderID) { | ||
| let vel = rb.linvel(); | ||
|
|
||
| let vel = rb.linvel(); | ||
|
|
||
| _env.set_double_array_region( | ||
| &store, | ||
| 0, | ||
| &[vel.x as jdouble, vel.y as jdouble, vel.z as jdouble], | ||
| ) | ||
| .unwrap(); | ||
| _env.set_double_array_region( | ||
| &store, |
Comment on lines
+1387
to
+1391
| if let Some(rb) = get_rigid_body(&sim_data, &sable_data, id as LevelColliderID) { | ||
| let vel = rb.angvel(); | ||
|
|
||
| _env.set_double_array_region( | ||
| &store, | ||
| 0, | ||
| &[vel.x as jdouble, vel.y as jdouble, vel.z as jdouble], | ||
| ) | ||
| .unwrap(); | ||
| _env.set_double_array_region( | ||
| &store, |
Comment on lines
118
to
122
| @Override | ||
| public void init(@Nullable final Vector3dc gravity, final double universalDrag) { | ||
| try { | ||
| Sable.LOGGER.info("[SableDebug] Initializing Rapier physics pipeline with gravity=({}, {}, {}), drag={}", gravity.x(), gravity.y(), gravity.z(), universalDrag); | ||
| this.scene = new RapierPhysicsScene(Rapier3D.initialize(gravity.x(), gravity.y(), gravity.z(), universalDrag)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.