Made it explicit which realm each object gets created in#1023
Made it explicit which realm each object gets created in#1023toji merged 1 commit intoimmersive-web:masterfrom
Conversation
|
Fixes part of #497, in that every XR object now has a well-defined relevant realm. |
|
Mostly this was routine, but there were a few odd cases:
|
toji
left a comment
There was a problem hiding this comment.
This is great! Thank you so much for taking the time to do this!
| 1. Let |transform| be a new {{XRRigidTransform}}. | ||
| 1. If |position| is not a {{DOMPointInit}} initialize |transform|'s {{XRRigidTransform/position}} to <code>{ x: 0.0, y: 0.0, z: 0.0, w: 1.0 }</code>. | ||
| 1. Let |transform| be a [=new=] {{XRRigidTransform}} in the [=current realm=]. | ||
| 1. Let |transform|'s {{XRRigidTransform/position}} be a [=new=] {{DOMPointReadOnly}} in the [=current realm=]. |
There was a problem hiding this comment.
Was worried that we lost something in this section, but since the constructor defaults line up with what we had originally specified this is a nice cleanup. Thanks!
| 1. Set |result|'s {{XRRigidTransform/orientation}} to the quaternion that describes the rotation indicated by the top left 3x3 sub-matrix of |result|'s {{XRRigidTransform/matrix}}. | ||
| 1. Set |result|'s {{XRRigidTransform/position}} to the vector given by the fourth column of |result|'s {{XRRigidTransform/matrix}}. | ||
| 1. Let |result| be a [=new=] {{XRRigidTransform}} object in |realm|. | ||
| 1. Set |result|'s {{XRRigidTransform/matrix}} to a [=new=] {{Float32Array}} in |realm|, the result of premultiplying |B|'s {{XRRigidTransform/matrix}} from the left onto |A|'s {{XRRigidTransform/matrix}}. |
There was a problem hiding this comment.
tbh it feels like this step should instead use an abstract [=matrix=] variable since XRRigidTransform lazy-inits matrices
There was a problem hiding this comment.
Oh, not really worth it.
I wish I had the time to do the matrix infra spec so that this stuff wouldn't be necessary. We'd also be able to directly spec rigid transforms so there's no decomp-recomp going on
Added text for each object creation saying which realm they get created in.
Preview | Diff