three-stdlib 2.7.0 → 2.7.1
Sign up to get free protection for your applications and to get access to all the features.
- package/{Nodes-ec4e1143.js → Nodes-894ac9dc.js} +0 -0
- package/{Nodes-427f68b0.js → Nodes-af575af7.js} +0 -0
- package/controls/ArcballControls.cjs.js +1 -1
- package/controls/ArcballControls.d.ts +4 -6
- package/controls/ArcballControls.js +188 -220
- package/controls/TransformControls.cjs.js +1 -1
- package/controls/TransformControls.d.ts +2 -1
- package/controls/TransformControls.js +25 -26
- package/geometries/TeapotGeometry.js +2 -2
- package/index.cjs.js +1 -1
- package/loaders/GLTFLoader.js +1 -3
- package/loaders/NodeMaterialLoader.cjs.js +1 -1
- package/loaders/STLLoader.js +7 -7
- package/nodes/accessors/CameraNode.js +12 -12
- package/nodes/accessors/PositionNode.js +3 -3
- package/nodes/accessors/ReflectNode.js +3 -3
- package/nodes/core/FunctionNode.js +3 -3
- package/nodes/core/InputNode.js +3 -3
- package/nodes/core/Node.js +6 -6
- package/nodes/core/TempNode.js +6 -6
- package/nodes/effects/BlurNode.js +3 -3
- package/nodes/math/MathNode.js +3 -3
- package/nodes/utils/VelocityNode.js +6 -6
- package/package.json +2 -2
- package/renderers/nodes/accessors/UVNode.js +1 -3
- package/renderers/nodes/core/AttributeNode.js +1 -3
- package/renderers/nodes/core/Node.js +4 -12
- package/renderers/nodes/core/NodeBuilder.js +6 -18
- package/webxr/ARButton.js +6 -6
- package/webxr/VRButton.js +6 -6
package/loaders/GLTFLoader.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),s=require("../Nodes-
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),s=require("../Nodes-894ac9dc.js");require("../nodes/core/Node.cjs.js"),require("../nodes/core/TempNode.cjs.js"),require("../nodes/core/InputNode.cjs.js"),require("../nodes/core/ConstNode.cjs.js"),require("../nodes/core/VarNode.cjs.js"),require("../nodes/core/StructNode.cjs.js"),require("../nodes/core/AttributeNode.cjs.js"),require("../nodes/core/FunctionNode.cjs.js"),require("../nodes/core/NodeLib.cjs.js"),require("../nodes/core/ExpressionNode.cjs.js"),require("../nodes/core/FunctionCallNode.cjs.js"),require("../nodes/core/NodeUtils.cjs.js"),require("../nodes/core/NodeFrame.cjs.js"),require("../nodes/core/NodeUniform.cjs.js"),require("../nodes/core/NodeBuilder.cjs.js"),require("../nodes/inputs/Vector2Node.cjs.js"),require("../nodes/inputs/Vector3Node.cjs.js"),require("../nodes/inputs/Vector4Node.cjs.js"),require("../nodes/inputs/TextureNode.cjs.js"),require("../nodes/accessors/UVNode.cjs.js"),require("../nodes/utils/ColorSpaceNode.cjs.js"),require("../nodes/inputs/CubeTextureNode.cjs.js"),require("../nodes/accessors/ReflectNode.cjs.js"),require("../nodes/accessors/PositionNode.cjs.js"),require("../nodes/accessors/NormalNode.cjs.js"),require("../nodes/misc/TextureCubeNode.cjs.js"),require("../nodes/inputs/FloatNode.cjs.js"),require("../nodes/misc/TextureCubeUVNode.cjs.js"),require("../nodes/math/OperatorNode.cjs.js"),require("../nodes/math/MathNode.cjs.js"),require("../nodes/inputs/BoolNode.cjs.js"),require("../nodes/inputs/IntNode.cjs.js"),require("../nodes/inputs/ColorNode.cjs.js"),require("../nodes/inputs/Matrix3Node.cjs.js"),require("../nodes/inputs/Matrix4Node.cjs.js"),require("../nodes/inputs/ScreenNode.cjs.js"),require("../nodes/inputs/ReflectorNode.cjs.js"),require("../nodes/inputs/PropertyNode.cjs.js"),require("../nodes/inputs/RTTNode.cjs.js"),require("../nodes/materials/NodeMaterial.cjs.js"),require("../nodes/materials/nodes/RawNode.cjs.js"),require("../nodes/accessors/ColorsNode.cjs.js"),require("../nodes/accessors/CameraNode.cjs.js"),require("../nodes/accessors/LightNode.cjs.js"),require("../nodes/accessors/ScreenUVNode.cjs.js"),require("../nodes/accessors/ResolutionNode.cjs.js"),require("../nodes/math/CondNode.cjs.js"),require("../nodes/procedural/NoiseNode.cjs.js"),require("../nodes/procedural/CheckerNode.cjs.js"),require("../nodes/misc/NormalMapNode.cjs.js"),require("../nodes/misc/BumpMapNode.cjs.js"),require("../nodes/utils/BypassNode.cjs.js"),require("../nodes/utils/JoinNode.cjs.js"),require("../nodes/utils/SwitchNode.cjs.js"),require("../nodes/utils/TimerNode.cjs.js"),require("../nodes/utils/VelocityNode.cjs.js"),require("../nodes/utils/UVTransformNode.cjs.js"),require("../nodes/utils/MaxMIPLevelNode.cjs.js"),require("../nodes/utils/SpecularMIPLevelNode.cjs.js"),require("../nodes/utils/SubSlotNode.cjs.js"),require("../nodes/effects/BlurNode.cjs.js"),require("../nodes/effects/ColorAdjustmentNode.cjs.js"),require("../nodes/effects/LuminanceNode.cjs.js"),require("../nodes/materials/nodes/BasicNode.cjs.js"),require("../nodes/materials/nodes/SpriteNode.cjs.js"),require("../nodes/materials/nodes/PhongNode.cjs.js"),require("../nodes/materials/nodes/StandardNode.cjs.js"),require("../nodes/materials/nodes/MeshStandardNode.cjs.js"),require("../nodes/materials/BasicNodeMaterial.cjs.js"),require("../nodes/materials/SpriteNodeMaterial.cjs.js"),require("../nodes/materials/PhongNodeMaterial.cjs.js"),require("../nodes/materials/StandardNodeMaterial.cjs.js"),require("../nodes/materials/MeshStandardNodeMaterial.cjs.js"),require("../nodes/postprocessing/NodePostProcessing.cjs.js");class r extends e.Loader{constructor(e,s={}){super(e),this.nodes={},this.materials={},this.passes={},this.names={},this.library=s}load(s,r,o,i){const t=this,d=new e.FileLoader(t.manager);return d.setPath(t.path),d.load(s,(function(e){r(t.parse(JSON.parse(e)))}),o,i),this}getObjectByName(e){return this.names[e]}getObjectById(e){return this.library[e]||this.nodes[e]||this.materials[e]||this.passes[e]||this.names[e]}getNode(e){const s=this.getObjectById(e);return s||console.warn('Node "'+e+'" not found.'),s}resolve(e){switch(typeof e){case"boolean":case"number":return e;case"string":return/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.test(e)||this.library[e]?this.getNode(e):e;default:if(Array.isArray(e))for(let s=0;s<e.length;s++)e[s]=this.resolve(e[s]);else for(const s in e)"uuid"!==s&&(e[s]=this.resolve(e[s]))}return e}declare(e){let r,o,i;for(r in e.nodes)o=e.nodes[r],i=new s.Nodes[o.nodeType+"Node"],o.name&&(i.name=o.name,this.names[i.name]=i),this.nodes[r]=i;for(r in e.materials)o=e.materials[r],i=new s.Nodes[o.type],o.name&&(i.name=o.name,this.names[i.name]=i),this.materials[r]=i;for(r in e.passes)o=e.passes[r],i=new s.Nodes[o.type],o.name&&(i.name=o.name,this.names[i.name]=i),this.passes[r]=i;return e.material&&(this.material=this.materials[e.material]),e.pass&&(this.pass=this.passes[e.pass]),e}parse(e){let s;for(s in(e=this.resolve(this.declare(e))).nodes)this.nodes[s].copy(e.nodes[s]);for(s in e.materials)this.materials[s].copy(e.materials[s]);for(s in e.passes)this.passes[s].copy(e.passes[s]);return this.material||this.pass||this}}exports.NodeMaterialLoader=r,exports.NodeMaterialLoaderUtils=class{static replaceUUIDObject(e,s,r,o){if(o=void 0===o||o,"object"==typeof s&&(s=s.uuid),"object"==typeof e){const i=Object.keys(e);for(let t=0;t<i.length;t++){const d=i[t];o&&(e[d]=this.replaceUUIDObject(e[d],s,r)),d===s&&(e[s]=e[d],delete e[d])}}return e===s?r:e}static replaceUUID(e,s,r){return this.replaceUUIDObject(e,s,r,!1),this.replaceUUIDObject(e.nodes,s,r),this.replaceUUIDObject(e.materials,s,r),this.replaceUUIDObject(e.passes,s,r),this.replaceUUIDObject(e.library,s,r,!1),e}};
|
package/loaders/STLLoader.js
CHANGED
@@ -135,13 +135,13 @@ class STLLoader extends Loader {
|
|
135
135
|
&& reader.getUint8(index + 5) == 0x3d
|
136
136
|
/*'='*/
|
137
137
|
) {
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
138
|
+
hasColors = true;
|
139
|
+
colors = new Float32Array(faces * 3 * 3);
|
140
|
+
defaultR = reader.getUint8(index + 6) / 255;
|
141
|
+
defaultG = reader.getUint8(index + 7) / 255;
|
142
|
+
defaultB = reader.getUint8(index + 8) / 255;
|
143
|
+
alpha = reader.getUint8(index + 9) / 255;
|
144
|
+
}
|
145
145
|
}
|
146
146
|
|
147
147
|
const dataOffset = 84;
|
@@ -47,9 +47,9 @@ CameraNode.prototype.setScope = function (scope) {
|
|
47
47
|
}
|
48
48
|
};
|
49
49
|
|
50
|
-
CameraNode.prototype.getType = function
|
51
|
-
/* builder */
|
52
|
-
{
|
50
|
+
CameraNode.prototype.getType = function
|
51
|
+
/* builder */
|
52
|
+
() {
|
53
53
|
switch (this.scope) {
|
54
54
|
case CameraNode.DEPTH:
|
55
55
|
return 'f';
|
@@ -58,9 +58,9 @@ CameraNode.prototype.getType = function ()
|
|
58
58
|
return this.type;
|
59
59
|
};
|
60
60
|
|
61
|
-
CameraNode.prototype.getUnique = function
|
62
|
-
/* builder */
|
63
|
-
{
|
61
|
+
CameraNode.prototype.getUnique = function
|
62
|
+
/* builder */
|
63
|
+
() {
|
64
64
|
switch (this.scope) {
|
65
65
|
case CameraNode.DEPTH:
|
66
66
|
case CameraNode.TO_VERTEX:
|
@@ -70,9 +70,9 @@ CameraNode.prototype.getUnique = function ()
|
|
70
70
|
return false;
|
71
71
|
};
|
72
72
|
|
73
|
-
CameraNode.prototype.getShared = function
|
74
|
-
/* builder */
|
75
|
-
{
|
73
|
+
CameraNode.prototype.getShared = function
|
74
|
+
/* builder */
|
75
|
+
() {
|
76
76
|
switch (this.scope) {
|
77
77
|
case CameraNode.POSITION:
|
78
78
|
return false;
|
@@ -102,9 +102,9 @@ CameraNode.prototype.generate = function (builder, output) {
|
|
102
102
|
return builder.format(result, this.getType(builder), output);
|
103
103
|
};
|
104
104
|
|
105
|
-
CameraNode.prototype.onUpdateFrame = function
|
106
|
-
/* frame */
|
107
|
-
{
|
105
|
+
CameraNode.prototype.onUpdateFrame = function
|
106
|
+
/* frame */
|
107
|
+
() {
|
108
108
|
switch (this.scope) {
|
109
109
|
case CameraNode.DEPTH:
|
110
110
|
var camera = this.camera;
|
@@ -23,9 +23,9 @@ PositionNode.prototype.getType = function () {
|
|
23
23
|
return this.type;
|
24
24
|
};
|
25
25
|
|
26
|
-
PositionNode.prototype.getShared = function
|
27
|
-
/* builder */
|
28
|
-
{
|
26
|
+
PositionNode.prototype.getShared = function
|
27
|
+
/* builder */
|
28
|
+
() {
|
29
29
|
switch (this.scope) {
|
30
30
|
case PositionNode.LOCAL:
|
31
31
|
case PositionNode.WORLD:
|
@@ -18,9 +18,9 @@ ReflectNode.prototype.getUnique = function (builder) {
|
|
18
18
|
return !builder.context.viewNormal;
|
19
19
|
};
|
20
20
|
|
21
|
-
ReflectNode.prototype.getType = function
|
22
|
-
/* builder */
|
23
|
-
{
|
21
|
+
ReflectNode.prototype.getType = function
|
22
|
+
/* builder */
|
23
|
+
() {
|
24
24
|
switch (this.scope) {
|
25
25
|
case ReflectNode.SPHERE:
|
26
26
|
return 'v2';
|
@@ -16,9 +16,9 @@ FunctionNode.prototype.constructor = FunctionNode;
|
|
16
16
|
FunctionNode.prototype.nodeType = 'Function';
|
17
17
|
FunctionNode.prototype.useKeywords = true;
|
18
18
|
|
19
|
-
FunctionNode.prototype.getShared = function
|
20
|
-
/* builder, output */
|
21
|
-
{
|
19
|
+
FunctionNode.prototype.getShared = function
|
20
|
+
/* builder, output */
|
21
|
+
() {
|
22
22
|
return !this.isMethod;
|
23
23
|
};
|
24
24
|
|
package/nodes/core/InputNode.js
CHANGED
@@ -16,9 +16,9 @@ InputNode.prototype.setReadonly = function (value) {
|
|
16
16
|
return this;
|
17
17
|
};
|
18
18
|
|
19
|
-
InputNode.prototype.getReadonly = function
|
20
|
-
/* builder */
|
21
|
-
{
|
19
|
+
InputNode.prototype.getReadonly = function
|
20
|
+
/* builder */
|
21
|
+
() {
|
22
22
|
return this.readonly;
|
23
23
|
};
|
24
24
|
|
package/nodes/core/Node.js
CHANGED
@@ -53,9 +53,9 @@ Node.prototype = {
|
|
53
53
|
|
54
54
|
return this.generate(builder, output, uuid);
|
55
55
|
},
|
56
|
-
generate: function
|
57
|
-
|
58
|
-
{// This method needs to be implemented in subclasses
|
56
|
+
generate: function
|
57
|
+
/* builder, output, uuid, type, ns */
|
58
|
+
() {// This method needs to be implemented in subclasses
|
59
59
|
},
|
60
60
|
getHash: function () {
|
61
61
|
var hash = '{';
|
@@ -93,9 +93,9 @@ Node.prototype = {
|
|
93
93
|
this.name = name;
|
94
94
|
return this;
|
95
95
|
},
|
96
|
-
getName: function
|
97
|
-
|
98
|
-
{
|
96
|
+
getName: function
|
97
|
+
/* builder */
|
98
|
+
() {
|
99
99
|
return this.name;
|
100
100
|
},
|
101
101
|
getType: function (builder, output) {
|
package/nodes/core/TempNode.js
CHANGED
@@ -59,9 +59,9 @@ TempNode.prototype.getShared = function (builder, output) {
|
|
59
59
|
return output !== 'sampler2D' && output !== 'samplerCube' && this.shared;
|
60
60
|
};
|
61
61
|
|
62
|
-
TempNode.prototype.getUnique = function
|
63
|
-
/* builder, output */
|
64
|
-
{
|
62
|
+
TempNode.prototype.getUnique = function
|
63
|
+
/* builder, output */
|
64
|
+
() {
|
65
65
|
return this.unique;
|
66
66
|
};
|
67
67
|
|
@@ -70,9 +70,9 @@ TempNode.prototype.setLabel = function (name) {
|
|
70
70
|
return this;
|
71
71
|
};
|
72
72
|
|
73
|
-
TempNode.prototype.getLabel = function
|
74
|
-
/* builder */
|
75
|
-
{
|
73
|
+
TempNode.prototype.getLabel = function
|
74
|
+
/* builder */
|
75
|
+
() {
|
76
76
|
return this.label;
|
77
77
|
};
|
78
78
|
|
@@ -31,9 +31,9 @@ BlurNode.prototype.constructor = BlurNode;
|
|
31
31
|
BlurNode.prototype.nodeType = 'Blur';
|
32
32
|
BlurNode.prototype.hashProperties = ['blurX', 'blurY'];
|
33
33
|
|
34
|
-
BlurNode.prototype.updateFrame = function
|
35
|
-
/* frame */
|
36
|
-
{
|
34
|
+
BlurNode.prototype.updateFrame = function
|
35
|
+
/* frame */
|
36
|
+
() {
|
37
37
|
if (this.size) {
|
38
38
|
this.horizontal.value = this.radius.x / this.size.x;
|
39
39
|
this.vertical.value = this.radius.y / this.size.y;
|
package/nodes/math/MathNode.js
CHANGED
@@ -54,9 +54,9 @@ MathNode.prototype.constructor = MathNode;
|
|
54
54
|
MathNode.prototype.nodeType = 'Math';
|
55
55
|
MathNode.prototype.hashProperties = ['method'];
|
56
56
|
|
57
|
-
MathNode.prototype.getNumInputs = function
|
58
|
-
/*builder*/
|
59
|
-
{
|
57
|
+
MathNode.prototype.getNumInputs = function
|
58
|
+
/*builder*/
|
59
|
+
() {
|
60
60
|
switch (this.method) {
|
61
61
|
case MathNode.MIX:
|
62
62
|
case MathNode.CLAMP:
|
@@ -13,9 +13,9 @@ VelocityNode.prototype = Object.create(Vector3Node.prototype);
|
|
13
13
|
VelocityNode.prototype.constructor = VelocityNode;
|
14
14
|
VelocityNode.prototype.nodeType = 'Velocity';
|
15
15
|
|
16
|
-
VelocityNode.prototype.getReadonly = function
|
17
|
-
/*builder*/
|
18
|
-
{
|
16
|
+
VelocityNode.prototype.getReadonly = function
|
17
|
+
/*builder*/
|
18
|
+
() {
|
19
19
|
return false;
|
20
20
|
};
|
21
21
|
|
@@ -55,9 +55,9 @@ VelocityNode.prototype.setTarget = function (target) {
|
|
55
55
|
}
|
56
56
|
};
|
57
57
|
|
58
|
-
VelocityNode.prototype.updateFrameVelocity = function
|
59
|
-
/*frame*/
|
60
|
-
{
|
58
|
+
VelocityNode.prototype.updateFrameVelocity = function
|
59
|
+
/*frame*/
|
60
|
+
() {
|
61
61
|
if (this.target) {
|
62
62
|
this.position = this.target.getWorldPosition(this.position || new Vector3());
|
63
63
|
this.velocity.subVectors(this.position, this.oldPosition);
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "three-stdlib",
|
3
|
-
"version": "2.7.
|
3
|
+
"version": "2.7.1",
|
4
4
|
"private": false,
|
5
5
|
"description": "stand-alone library of threejs examples",
|
6
6
|
"main": "index.cjs.js",
|
@@ -20,7 +20,7 @@
|
|
20
20
|
},
|
21
21
|
"homepage": "https://github.com/pmndrs/three-stdlib#readme",
|
22
22
|
"dependencies": {
|
23
|
-
"@babel/runtime": "^7.
|
23
|
+
"@babel/runtime": "^7.16.7",
|
24
24
|
"@webgpu/glslang": "^0.0.15",
|
25
25
|
"@webxr-input-profiles/motion-controllers": "^1.0.0",
|
26
26
|
"chevrotain": "^9.0.2",
|
@@ -9,27 +9,19 @@ class Node {
|
|
9
9
|
});
|
10
10
|
}
|
11
11
|
|
12
|
-
getUpdateType()
|
13
|
-
/*builder*/
|
14
|
-
{
|
12
|
+
getUpdateType() {
|
15
13
|
return this.updateType;
|
16
14
|
}
|
17
15
|
|
18
|
-
getType()
|
19
|
-
/*builder*/
|
20
|
-
{
|
16
|
+
getType() {
|
21
17
|
return this.type;
|
22
18
|
}
|
23
19
|
|
24
|
-
update()
|
25
|
-
/*frame*/
|
26
|
-
{
|
20
|
+
update() {
|
27
21
|
console.warn('Abstract function.');
|
28
22
|
}
|
29
23
|
|
30
|
-
generate()
|
31
|
-
/*builder, output*/
|
32
|
-
{
|
24
|
+
generate() {
|
33
25
|
console.warn('Abstract function.');
|
34
26
|
}
|
35
27
|
|
@@ -49,9 +49,7 @@ class NodeBuilder {
|
|
49
49
|
this.defines[shaderStage][name] = value;
|
50
50
|
}
|
51
51
|
|
52
|
-
getTexture()
|
53
|
-
/* textureProperty, uvSnippet */
|
54
|
-
{
|
52
|
+
getTexture() {
|
55
53
|
console.warn('Abstract function.');
|
56
54
|
}
|
57
55
|
|
@@ -183,33 +181,23 @@ class NodeBuilder {
|
|
183
181
|
return code;
|
184
182
|
}
|
185
183
|
|
186
|
-
getAttributesBodySnippet()
|
187
|
-
/*shaderStage*/
|
188
|
-
{
|
184
|
+
getAttributesBodySnippet() {
|
189
185
|
console.warn('Abstract function.');
|
190
186
|
}
|
191
187
|
|
192
|
-
getAttributesHeaderSnippet()
|
193
|
-
/*shaderStage*/
|
194
|
-
{
|
188
|
+
getAttributesHeaderSnippet() {
|
195
189
|
console.warn('Abstract function.');
|
196
190
|
}
|
197
191
|
|
198
|
-
getVarysHeaderSnippet()
|
199
|
-
/*shaderStage*/
|
200
|
-
{
|
192
|
+
getVarysHeaderSnippet() {
|
201
193
|
console.warn('Abstract function.');
|
202
194
|
}
|
203
195
|
|
204
|
-
getVarysBodySnippet()
|
205
|
-
/*shaderStage*/
|
206
|
-
{
|
196
|
+
getVarysBodySnippet() {
|
207
197
|
console.warn('Abstract function.');
|
208
198
|
}
|
209
199
|
|
210
|
-
getUniformsHeaderSnippet()
|
211
|
-
/*shaderStage*/
|
212
|
-
{
|
200
|
+
getUniformsHeaderSnippet() {
|
213
201
|
console.warn('Abstract function.');
|
214
202
|
}
|
215
203
|
|
package/webxr/ARButton.js
CHANGED
@@ -2,9 +2,9 @@ class ARButton {
|
|
2
2
|
static createButton(renderer, sessionInit = {}) {
|
3
3
|
const button = document.createElement('button');
|
4
4
|
|
5
|
-
function
|
6
|
-
|
7
|
-
{
|
5
|
+
function
|
6
|
+
/*device*/
|
7
|
+
showStartAR() {
|
8
8
|
if (sessionInit.domOverlay === undefined) {
|
9
9
|
var overlay = document.createElement('div');
|
10
10
|
overlay.style.display = 'none';
|
@@ -47,9 +47,9 @@ class ARButton {
|
|
47
47
|
currentSession = session;
|
48
48
|
}
|
49
49
|
|
50
|
-
function
|
51
|
-
|
52
|
-
{
|
50
|
+
function
|
51
|
+
/*event*/
|
52
|
+
onSessionEnded() {
|
53
53
|
currentSession.removeEventListener('end', onSessionEnded);
|
54
54
|
button.textContent = 'START AR';
|
55
55
|
sessionInit.domOverlay.root.style.display = 'none';
|
package/webxr/VRButton.js
CHANGED
@@ -6,9 +6,9 @@ class VRButton {
|
|
6
6
|
|
7
7
|
const button = document.createElement('button');
|
8
8
|
|
9
|
-
function
|
10
|
-
|
11
|
-
{
|
9
|
+
function
|
10
|
+
/*device*/
|
11
|
+
showEnterVR() {
|
12
12
|
let currentSession = null;
|
13
13
|
|
14
14
|
async function onSessionStarted(session) {
|
@@ -18,9 +18,9 @@ class VRButton {
|
|
18
18
|
currentSession = session;
|
19
19
|
}
|
20
20
|
|
21
|
-
function
|
22
|
-
|
23
|
-
{
|
21
|
+
function
|
22
|
+
/*event*/
|
23
|
+
onSessionEnded() {
|
24
24
|
currentSession.removeEventListener('end', onSessionEnded);
|
25
25
|
button.textContent = 'ENTER VR';
|
26
26
|
currentSession = null;
|