Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Partially fix rotating and scaling via the spacebar menu buttons #6514

Draft
wants to merge 1 commit into
base: addons
Choose a base branch
from

Conversation

Exairnous
Copy link
Contributor

Pass the eid of the object to the updateRigidBody function instead of the bodyId for the bitECS versions of rotating and scaling via the spacebar menu buttons. updateRigidBody attempts to get the bodyId from the eid, so doing it beforehand prevented the body from being found.

Update the check for whether the aframe object is a rigid body by checking for the "body-helper" attribute. This allows the update of the object to be kinematic to go through when the spacebar rotate/scale buttons are engaged.

Check if what is being hovered over when grabbing something is a HoldableButton and if it is, then use that as the hold target instead of the 3D object. This causes the grab to interact with the button and start the transform instead of just moving the object.

Note: if you attempt to throw the object in the aframe loader and then try to rotate it again with the button, the physics system will fight it for some reason and prevent the rotation. Clicking on the object a couple times will cause the physics system to release it, but the reason for this behavior is unknown; it could possibly be related to ownership not being set properly or the rigid body not being updated properly. This behavior was fixed on the bitECS side by passing the eid instead of the bodyId to the updateRigidBody function, but activating the rigid body update on the aframe side (mentioned above) didn't fix it for the aframe side.

@Exairnous Exairnous changed the base branch from master to addons November 18, 2024 06:00
Pass the eid of the object to the updateRigidBody function instead of the bodyId for the bitECS versions of rotating and scaling via the spacebar menu buttons.  updateRigidBody attempts to get the bodyId from the eid, so doing it beforehand prevented the body from being found.

Update the check for whether the aframe object is a rigid body by checking for the "body-helper" attribute.  This allows the update of the object to be kinematic to go through when the spacebar rotate/scale buttons are engaged.

Check if what is being hovered over when grabbing something is a HoldableButton and if it is, then use that as the hold target instead of the 3D object.  This causes the grab to interact with the button and start the transform instead of just moving the object.

Note: if you attempt to throw the object in the aframe loader and then try to rotate it again with the button, the physics system will fight it for some reason and prevent the rotation.  Clicking on the object a couple times will cause the physics system to release it, but the reason for this behavior is unknown; it could possibly be related to ownership not being set properly or the rigid body not being updated properly.  This behavior was fixed on the bitECS side by passing the eid instead of the bodyId to the updateRigidBody function, but activating the rigid body update on the aframe side (mentioned above) didn't fix it for the aframe side.
@Exairnous Exairnous force-pushed the fix-holdable-button-interactions branch from 84b647f to 9ffe97b Compare November 18, 2024 06:11
@Exairnous Exairnous marked this pull request as draft November 18, 2024 06:12
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