Skip to content

Commit 6be49cf

Browse files
Akul Guptalynndang
authored andcommitted
[aframe-1.4.1] Update threejs patch
1 parent f80b219 commit 6be49cf

File tree

2 files changed

+47
-50
lines changed

2 files changed

+47
-50
lines changed

patches/super-three+0.137.0.patch

Lines changed: 0 additions & 50 deletions
This file was deleted.

patches/super-three+0.147.1.patch

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
diff --git a/node_modules/super-three/build/three.module.js b/node_modules/super-three/build/three.module.js
2+
index 3aea48d..c73c860 100644
3+
--- a/node_modules/super-three/build/three.module.js
4+
+++ b/node_modules/super-three/build/three.module.js
5+
@@ -26167,7 +26167,16 @@ class WebXRManager extends EventDispatcher {
6+
7+
const cameras = cameraVR.cameras;
8+
var object = poseTarget || camera;
9+
- const parent = object.parent;
10+
+ // const parent = object.parent;
11+
+ // Object is the Group Three.js node that contains the virtual camera. In 1.3.0, the
12+
+ // original code for getting the parent is:
13+
+ // const parent = object.parent;
14+
+ // In 1.2.0, the code for setting the parent local variable is:
15+
+ // const parent = camera.parent
16+
+ // Therefore, in 1.3.0 the parent was the scene, where as in 1.2.0 the parent is the Group
17+
+ // Three.js node. We want to continue the 1.2.0 behavior in order for xr-aframe to work
18+
+ // with both 1.2.0 and 1.3.0.
19+
+ const parent = camera.parent;
20+
21+
updateCamera( cameraVR, parent );
22+
23+
@@ -26181,8 +26190,13 @@ class WebXRManager extends EventDispatcher {
24+
25+
// update user camera and its children
26+
object.matrixWorld.copy( cameraVR.matrixWorld );
27+
- object.matrix.copy( cameraVR.matrix );
28+
- object.matrix.decompose( object.position, object.quaternion, object.scale );
29+
+ // AFrame 1.2.0 only copies over matrixWorld which is giving us the correct result.
30+
+ // Otherwise we are setting the group node to the origin since cameraVR local matrix is
31+
+ // the identity matrix. We then do futher work in xr-aframe to scale and correct both
32+
+ // cameraVR and object (which is sceneCamObj). By mirror 1.2.0 we are able to have our
33+
+ // code work for both. So we are removing version 1.3.0 logic here:
34+
+ // object.matrix.copy( cameraVR.matrix );
35+
+ // object.matrix.decompose( object.position, object.quaternion, object.scale );
36+
37+
const children = object.children;
38+
39+
@@ -27766,6 +27780,8 @@ function WebGLRenderer( parameters = {} ) {
40+
info.programs = programCache.programs;
41+
42+
_this.capabilities = capabilities;
43+
+ _this.attributes = attributes;
44+
+ _this.geometries = geometries;
45+
_this.extensions = extensions;
46+
_this.properties = properties;
47+
_this.renderLists = renderLists;

0 commit comments

Comments
 (0)