Skip to content

Fix Collision Bug and Add STEM Distance Block - #193

Open
brettfxio wants to merge 1 commit into
mainfrom
feature/stem-distance-and-collision-fix-2155587819738579984
Open

Fix Collision Bug and Add STEM Distance Block#193
brettfxio wants to merge 1 commit into
mainfrom
feature/stem-distance-and-collision-fix-2155587819738579984

Conversation

@brettfxio

Copy link
Copy Markdown
Contributor

This PR addresses a bug in the physics collision system where only the first registered callback for a specific pair of colliding objects would fire. It also introduces a new STEM-focused block, get_distance, which allows users to measure the distance between any two named objects in the 3D scene.

Key changes:

  1. Collision Logic: Updated onCollision to include a unique callbackId in the collision tracking key, allowing multiple independent collision handlers to coexist.
  2. STEM Enhancements: Added getDistance method to BabylonSceneManager and integrated it into a new Blockly block.
  3. UI Improvements: Renamed the 'Utils' category to 'Math' to better reflect its purpose and included the new distance block there.
  4. Reliability: Enhanced cleanup in destroyObject and clear to prevent stale references in the render loop.
  5. Testing: Added and executed Playwright tests to verify the fixes and the new feature.

PR created automatically by Jules for task 2155587819738579984 started by @brettfxio

- Fixed a bug in `onCollision` where multiple callbacks on the same pair of objects would shadow each other.
- Added a `get_distance` block to the Math category (formerly Utils) to calculate 3D distance between objects.
- Renamed 'Utils' category to 'Math' and updated its style for better categorization.
- Improved `destroyObject` and `clear` logic to properly clean up player references and per-frame functions.
- Verified changes with new Playwright tests for multiple collisions and distance calculations.

Co-authored-by: brettfxio <105930054+brettfxio@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant