Fix Collision Bug and Add STEM Distance Block - #193
Conversation
- 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>
|
👋 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 New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
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:
onCollisionto include a uniquecallbackIdin the collision tracking key, allowing multiple independent collision handlers to coexist.getDistancemethod toBabylonSceneManagerand integrated it into a new Blockly block.destroyObjectandclearto prevent stale references in the render loop.PR created automatically by Jules for task 2155587819738579984 started by @brettfxio