This PR aims to fix the <m-position-probe> from triggering false-positive collision events that were happening with new users joining.
The problem was easy to reproduce by joining the 3d-web-experience in a scene with an MML object that contains an <m-position-probe> tag by opening a new tab without focusing it, or by having the server restarted by CI/CD being triggered while there was users still connected to the scene.
The cause was the container argument at the getRelativePositionAndRotationRelativeToObject function on position-utils.ts not having its matrixWorld property calculated before the new client renders its first frame (which is prevented as the new client joined through an unfocused tab, which prevents the execution the required steps)
What kind of changes does your PR introduce? (check at least one)
[X] Bugfix
[ ] Feature
[ ] Refactor
[ ] Tests
[ ] Other, please describe:
Does your PR introduce a breaking change? (check one)
[ ] Yes
[X] No
If yes, please describe its impact and migration path for existing applications:
Does your PR fulfill the following requirements?
[X] All tests are passing
[ ] The title references the corresponding issue # (if relevant)
This PR aims to fix the
<m-position-probe>
from triggering false-positive collision events that were happening with new users joining.The problem was easy to reproduce by joining the
3d-web-experience
in a scene with an MML object that contains an<m-position-probe>
tag by opening a new tab without focusing it, or by having the server restarted by CI/CD being triggered while there was users still connected to the scene.The cause was the
container
argument at thegetRelativePositionAndRotationRelativeToObject
function onposition-utils.ts
not having itsmatrixWorld
property calculated before the new client renders its first frame (which is prevented as the new client joined through an unfocused tab, which prevents the execution the required steps)What kind of changes does your PR introduce? (check at least one)
Does your PR introduce a breaking change? (check one)
If yes, please describe its impact and migration path for existing applications:
Does your PR fulfill the following requirements?