Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Partially fix rotating and scaling via the spacebar menu buttons
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.
- Loading branch information