Skip to content

Fix Rotate on save as#611

Merged
erinharrington-12 merged 11 commits intomasterfrom
bug/rotate_on_save_as
Feb 19, 2026
Merged

Fix Rotate on save as#611
erinharrington-12 merged 11 commits intomasterfrom
bug/rotate_on_save_as

Conversation

@twells46
Copy link
Copy Markdown
Contributor

@twells46 twells46 commented Jan 6, 2026

Fixes #509.
BabylonJS uses a left-handed coordinate system, but the demobot was modeled in a right-handed system. This meant that, with a rotation of (0, 0, 0), the demobot would face left from the main camera. As a quick fix, the set origin function in src/simulator/babylonBindings/RobotBinding.ts added a 90 degree offset. However, if the origin was set more than once in a single scene (such as by clicking the "Save As" button, among a few other things), the offset would be applied again. This fixes the issue by rotating chassis.glb facing the correct direction and updating all the child nodes accordingly.

As part of this effort Node.HingeJoint now requires the perpendicular axes to be defined explicitly, rather than hidden magic numbers.

The left and right bumper switches on the demobot now match the left and right wheels (previously were opposite).

Since the iRobot Create is not part of Botball anymore, I simply removed it rather than update it's whole kinematic tree. This also fixes #518.

Copy link
Copy Markdown
Contributor

@erinharrington-12 erinharrington-12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulled locally and approved.

@erinharrington-12 erinharrington-12 merged commit a75c7c2 into master Feb 19, 2026
5 checks passed
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.

Create 2 functions do not work in simulator Saving a scene rotates robot

2 participants