You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update XRRay vector constructor to use correct webidl semantics (#85)
* Fix webidl for XRRay
* Update XRRay vector constructor to use correct webidl semantics
Fixes#84
This adds a new initializer type so that the defaults work correctly.
* Throw error for non-1 w coordinate for XRRay constructor's position
* Throw on nonzero direction.w
1. If |origin| was set, initialize |ray|'s {{XRRay/origin}}’s {{DOMPointReadOnly/x}} value to |origin|'s x dictionary member, {{DOMPointReadOnly/y}} value to |origin|'s y dictionary member, and {{DOMPointReadOnly/z}} value to |origin|'s z dictionary member.
571
-
1. If |direction| was set, initialize |ray|'s {{XRRay/direction}}’s {{DOMPointReadOnly/x}} value to |direction|'s x dictionary member, {{DOMPointReadOnly/y}} value to |direction|'s y dictionary member, and {{DOMPointReadOnly/z}} value to |direction|'s z dictionary member.
584
+
1. If all of |direction|'s {{XRRayDirectionInit/x}}, {{XRRayDirectionInit/y}}, and {{XRRayDirectionInit/z}} are zero, throw a {{TypeError}} and abort these steps.
585
+
1. If |direction|'s {{XRRayDirectionInit/w}} is not 0.0, throw a {{TypeError}} and abort these steps.
586
+
1. If |origin|'s {{DOMPointInit/w}} is not 1.0, throw a {{TypeError}} and abort these steps.
587
+
1. Initialize |ray|'s {{XRRay/origin}}’s {{DOMPointReadOnly/x}} value to |origin|'s {{DOMPointInit/x}}, {{DOMPointReadOnly/y}} value to |origin|'s {{DOMPointInit/y}}, and {{DOMPointReadOnly/z}} value to |origin|'s {{DOMPointInit/z}}.
588
+
1. Initialize |ray|'s {{XRRay/direction}}’s {{DOMPointReadOnly/x}} value to |direction|'s {{XRRayDirectionInit/x}}, {{DOMPointReadOnly/y}} value to |direction|'s {{XRRayDirectionInit/y}}, and {{DOMPointReadOnly/z}} value to |direction|'s {{XRRayDirectionInit/z}}.
572
589
1. [=Normalize=] the {{DOMPointReadOnly/x}}, {{DOMPointReadOnly/y}}, and {{DOMPointReadOnly/z}} components of |ray|'s {{XRRay/direction}}.
573
590
1. Initialize |ray|'s [=XRRay/matrix=] to <code>null</code>.
0 commit comments