x_ite 4.7.6 → 4.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/settings.json +1 -2
- package/Makefile +1 -0
- package/build/components/annotation.build.js +2 -2
- package/build/components/cad-geometry.build.js +2 -2
- package/build/components/cube-map-texturing.build.js +2 -2
- package/build/components/dis.build.js +2 -2
- package/build/components/event-utilities.build.js +2 -2
- package/build/components/geometry2d.build.js +2 -2
- package/build/components/geospatial.build.js +2 -2
- package/build/components/h-anim.build.js +2 -2
- package/build/components/key-device-sensor.build.js +2 -2
- package/build/components/layout.build.js +2 -2
- package/build/components/nurbs.build.js +2 -2
- package/build/components/particle-systems.build.js +2 -2
- package/build/components/picking.build.js +2 -2
- package/build/components/projective-texture-mapping.build.js +2 -2
- package/build/components/rigid-body-physics.build.js +2 -2
- package/build/components/scripting.build.js +2 -2
- package/build/components/texturing-3d.build.js +2 -2
- package/build/components/volume-rendering.build.js +2 -2
- package/build/components/x_ite.build.js +2 -2
- package/build/parts/default.end.frag.js +3 -0
- package/build/parts/default.start.frag.js +15 -0
- package/build/parts/{x_ite.end.frag → x_ite.end.frag.js} +4 -2
- package/build/parts/x_ite.start.frag.js +16 -0
- package/build/x_ite.build.js +2 -2
- package/dist/assets/components/annotation.js +17 -7
- package/dist/assets/components/annotation.min.js +1 -1
- package/dist/assets/components/cad-geometry.js +17 -7
- package/dist/assets/components/cad-geometry.min.js +1 -1
- package/dist/assets/components/cube-map-texturing.js +17 -7
- package/dist/assets/components/cube-map-texturing.min.js +1 -1
- package/dist/assets/components/dis.js +17 -7
- package/dist/assets/components/dis.min.js +1 -1
- package/dist/assets/components/event-utilities.js +17 -7
- package/dist/assets/components/event-utilities.min.js +1 -1
- package/dist/assets/components/geometry2d.js +17 -7
- package/dist/assets/components/geometry2d.min.js +1 -1
- package/dist/assets/components/geospatial.js +17 -7
- package/dist/assets/components/geospatial.min.js +2 -2
- package/dist/assets/components/h-anim.js +17 -7
- package/dist/assets/components/h-anim.min.js +1 -1
- package/dist/assets/components/key-device-sensor.js +17 -7
- package/dist/assets/components/key-device-sensor.min.js +1 -1
- package/dist/assets/components/layout.js +17 -7
- package/dist/assets/components/layout.min.js +1 -1
- package/dist/assets/components/nurbs.js +17 -7
- package/dist/assets/components/nurbs.min.js +2 -2
- package/dist/assets/components/particle-systems.js +17 -7
- package/dist/assets/components/particle-systems.min.js +2 -2
- package/dist/assets/components/picking.js +21 -11
- package/dist/assets/components/picking.min.js +1 -1
- package/dist/assets/components/projective-texture-mapping.js +17 -7
- package/dist/assets/components/projective-texture-mapping.min.js +1 -1
- package/dist/assets/components/rigid-body-physics.js +17 -7
- package/dist/assets/components/rigid-body-physics.min.js +17 -17
- package/dist/assets/components/scripting.js +24 -9
- package/dist/assets/components/scripting.min.js +1 -1
- package/dist/assets/components/texturing-3d.js +17 -7
- package/dist/assets/components/texturing-3d.min.js +41 -41
- package/dist/assets/components/volume-rendering.js +19 -9
- package/dist/assets/components/volume-rendering.min.js +3 -3
- package/dist/assets/components/x_ite.js +17 -7
- package/dist/assets/components/x_ite.min.js +1 -1
- package/dist/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
- package/dist/assets/shaders/webgl1/Gouraud.vs +0 -1
- package/dist/assets/shaders/webgl1/Phong.fs +0 -1
- package/dist/assets/shaders/webgl1/Unlit.fs +0 -3
- package/dist/assets/shaders/webgl2/Gouraud.vs +0 -1
- package/dist/assets/shaders/webgl2/Phong.fs +0 -1
- package/dist/assets/shaders/webgl2/Unlit.fs +0 -3
- package/dist/example.html +2 -2
- package/dist/x_ite.css +2 -2
- package/dist/x_ite.js +29492 -29016
- package/dist/x_ite.min.js +41 -41
- package/dist/x_ite.zip +0 -0
- package/docs/Accessing-the-External-Browser.md +31 -2
- package/docs/What's-New.md +23 -0
- package/docs/_config.yml +1 -1
- package/docs/index.md +20 -13
- package/docs/reference/Browser-Services.md +36 -8
- package/docs/reference/Script-Node-Authoring-Interface.md +12 -4
- package/package.json +3 -3
- package/src/assets/components/picking.js +2 -2
- package/src/assets/components/volume-rendering.js +2 -2
- package/src/assets/shaders/webgl1/FallbackUnlit.fs +3 -4
- package/src/assets/shaders/webgl1/Gouraud.vs +0 -1
- package/src/assets/shaders/webgl1/Phong.fs +0 -1
- package/src/assets/shaders/webgl1/Unlit.fs +0 -3
- package/src/assets/shaders/webgl2/Gouraud.vs +0 -1
- package/src/assets/shaders/webgl2/Phong.fs +0 -1
- package/src/assets/shaders/webgl2/Unlit.fs +0 -3
- package/src/bookmarks.js +8 -11
- package/src/examples.js +1 -1
- package/src/locale/de.po +15 -71
- package/src/locale/fr.po +14 -71
- package/src/standard/Time/MicroTime.js +3 -1
- package/src/standard/Utility/DataStorage.js +7 -10
- package/src/tests.js +1 -1
- package/src/x_ite/Browser/Core/BrowserOptions.js +40 -28
- package/src/x_ite/Browser/Core/BrowserTimings.js +12 -21
- package/src/x_ite/Browser/Core/ContextMenu.js +26 -12
- package/src/x_ite/Browser/Core/X3DCoreContext.js +95 -42
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -0
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -0
- package/src/x_ite/Browser/Picking/VolumePicker.js +1 -1
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +4 -1
- package/src/x_ite/Browser/Shaders/ShaderTest.js +3 -3
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +70 -50
- package/src/x_ite/Components/Picking/PointPickSensor.js +1 -1
- package/src/x_ite/Components/Scripting/Script.js +7 -2
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +10 -12
- package/src/x_ite/Components/Shaders.js +9 -9
- package/src/x_ite/Execution/X3DExecutionContext.js +9 -11
- package/src/x_ite/Fields/SFColor.js +5 -5
- package/src/x_ite/Fields/SFColorRGBA.js +6 -6
- package/src/x_ite/Fields/SFDouble.js +1 -1
- package/src/x_ite/Fields/SFFloat.js +1 -1
- package/src/x_ite/Fields/SFImage.js +13 -13
- package/src/x_ite/Fields/SFMatrix3.js +1 -1
- package/src/x_ite/Fields/SFMatrix4.js +1 -1
- package/src/x_ite/Fields/SFNode.js +23 -19
- package/src/x_ite/Fields/SFNodeCache.js +14 -10
- package/src/x_ite/Fields/SFRotation.js +6 -6
- package/src/x_ite/Fields/SFString.js +1 -1
- package/src/x_ite/Fields/SFVec2.js +2 -2
- package/src/x_ite/Fields/SFVec3.js +3 -3
- package/src/x_ite/Fields/SFVec4.js +4 -4
- package/src/x_ite/Fields/SFVecPrototypeTemplate.js +3 -3
- package/src/x_ite/InputOutput/Generator.js +71 -62
- package/src/x_ite/Parser/X3DParser.js +6 -0
- package/src/x_ite/Parser/XMLParser.js +1 -1
- package/src/x_ite/X3D.js +8 -2
- package/src/x_ite.js +21 -12
- package/build/parts/default.end.frag +0 -2
- package/build/parts/default.start.frag +0 -6
- package/build/parts/x_ite.start.frag +0 -8
package/.vscode/settings.json
CHANGED
package/Makefile
CHANGED
|
@@ -76,5 +76,6 @@ define generate_component
|
|
|
76
76
|
node_modules/requirejs/bin/r.js -o build/components/$(1).build.js
|
|
77
77
|
perl -pi -e "s|'assets/components/$(1)',||" dist/assets/components/$(1).js
|
|
78
78
|
perl -pi -e "s|text/text!|text!|" dist/assets/components/$(1).js
|
|
79
|
+
perl -pi -e "s|define\\s+\\(\\[|define (require .getComponentUrl (\"$(1)\"), [|" dist/assets/components/$(1).js
|
|
79
80
|
node_modules/uglify-js-es6/bin/uglifyjs --mangle $(2) -- dist/assets/components/$(1).js > dist/assets/components/$(1).min.js
|
|
80
81
|
endef
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
(function (globalModule, globalRequire)
|
|
2
|
+
{
|
|
3
|
+
|
|
4
|
+
if (typeof __filename === "undefined")
|
|
5
|
+
{
|
|
6
|
+
globalModule = undefined;
|
|
7
|
+
globalRequire = undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Undefine global variables.
|
|
11
|
+
var module = { }, exports, process;
|
|
12
|
+
|
|
13
|
+
const
|
|
14
|
+
define = X3D .define,
|
|
15
|
+
require = X3D .require;
|
|
@@ -13,11 +13,13 @@ function ()
|
|
|
13
13
|
};
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
for (
|
|
16
|
+
for (const key in x_iteNoConfict)
|
|
17
17
|
{
|
|
18
18
|
if (x_iteNoConfict [key] === undefined)
|
|
19
19
|
delete window [key];
|
|
20
20
|
else
|
|
21
21
|
window [key] = x_iteNoConfict [key];
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
|
|
24
|
+
})
|
|
25
|
+
(typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
(function (globalModule, globalRequire)
|
|
2
|
+
{
|
|
3
|
+
|
|
4
|
+
if (typeof __filename === "undefined")
|
|
5
|
+
{
|
|
6
|
+
globalModule = undefined;
|
|
7
|
+
globalRequire = undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Undefine global variables.
|
|
11
|
+
var module, exports, process;
|
|
12
|
+
|
|
13
|
+
const x_iteNoConfict = {
|
|
14
|
+
sprintf: window .sprintf,
|
|
15
|
+
vsprintf: window .vsprintf,
|
|
16
|
+
};
|
package/build/x_ite.build.js
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
(function ()
|
|
1
|
+
(function (globalModule, globalRequire)
|
|
2
|
+
{
|
|
3
|
+
|
|
4
|
+
if (typeof __filename === "undefined")
|
|
5
|
+
{
|
|
6
|
+
globalModule = undefined;
|
|
7
|
+
globalRequire = undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Undefine global variables.
|
|
11
|
+
var module = { }, exports, process;
|
|
2
12
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
module = { };
|
|
13
|
+
const
|
|
14
|
+
define = X3D .define,
|
|
15
|
+
require = X3D .require;
|
|
7
16
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
8
17
|
*******************************************************************************
|
|
9
18
|
*
|
|
@@ -770,7 +779,7 @@ function (Fields,
|
|
|
770
779
|
******************************************************************************/
|
|
771
780
|
|
|
772
781
|
|
|
773
|
-
define ([
|
|
782
|
+
define (require .getComponentUrl ("annotation"), [
|
|
774
783
|
"x_ite/Components",
|
|
775
784
|
"x_ite/Components/Annotation/AnnotationLayer",
|
|
776
785
|
"x_ite/Components/Annotation/AnnotationTarget",
|
|
@@ -810,4 +819,5 @@ function (Components,
|
|
|
810
819
|
});
|
|
811
820
|
|
|
812
821
|
|
|
813
|
-
}
|
|
822
|
+
})
|
|
823
|
+
(typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){
|
|
1
|
+
!function(t,n){"undefined"==typeof __filename&&void 0;const e=X3D.define,i=X3D.require;e("x_ite/Components/Annotation/AnnotationLayer",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Layering/X3DLayerNode","x_ite/Components/Navigation/Viewpoint","x_ite/Components/Grouping/Group","x_ite/Bits/X3DConstants"],function(t,n,e,i,o,a,u){"use strict";function p(t){i.call(this,t,new o(t),new a(t)),this.addType(u.AnnotationLayer)}return p.prototype=Object.assign(Object.create(i.prototype),{constructor:p,fieldDefinitions:new e([new n(u.inputOutput,"metadata",new t.SFNode),new n(u.inputOutput,"isPickable",new t.SFBool(!0)),new n(u.inputOutput,"layoutPolicy",new t.MFString),new n(u.inputOutput,"shownGroupID",new t.MFString),new n(u.inputOutput,"viewport",new t.SFNode)]),getTypeName:function(){return"AnnotationLayer"},getComponentName:function(){return"Annotation"},getContainerField:function(){return"layers"},initialize:function(){i.prototype.initialize.call(this)}}),p}),e("x_ite/Components/Annotation/AnnotationTarget",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants"],function(t,n,e,i,o){"use strict";function a(t){i.call(this,t),this.addType(o.AnnotationTarget)}return a.prototype=Object.assign(Object.create(i.prototype),{constructor:a,fieldDefinitions:new e([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"referencePoint",new t.SFVec3f(0,0,0)),new n(o.inputOutput,"leadLineStyle",new t.SFNode),new n(o.inputOutput,"marker",new t.SFNode),new n(o.inputOutput,"annotations",new t.MFNode)]),getTypeName:function(){return"AnnotationTarget"},getComponentName:function(){return"Annotation"},getContainerField:function(){return"children"},initialize:function(){i.prototype.initialize.call(this)}}),a}),e("x_ite/Components/Annotation/X3DAnnotationNode",["x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants"],function(t,n){"use strict";function e(e){t.call(this,e),this.addType(n.X3DAnnotationNode)}return e.prototype=Object.assign(Object.create(t.prototype),{constructor:e,initialize:function(){t.prototype.initialize.call(this)}}),e}),e("x_ite/Components/Annotation/GroupAnnotation",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Components/Annotation/X3DAnnotationNode","x_ite/Bits/X3DConstants"],function(t,n,e,i,o,a){"use strict";function u(t){i.call(this,t),o.call(this,t),this.addType(a.GroupAnnotation)}return u.prototype=Object.assign(Object.create(i.prototype),o.prototype,{constructor:u,fieldDefinitions:new e([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"enabled",new t.SFBool(!0)),new n(a.inputOutput,"annotationGroupID",new t.SFString),new n(a.inputOutput,"displayPolicy",new t.SFString("NEVER")),new n(a.inputOutput,"visible",new t.SFBool(!0)),new n(a.inputOutput,"bboxDisplay",new t.SFBool),new n(a.initializeOnly,"bboxCenter",new t.SFVec3f(0,0,0)),new n(a.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new n(a.inputOnly,"addChildren",new t.MFNode),new n(a.inputOnly,"removeChildren",new t.MFNode),new n(a.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"GroupAnnotation"},getComponentName:function(){return"Annotation"},getContainerField:function(){return"children"},initialize:function(){i.prototype.initialize.call(this),o.prototype.initialize.call(this)}}),u}),e("x_ite/Components/Annotation/IconAnnotation",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Annotation/X3DAnnotationNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Bits/X3DConstants"],function(t,n,e,i,o,a){"use strict";function u(t){i.call(this,t),o.call(this,t),this.addType(a.IconAnnotation)}return u.prototype=Object.assign(Object.create(i.prototype),o.prototype,{constructor:u,fieldDefinitions:new e([new n(a.inputOutput,"metadata",new t.SFNode),new n(a.inputOutput,"enabled",new t.SFBool(!0)),new n(a.inputOutput,"annotationGroupID",new t.SFString),new n(a.inputOutput,"displayPolicy",new t.SFString("NEVER")),new n(a.inputOutput,"url",new t.MFString),new n(a.inputOutput,"autoRefresh",new t.SFTime),new n(a.inputOutput,"autoRefreshTimeLimit",new t.SFTime(3600))]),getTypeName:function(){return"IconAnnotation"},getComponentName:function(){return"Annotation"},getContainerField:function(){return"children"},initialize:function(){i.prototype.initialize.call(this),o.prototype.initialize.call(this)},requestImmediateLoad:function(t=!0){}}),u}),e("x_ite/Components/Annotation/TextAnnotation",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Annotation/X3DAnnotationNode","x_ite/Bits/X3DConstants"],function(t,n,e,i,o){"use strict";function a(t){i.call(this,t),this.addType(o.TextAnnotation)}return a.prototype=Object.assign(Object.create(i.prototype),{constructor:a,fieldDefinitions:new e([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"annotationGroupID",new t.SFString),new n(o.inputOutput,"displayPolicy",new t.SFString("NEVER")),new n(o.inputOutput,"contentType",new t.SFString("text/plain")),new n(o.inputOutput,"text",new t.SFString)]),getTypeName:function(){return"TextAnnotation"},getComponentName:function(){return"Annotation"},getContainerField:function(){return"children"},initialize:function(){i.prototype.initialize.call(this)}}),a}),e("x_ite/Components/Annotation/URLAnnotation",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Annotation/X3DAnnotationNode","x_ite/Bits/X3DConstants"],function(t,n,e,i,o){"use strict";function a(t){i.call(this,t),this.addType(o.URLAnnotation)}return a.prototype=Object.assign(Object.create(i.prototype),{constructor:a,fieldDefinitions:new e([new n(o.inputOutput,"metadata",new t.SFNode),new n(o.inputOutput,"enabled",new t.SFBool(!0)),new n(o.inputOutput,"annotationGroupID",new t.SFString),new n(o.inputOutput,"displayPolicy",new t.SFString("NEVER")),new n(o.inputOutput,"url",new t.MFString)]),getTypeName:function(){return"URLAnnotation"},getComponentName:function(){return"Annotation"},getContainerField:function(){return"children"},initialize:function(){i.prototype.initialize.call(this)}}),a}),e(i.getComponentUrl("annotation"),["x_ite/Components","x_ite/Components/Annotation/AnnotationLayer","x_ite/Components/Annotation/AnnotationTarget","x_ite/Components/Annotation/GroupAnnotation","x_ite/Components/Annotation/IconAnnotation","x_ite/Components/Annotation/TextAnnotation","x_ite/Components/Annotation/URLAnnotation","x_ite/Components/Annotation/X3DAnnotationNode"],function(t,n,e,i,o,a,u,p){"use strict";t.addComponent({name:"Annotation",types:{AnnotationLayer:n,AnnotationTarget:e,GroupAnnotation:i,IconAnnotation:o,TextAnnotation:a,URLAnnotation:u},abstractTypes:{X3DAnnotationNode:p}})})}("object"==typeof module?module:void 0,"function"==typeof require?require:void 0);
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
(function ()
|
|
1
|
+
(function (globalModule, globalRequire)
|
|
2
|
+
{
|
|
3
|
+
|
|
4
|
+
if (typeof __filename === "undefined")
|
|
5
|
+
{
|
|
6
|
+
globalModule = undefined;
|
|
7
|
+
globalRequire = undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Undefine global variables.
|
|
11
|
+
var module = { }, exports, process;
|
|
2
12
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
module = { };
|
|
13
|
+
const
|
|
14
|
+
define = X3D .define,
|
|
15
|
+
require = X3D .require;
|
|
7
16
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
8
17
|
*******************************************************************************
|
|
9
18
|
*
|
|
@@ -993,7 +1002,7 @@ function (Fields,
|
|
|
993
1002
|
******************************************************************************/
|
|
994
1003
|
|
|
995
1004
|
|
|
996
|
-
define ([
|
|
1005
|
+
define (require .getComponentUrl ("cad-geometry"), [
|
|
997
1006
|
"x_ite/Components",
|
|
998
1007
|
"x_ite/Components/CADGeometry/CADAssembly",
|
|
999
1008
|
"x_ite/Components/CADGeometry/CADFace",
|
|
@@ -1034,4 +1043,5 @@ function (Components,
|
|
|
1034
1043
|
|
|
1035
1044
|
|
|
1036
1045
|
|
|
1037
|
-
}
|
|
1046
|
+
})
|
|
1047
|
+
(typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){var e=X3D.define;X3D.require;e("x_ite/Components/CADGeometry/X3DProductStructureChildNode",["x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants"],function(e,t){"use strict";function n(n){e.call(this,n),this.addType(t.X3DProductStructureChildNode)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n}),n}),e("x_ite/Components/CADGeometry/CADAssembly",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Components/CADGeometry/X3DProductStructureChildNode","x_ite/Bits/X3DConstants"],function(e,t,n,i,o,r){"use strict";function s(e){i.call(this,e),o.call(this,e),this.addType(r.CADAssembly)}return s.prototype=Object.assign(Object.create(i.prototype),{constructor:s,fieldDefinitions:new n([new t(r.inputOutput,"metadata",new e.SFNode),new t(r.inputOutput,"name",new e.SFString),new t(r.inputOutput,"visible",new e.SFBool(!0)),new t(r.inputOutput,"bboxDisplay",new e.SFBool),new t(r.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(r.initializeOnly,"bboxCenter",new e.SFVec3f),new t(r.inputOnly,"addChildren",new e.MFNode),new t(r.inputOnly,"removeChildren",new e.MFNode),new t(r.inputOutput,"children",new e.MFNode)]),getTypeName:function(){return"CADAssembly"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"}}),s}),e("x_ite/Components/CADGeometry/CADFace",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/CADGeometry/X3DProductStructureChildNode","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Bits/X3DConstants","x_ite/Bits/TraverseType"],function(e,t,n,i,o,r,s){"use strict";function u(e){i.call(this,e),o.call(this,e),this.addType(r.CADFace),this.childNode=null,this.visibleNode=null,this.boundedObject=null}return u.prototype=Object.assign(Object.create(i.prototype),o.prototype,{constructor:u,fieldDefinitions:new n([new t(r.inputOutput,"metadata",new e.SFNode),new t(r.inputOutput,"name",new e.SFString),new t(r.inputOutput,"visible",new e.SFBool(!0)),new t(r.inputOutput,"bboxDisplay",new e.SFBool),new t(r.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(r.initializeOnly,"bboxCenter",new e.SFVec3f),new t(r.inputOutput,"shape",new e.SFNode)]),getTypeName:function(){return"CADFace"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"},initialize:function(){i.prototype.initialize.call(this),o.prototype.initialize.call(this),this.shape_.addInterest("set_shape__",this),this.set_shape__()},getBBox:function(e,t){if(this.bboxSize_.getValue().equals(this.getDefaultBBoxSize())){const n=this.visibleNode;return n?n.getBBox(e,t):e.set()}return e.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},set_shape__:function(){this.childNode&&(this.childNode.isCameraObject_.removeInterest("set_cameraObject__",this),this.childNode.isPickableObject_.removeInterest("set_transformSensors__",this),this.childNode.visible_.removeInterest("set_visible__",this),this.childNode.bboxDisplay_.removeInterest("set_bboxDisplay__",this)),this.childNode=null;try{const t=this.shape_.getValue().getInnerNode(),n=t.getType();for(var e=n.length-1;e>=0;--e){switch(n[e]){case r.LOD:case r.Transform:case r.X3DShapeNode:t.isCameraObject_.addInterest("set_cameraObject__",this),t.isPickableObject_.addInterest("set_transformSensors__",this),t.visible_.addInterest("set_visible__",this),t.bboxDisplay_.addInterest("set_bboxDisplay__",this),this.childNode=t;break;default:continue}break}}catch(e){}this.childNode?delete this.traverse:this.traverse=Function.prototype,this.set_transformSensors__(),this.set_visible__(),this.set_bboxDisplay__()},set_cameraObject__:function(){this.childNode&&this.childNode.getCameraObject()?this.setCameraObject(this.childNode.visible_.getValue()):this.setCameraObject(!1)},set_transformSensors__:function(){this.setPickableObject(Boolean(this.childNode&&this.childNode.getPickableObject()))},set_visible__:function(){this.childNode?this.visibleNode=this.childNode.visible_.getValue()?this.childNode:null:this.visibleNode=null,this.set_cameraObject__()},set_bboxDisplay__:function(){this.childNode?this.boundedObject=this.childNode.bboxDisplay_.getValue()?this.childNode:null:this.boundedObject=null},traverse:function(e,t){switch(e){case s.POINTER:case s.CAMERA:case s.SHADOW:{const n=this.visibleNode;return void(n&&n.traverse(e,t))}case s.PICKING:{const n=t.getBrowser(),i=n.getPickingHierarchy();return i.push(this),this.childNode.traverse(e,t),void i.pop()}case s.COLLISION:return void this.childNode.traverse(e,t);case s.DISPLAY:{const n=this.visibleNode;n&&n.traverse(e,t);const i=this.boundedObject;return void(i&&i.displayBBox(e,t))}}}}),u}),e("x_ite/Components/CADGeometry/CADLayer",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/X3DConstants"],function(e,t,n,i,o){"use strict";function r(e){i.call(this,e),this.addType(o.CADLayer)}return r.prototype=Object.assign(Object.create(i.prototype),{constructor:r,fieldDefinitions:new n([new t(o.inputOutput,"metadata",new e.SFNode),new t(o.inputOutput,"name",new e.SFString),new t(o.inputOutput,"visible",new e.SFBool(!0)),new t(o.inputOutput,"bboxDisplay",new e.SFBool),new t(o.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(o.initializeOnly,"bboxCenter",new e.SFVec3f),new t(o.inputOnly,"addChildren",new e.MFNode),new t(o.inputOnly,"removeChildren",new e.MFNode),new t(o.inputOutput,"children",new e.MFNode)]),getTypeName:function(){return"CADLayer"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"}}),r}),e("x_ite/Components/CADGeometry/CADPart",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DTransformNode","x_ite/Components/CADGeometry/X3DProductStructureChildNode","x_ite/Bits/X3DConstants"],function(e,t,n,i,o,r){"use strict";function s(e){i.call(this,e),o.call(this,e),this.addType(r.CADPart)}return s.prototype=Object.assign(Object.create(i.prototype),{constructor:s,fieldDefinitions:new n([new t(r.inputOutput,"metadata",new e.SFNode),new t(r.inputOutput,"name",new e.SFString),new t(r.inputOutput,"translation",new e.SFVec3f),new t(r.inputOutput,"rotation",new e.SFRotation),new t(r.inputOutput,"scale",new e.SFVec3f(1,1,1)),new t(r.inputOutput,"scaleOrientation",new e.SFRotation),new t(r.inputOutput,"center",new e.SFVec3f),new t(r.inputOutput,"visible",new e.SFBool(!0)),new t(r.inputOutput,"bboxDisplay",new e.SFBool),new t(r.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(r.initializeOnly,"bboxCenter",new e.SFVec3f),new t(r.inputOnly,"addChildren",new e.MFNode),new t(r.inputOnly,"removeChildren",new e.MFNode),new t(r.inputOutput,"children",new e.MFNode)]),getTypeName:function(){return"CADPart"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"}}),s}),e("x_ite/Components/CADGeometry/IndexedQuadSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants"],function(e,t,n,i,o){"use strict";function r(e){i.call(this,e),this.addType(o.IndexedQuadSet)}return r.prototype=Object.assign(Object.create(i.prototype),{constructor:r,fieldDefinitions:new n([new t(o.inputOutput,"metadata",new e.SFNode),new t(o.inputOnly,"set_index",new e.MFInt32),new t(o.initializeOnly,"solid",new e.SFBool(!0)),new t(o.initializeOnly,"ccw",new e.SFBool(!0)),new t(o.initializeOnly,"colorPerVertex",new e.SFBool(!0)),new t(o.initializeOnly,"normalPerVertex",new e.SFBool(!0)),new t(o.initializeOnly,"index",new e.MFInt32),new t(o.inputOutput,"attrib",new e.MFNode),new t(o.inputOutput,"fogCoord",new e.SFNode),new t(o.inputOutput,"color",new e.SFNode),new t(o.inputOutput,"texCoord",new e.SFNode),new t(o.inputOutput,"normal",new e.SFNode),new t(o.inputOutput,"coord",new e.SFNode)]),getTypeName:function(){return"IndexedQuadSet"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"geometry"},initialize:function(){i.prototype.initialize.call(this),this.set_index_.addFieldInterest(this.index_)},getTriangleIndex:function(){var e=[0,1,2,0,2,3];return function(t){var n=t%6;return(t-n)/6*4+e[n]}}(),getPolygonIndex:function(e){return this.index_[e]},build:function(){var e=this.index_.length;e-=e%4,i.prototype.build.call(this,4,e,6,e/4*6)}}),r}),e("x_ite/Components/CADGeometry/QuadSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants"],function(e,t,n,i,o){"use strict";function r(e){i.call(this,e),this.addType(o.QuadSet)}var s=[0,1,2,0,2,3];return r.prototype=Object.assign(Object.create(i.prototype),{constructor:r,fieldDefinitions:new n([new t(o.inputOutput,"metadata",new e.SFNode),new t(o.initializeOnly,"solid",new e.SFBool(!0)),new t(o.initializeOnly,"ccw",new e.SFBool(!0)),new t(o.initializeOnly,"colorPerVertex",new e.SFBool(!0)),new t(o.initializeOnly,"normalPerVertex",new e.SFBool(!0)),new t(o.inputOutput,"attrib",new e.MFNode),new t(o.inputOutput,"fogCoord",new e.SFNode),new t(o.inputOutput,"color",new e.SFNode),new t(o.inputOutput,"texCoord",new e.SFNode),new t(o.inputOutput,"normal",new e.SFNode),new t(o.inputOutput,"coord",new e.SFNode)]),getTypeName:function(){return"QuadSet"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"geometry"},getTriangleIndex:function(e){var t=e%6;return(e-t)/6*4+s[t]},build:function(){if(this.getCoord()){var e=this.getCoord().getSize();e-=e%4,i.prototype.build.call(this,4,e,6,e/4*6)}},createNormals:function(e,t){return this.createFaceNormals(e,t)}}),r}),e(["x_ite/Components","x_ite/Components/CADGeometry/CADAssembly","x_ite/Components/CADGeometry/CADFace","x_ite/Components/CADGeometry/CADLayer","x_ite/Components/CADGeometry/CADPart","x_ite/Components/CADGeometry/IndexedQuadSet","x_ite/Components/CADGeometry/QuadSet","x_ite/Components/CADGeometry/X3DProductStructureChildNode"],function(e,t,n,i,o,r,s,u){"use strict";e.addComponent({name:"CADGeometry",types:{CADAssembly:t,CADFace:n,CADLayer:i,CADPart:o,IndexedQuadSet:r,QuadSet:s},abstractTypes:{X3DProductStructureChildNode:u}})})}();
|
|
1
|
+
!function(e,t){"undefined"==typeof __filename&&void 0;const n=X3D.define,i=X3D.require;n("x_ite/Components/CADGeometry/X3DProductStructureChildNode",["x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants"],function(e,t){"use strict";function n(n){e.call(this,n),this.addType(t.X3DProductStructureChildNode)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n}),n}),n("x_ite/Components/CADGeometry/CADAssembly",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Components/CADGeometry/X3DProductStructureChildNode","x_ite/Bits/X3DConstants"],function(e,t,n,i,o,r){"use strict";function s(e){i.call(this,e),o.call(this,e),this.addType(r.CADAssembly)}return s.prototype=Object.assign(Object.create(i.prototype),{constructor:s,fieldDefinitions:new n([new t(r.inputOutput,"metadata",new e.SFNode),new t(r.inputOutput,"name",new e.SFString),new t(r.inputOutput,"visible",new e.SFBool(!0)),new t(r.inputOutput,"bboxDisplay",new e.SFBool),new t(r.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(r.initializeOnly,"bboxCenter",new e.SFVec3f),new t(r.inputOnly,"addChildren",new e.MFNode),new t(r.inputOnly,"removeChildren",new e.MFNode),new t(r.inputOutput,"children",new e.MFNode)]),getTypeName:function(){return"CADAssembly"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"}}),s}),n("x_ite/Components/CADGeometry/CADFace",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/CADGeometry/X3DProductStructureChildNode","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Bits/X3DConstants","x_ite/Bits/TraverseType"],function(e,t,n,i,o,r,s){"use strict";function u(e){i.call(this,e),o.call(this,e),this.addType(r.CADFace),this.childNode=null,this.visibleNode=null,this.boundedObject=null}return u.prototype=Object.assign(Object.create(i.prototype),o.prototype,{constructor:u,fieldDefinitions:new n([new t(r.inputOutput,"metadata",new e.SFNode),new t(r.inputOutput,"name",new e.SFString),new t(r.inputOutput,"visible",new e.SFBool(!0)),new t(r.inputOutput,"bboxDisplay",new e.SFBool),new t(r.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(r.initializeOnly,"bboxCenter",new e.SFVec3f),new t(r.inputOutput,"shape",new e.SFNode)]),getTypeName:function(){return"CADFace"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"},initialize:function(){i.prototype.initialize.call(this),o.prototype.initialize.call(this),this.shape_.addInterest("set_shape__",this),this.set_shape__()},getBBox:function(e,t){if(this.bboxSize_.getValue().equals(this.getDefaultBBoxSize())){const n=this.visibleNode;return n?n.getBBox(e,t):e.set()}return e.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},set_shape__:function(){this.childNode&&(this.childNode.isCameraObject_.removeInterest("set_cameraObject__",this),this.childNode.isPickableObject_.removeInterest("set_transformSensors__",this),this.childNode.visible_.removeInterest("set_visible__",this),this.childNode.bboxDisplay_.removeInterest("set_bboxDisplay__",this)),this.childNode=null;try{const t=this.shape_.getValue().getInnerNode(),n=t.getType();for(var e=n.length-1;e>=0;--e){switch(n[e]){case r.LOD:case r.Transform:case r.X3DShapeNode:t.isCameraObject_.addInterest("set_cameraObject__",this),t.isPickableObject_.addInterest("set_transformSensors__",this),t.visible_.addInterest("set_visible__",this),t.bboxDisplay_.addInterest("set_bboxDisplay__",this),this.childNode=t;break;default:continue}break}}catch(e){}this.childNode?delete this.traverse:this.traverse=Function.prototype,this.set_transformSensors__(),this.set_visible__(),this.set_bboxDisplay__()},set_cameraObject__:function(){this.childNode&&this.childNode.getCameraObject()?this.setCameraObject(this.childNode.visible_.getValue()):this.setCameraObject(!1)},set_transformSensors__:function(){this.setPickableObject(Boolean(this.childNode&&this.childNode.getPickableObject()))},set_visible__:function(){this.childNode?this.visibleNode=this.childNode.visible_.getValue()?this.childNode:null:this.visibleNode=null,this.set_cameraObject__()},set_bboxDisplay__:function(){this.childNode?this.boundedObject=this.childNode.bboxDisplay_.getValue()?this.childNode:null:this.boundedObject=null},traverse:function(e,t){switch(e){case s.POINTER:case s.CAMERA:case s.SHADOW:{const n=this.visibleNode;return void(n&&n.traverse(e,t))}case s.PICKING:{const n=t.getBrowser(),i=n.getPickingHierarchy();return i.push(this),this.childNode.traverse(e,t),void i.pop()}case s.COLLISION:return void this.childNode.traverse(e,t);case s.DISPLAY:{const n=this.visibleNode;n&&n.traverse(e,t);const i=this.boundedObject;return void(i&&i.displayBBox(e,t))}}}}),u}),n("x_ite/Components/CADGeometry/CADLayer",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/X3DConstants"],function(e,t,n,i,o){"use strict";function r(e){i.call(this,e),this.addType(o.CADLayer)}return r.prototype=Object.assign(Object.create(i.prototype),{constructor:r,fieldDefinitions:new n([new t(o.inputOutput,"metadata",new e.SFNode),new t(o.inputOutput,"name",new e.SFString),new t(o.inputOutput,"visible",new e.SFBool(!0)),new t(o.inputOutput,"bboxDisplay",new e.SFBool),new t(o.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(o.initializeOnly,"bboxCenter",new e.SFVec3f),new t(o.inputOnly,"addChildren",new e.MFNode),new t(o.inputOnly,"removeChildren",new e.MFNode),new t(o.inputOutput,"children",new e.MFNode)]),getTypeName:function(){return"CADLayer"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"}}),r}),n("x_ite/Components/CADGeometry/CADPart",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DTransformNode","x_ite/Components/CADGeometry/X3DProductStructureChildNode","x_ite/Bits/X3DConstants"],function(e,t,n,i,o,r){"use strict";function s(e){i.call(this,e),o.call(this,e),this.addType(r.CADPart)}return s.prototype=Object.assign(Object.create(i.prototype),{constructor:s,fieldDefinitions:new n([new t(r.inputOutput,"metadata",new e.SFNode),new t(r.inputOutput,"name",new e.SFString),new t(r.inputOutput,"translation",new e.SFVec3f),new t(r.inputOutput,"rotation",new e.SFRotation),new t(r.inputOutput,"scale",new e.SFVec3f(1,1,1)),new t(r.inputOutput,"scaleOrientation",new e.SFRotation),new t(r.inputOutput,"center",new e.SFVec3f),new t(r.inputOutput,"visible",new e.SFBool(!0)),new t(r.inputOutput,"bboxDisplay",new e.SFBool),new t(r.initializeOnly,"bboxSize",new e.SFVec3f(-1,-1,-1)),new t(r.initializeOnly,"bboxCenter",new e.SFVec3f),new t(r.inputOnly,"addChildren",new e.MFNode),new t(r.inputOnly,"removeChildren",new e.MFNode),new t(r.inputOutput,"children",new e.MFNode)]),getTypeName:function(){return"CADPart"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"children"}}),s}),n("x_ite/Components/CADGeometry/IndexedQuadSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants"],function(e,t,n,i,o){"use strict";function r(e){i.call(this,e),this.addType(o.IndexedQuadSet)}return r.prototype=Object.assign(Object.create(i.prototype),{constructor:r,fieldDefinitions:new n([new t(o.inputOutput,"metadata",new e.SFNode),new t(o.inputOnly,"set_index",new e.MFInt32),new t(o.initializeOnly,"solid",new e.SFBool(!0)),new t(o.initializeOnly,"ccw",new e.SFBool(!0)),new t(o.initializeOnly,"colorPerVertex",new e.SFBool(!0)),new t(o.initializeOnly,"normalPerVertex",new e.SFBool(!0)),new t(o.initializeOnly,"index",new e.MFInt32),new t(o.inputOutput,"attrib",new e.MFNode),new t(o.inputOutput,"fogCoord",new e.SFNode),new t(o.inputOutput,"color",new e.SFNode),new t(o.inputOutput,"texCoord",new e.SFNode),new t(o.inputOutput,"normal",new e.SFNode),new t(o.inputOutput,"coord",new e.SFNode)]),getTypeName:function(){return"IndexedQuadSet"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"geometry"},initialize:function(){i.prototype.initialize.call(this),this.set_index_.addFieldInterest(this.index_)},getTriangleIndex:function(){var e=[0,1,2,0,2,3];return function(t){var n=t%6;return(t-n)/6*4+e[n]}}(),getPolygonIndex:function(e){return this.index_[e]},build:function(){var e=this.index_.length;e-=e%4,i.prototype.build.call(this,4,e,6,e/4*6)}}),r}),n("x_ite/Components/CADGeometry/QuadSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants"],function(e,t,n,i,o){"use strict";function r(e){i.call(this,e),this.addType(o.QuadSet)}var s=[0,1,2,0,2,3];return r.prototype=Object.assign(Object.create(i.prototype),{constructor:r,fieldDefinitions:new n([new t(o.inputOutput,"metadata",new e.SFNode),new t(o.initializeOnly,"solid",new e.SFBool(!0)),new t(o.initializeOnly,"ccw",new e.SFBool(!0)),new t(o.initializeOnly,"colorPerVertex",new e.SFBool(!0)),new t(o.initializeOnly,"normalPerVertex",new e.SFBool(!0)),new t(o.inputOutput,"attrib",new e.MFNode),new t(o.inputOutput,"fogCoord",new e.SFNode),new t(o.inputOutput,"color",new e.SFNode),new t(o.inputOutput,"texCoord",new e.SFNode),new t(o.inputOutput,"normal",new e.SFNode),new t(o.inputOutput,"coord",new e.SFNode)]),getTypeName:function(){return"QuadSet"},getComponentName:function(){return"CADGeometry"},getContainerField:function(){return"geometry"},getTriangleIndex:function(e){var t=e%6;return(e-t)/6*4+s[t]},build:function(){if(this.getCoord()){var e=this.getCoord().getSize();e-=e%4,i.prototype.build.call(this,4,e,6,e/4*6)}},createNormals:function(e,t){return this.createFaceNormals(e,t)}}),r}),n(i.getComponentUrl("cad-geometry"),["x_ite/Components","x_ite/Components/CADGeometry/CADAssembly","x_ite/Components/CADGeometry/CADFace","x_ite/Components/CADGeometry/CADLayer","x_ite/Components/CADGeometry/CADPart","x_ite/Components/CADGeometry/IndexedQuadSet","x_ite/Components/CADGeometry/QuadSet","x_ite/Components/CADGeometry/X3DProductStructureChildNode"],function(e,t,n,i,o,r,s,u){"use strict";e.addComponent({name:"CADGeometry",types:{CADAssembly:t,CADFace:n,CADLayer:i,CADPart:o,IndexedQuadSet:r,QuadSet:s},abstractTypes:{X3DProductStructureChildNode:u}})})}("object"==typeof module?module:void 0,"function"==typeof require?require:void 0);
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
(function ()
|
|
1
|
+
(function (globalModule, globalRequire)
|
|
2
|
+
{
|
|
3
|
+
|
|
4
|
+
if (typeof __filename === "undefined")
|
|
5
|
+
{
|
|
6
|
+
globalModule = undefined;
|
|
7
|
+
globalRequire = undefined;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// Undefine global variables.
|
|
11
|
+
var module = { }, exports, process;
|
|
2
12
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
module = { };
|
|
13
|
+
const
|
|
14
|
+
define = X3D .define,
|
|
15
|
+
require = X3D .require;
|
|
7
16
|
/* -*- Mode: JavaScript; coding: utf-8; tab-width: 3; indent-tabs-mode: tab; c-basic-offset: 3 -*-
|
|
8
17
|
*******************************************************************************
|
|
9
18
|
*
|
|
@@ -1177,7 +1186,7 @@ function ($,
|
|
|
1177
1186
|
******************************************************************************/
|
|
1178
1187
|
|
|
1179
1188
|
|
|
1180
|
-
define ([
|
|
1189
|
+
define (require .getComponentUrl ("cube-map-texturing"), [
|
|
1181
1190
|
"x_ite/Components",
|
|
1182
1191
|
"x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture",
|
|
1183
1192
|
"x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture",
|
|
@@ -1209,4 +1218,5 @@ function (Components,
|
|
|
1209
1218
|
|
|
1210
1219
|
|
|
1211
1220
|
|
|
1212
|
-
}
|
|
1221
|
+
})
|
|
1222
|
+
(typeof module === "object" ? module : undefined, typeof require === "function" ? require : undefined);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){var e=X3D.define;X3D.require;e("x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode",["x_ite/Components/Texturing/X3DSingleTextureNode","x_ite/Bits/X3DConstants"],function(e,t){"use strict";function i(i){e.call(this,i),this.addType(t.X3DEnvironmentTextureNode);const r=this.getBrowser().getContext();this.target=r.TEXTURE_CUBE_MAP,this.targets=[r.TEXTURE_CUBE_MAP_POSITIVE_Z,r.TEXTURE_CUBE_MAP_NEGATIVE_Z,r.TEXTURE_CUBE_MAP_NEGATIVE_X,r.TEXTURE_CUBE_MAP_POSITIVE_X,r.TEXTURE_CUBE_MAP_POSITIVE_Y,r.TEXTURE_CUBE_MAP_NEGATIVE_Y]}return i.prototype=Object.assign(Object.create(e.prototype),{constructor:i,getTarget:function(){return this.target},getTargets:function(){return this.targets},clearTexture:function(){var e=new Uint8Array([255,255,255,255]);return function(){var t=this.getBrowser().getContext(),i=this.getTargets();t.bindTexture(this.getTarget(),this.getTexture());for(var r=0,n=i.length;r<n;++r)t.texImage2D(i[r],0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,e)}}(),updateTextureProperties:function(){e.prototype.updateTextureProperties.call(this,this.target,this.textureProperties_.getValue(),this.texturePropertiesNode,128,128,!1,!1,!1)},setShaderUniformsToChannel:function(e,t,i,r){e.activeTexture(e.TEXTURE0+t.getBrowser().getCubeMapTextureUnits()[r]),e.bindTexture(e.TEXTURE_CUBE_MAP,this.getTexture()),e.uniform1i(t.x3d_TextureType[r],4)}}),i}),e("x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(e,t,i,r,n,s){"use strict";function a(e){r.call(this,e),this.addType(s.ComposedCubeMapTexture),this.addAlias("front",this.frontTexture_),this.addAlias("back",this.backTexture_),this.addAlias("left",this.leftTexture_),this.addAlias("right",this.rightTexture_),this.addAlias("bottom",this.bottomTexture_),this.addAlias("top",this.topTexture_),this.textures=[null,null,null,null,null,null],this.loadStates=0}return a.prototype=Object.assign(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"description",new e.SFString),new t(s.inputOutput,"frontTexture",new e.SFNode),new t(s.inputOutput,"backTexture",new e.SFNode),new t(s.inputOutput,"leftTexture",new e.SFNode),new t(s.inputOutput,"rightTexture",new e.SFNode),new t(s.inputOutput,"bottomTexture",new e.SFNode),new t(s.inputOutput,"topTexture",new e.SFNode),new t(s.initializeOnly,"textureProperties",new e.SFNode)]),getTypeName:function(){return"ComposedCubeMapTexture"},getComponentName:function(){return"CubeMapTexturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),this.clearTexture(),this.frontTexture_.addInterest("set_texture__",this,0),this.backTexture_.addInterest("set_texture__",this,1),this.leftTexture_.addInterest("set_texture__",this,2),this.rightTexture_.addInterest("set_texture__",this,3),this.topTexture_.addInterest("set_texture__",this,5),this.bottomTexture_.addInterest("set_texture__",this,4),this.set_texture__(this.frontTexture_,0),this.set_texture__(this.backTexture_,1),this.set_texture__(this.leftTexture_,2),this.set_texture__(this.rightTexture_,3),this.set_texture__(this.topTexture_,4),this.set_texture__(this.bottomTexture_,5)},set_texture__:function(e,t){var i=this.textures[t];if(i){var r="set_loadState__"+i.getId()+"_"+t;i.removeInterest("set_loadState__",this),i.loadState_.removeFieldCallback(r)}var i=this.textures[t]=n(s.X3DTexture2DNode,e);if(i){var r="set_loadState__"+i.getId()+"_"+t;i.addInterest("set_loadState__",this,i,t),i.loadState_.addFieldCallback(r,this.set_loadState__.bind(this,null,i,t))}this.set_loadState__(null,i,t)},set_loadState__:function(e,t,i){t?this.setLoadStateBit(t.checkLoadState(),t.getData(),i):this.setLoadStateBit(s.NOT_STARTED,null,i),this.setTextures()},setLoadStateBit:function(e,t,i){e===s.COMPLETE_STATE||t?this.loadStates|=1<<i:this.loadStates&=~(1<<i)},isComplete:function(){if(63!==this.loadStates)return!1;for(var e=this.textures,t=e[0].getWidth(),i=0;i<6;++i){var r=e[i];if(r.getWidth()!==t)return!1;if(r.getHeight()!==t)return!1}return!0},setTextures:function(){var e=this.getBrowser().getContext();if(e.bindTexture(this.getTarget(),this.getTexture()),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),this.isComplete()){for(var t=this.textures,i=0;i<6;++i){var e=this.getBrowser().getContext(),r=t[i],n=r.getWidth(),s=r.getHeight(),a=r.getData();e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!r.getFlipY()),e.pixelStorei(e.UNPACK_ALIGNMENT,1),a instanceof Uint8Array?e.texImage2D(this.getTargets()[i],0,e.RGBA,n,s,!1,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(this.getTargets()[i],0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,a)}this.updateTextureProperties()}else this.clearTexture();this.set_transparent__()},set_transparent__:function(){var e=this.textures,t=!1;if(this.isComplete())for(var i=0;i<6;++i)if(e[i].transparent_.getValue()){t=!0;break}this.setTransparent(t)}}),a}),e("x_ite/Rendering/DependentRenderer",["x_ite/Basic/X3DBaseNode","x_ite/Rendering/X3DRenderObject","x_ite/Bits/TraverseType"],function(e,t,i){"use strict";function r(i){e.call(this,i),t.call(this,i),this.renderObject=null}return r.prototype=Object.assign(Object.create(e.prototype),t.prototype,{constructor:r,initialize:function(){e.prototype.initialize.call(this),t.prototype.initialize.call(this)},isIndependent:function(){return!1},setRenderer:function(e){this.renderObject=e},getBrowser:function(){return this.renderObject.getBrowser()},getLayer:function(){return this.renderObject.getLayer()},getBackground:function(){return this.renderObject.getBackground()},getFog:function(){return this.renderObject.getFog()},getNavigationInfo:function(){return this.renderObject.getNavigationInfo()},getViewpoint:function(){return this.renderObject.getViewpoint()},getLightContainer:function(){return this.renderObject.getLights()[this.lightIndex++]},render:function(e,r,n){switch(e){case i.COLLISION:t.prototype.render.call(this,e,r,n);break;case i.SHADOW:t.prototype.render.call(this,e,r,n);break;case i.DISPLAY:this.lightIndex=0,t.prototype.render.call(this,e,r,n);for(const e of this.renderObject.getLights())e.getModelViewMatrix().pop()}}}),r}),e("x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode","x_ite/Rendering/DependentRenderer","x_ite/Rendering/TextureBuffer","x_ite/Bits/X3DConstants","x_ite/Bits/TraverseType","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(e,t,i,r,n,s,a,o,u,h,d,g,p,x,c){"use strict";function _(e){r.call(this,e),this.addType(a.GeneratedCubeMapTexture),this.renderer=new n(e),this.projectionMatrix=new x,this.modelMatrix=new x,this.viewVolume=new h}var l=[new d(g.zAxis,new g(0,0,-1)),new d(g.zAxis,new g(0,0,1)),new d(g.zAxis,new g(1,0,0)),new d(g.zAxis,new g(-1,0,0)),new d(g.zAxis,new g(0,-1,0)),new d(g.zAxis,new g(0,1,0))],T=[new g(-1,-1,1),new g(-1,-1,1),new g(-1,-1,1),new g(-1,-1,1),new g(1,1,1),new g(1,1,1)],f=new x;return _.prototype=Object.assign(Object.create(r.prototype),{constructor:_,fieldDefinitions:new i([new t(a.inputOutput,"metadata",new e.SFNode),new t(a.inputOutput,"description",new e.SFString),new t(a.inputOutput,"update",new e.SFString("NONE")),new t(a.initializeOnly,"size",new e.SFInt32(128)),new t(a.initializeOnly,"textureProperties",new e.SFNode)]),getTypeName:function(){return"GeneratedCubeMapTexture"},getComponentName:function(){return"CubeMapTexturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),this.renderer.setup();var e=c.nextPowerOfTwo(this.size_.getValue());if(e>0){e=c.nextPowerOfTwo(e);var t=this.getBrowser().getContext(),i=new Uint8Array(e*e*4);t.bindTexture(this.getTarget(),this.getTexture());for(var n=0;n<6;++n)t.texImage2D(this.getTargets()[n],0,t.RGBA,e,e,0,t.RGBA,t.UNSIGNED_BYTE,i);this.viewport=new p(0,0,e,e),this.frameBuffer=new s(this.getBrowser(),e,e)}},traverse:function(e,t){e===o.DISPLAY&&"NONE"!==this.update_.getValue()&&this.frameBuffer&&t.isIndependent()&&(t.getGeneratedCubeMapTextures().push(this),this.modelMatrix.assign(t.getModelViewMatrix().get()).multRight(t.getCameraSpaceMatrix().get()))},renderTexture:function(e){this.renderer.setRenderer(e);var t=this.renderer,i=e.getBrowser(),r=e.getLayer(),n=i.getContext(),s=t.getBackground(),a=t.getNavigationInfo(),h=t.getViewpoint(),d=i.getHeadlight(),g=a.headlight_.getValue(),p=a.getNearValue(),_=a.getFarValue(h),w=u.perspective(c.radians(90),p,_,1,1,this.projectionMatrix);this.setTransparent(s.getTransparent()),this.frameBuffer.bind(),t.getViewVolumes().push(this.viewVolume.set(w,this.viewport,this.viewport)),t.getProjectionMatrix().pushMatrix(w),n.bindTexture(this.getTarget(),this.getTexture()),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);for(var m=0;m<6;++m){n.clear(n.COLOR_BUFFER_BIT),t.getCameraSpaceMatrix().pushMatrix(this.modelMatrix),t.getCameraSpaceMatrix().rotate(l[m]),t.getCameraSpaceMatrix().scale(T[m]);try{t.getViewMatrix().pushMatrix(f.assign(t.getCameraSpaceMatrix().get()).inverse())}catch(e){console.log(e),t.getViewMatrix().pushMatrix(x.Identity)}t.getModelViewMatrix().pushMatrix(f),g&&(d.getModelViewMatrix().pushMatrix(f),d.getModelViewMatrix().multLeft(h.getCameraSpaceMatrix())),r.traverse(o.DISPLAY,t),g&&d.getModelViewMatrix().pop(),t.getModelViewMatrix().pop(),t.getCameraSpaceMatrix().pop(),t.getViewMatrix().pop();var C=this.frameBuffer.readPixels(),M=this.frameBuffer.getWidth(),S=this.frameBuffer.getHeight();n.texImage2D(this.getTargets()[m],0,n.RGBA,M,S,!1,n.RGBA,n.UNSIGNED_BYTE,C)}this.updateTextureProperties(),t.getProjectionMatrix().pop(),t.getViewVolumes().pop(),this.frameBuffer.unbind(),"NEXT_FRAME_ONLY"===this.update_.getValue()&&(this.update_="NONE")},setShaderUniformsToChannel:function(){const e=new Float32Array(16);return function(t,i,n,s){r.prototype.setShaderUniformsToChannel.call(this,t,i,n,s),n.isIndependent()||t.uniformMatrix4fv(i.x3d_ModelViewMatrix,!1,e)}}()}),_}),e("x_ite/Components/CubeMapTexturing/ImageCubeMapTexture",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Algorithm","x_ite/DEBUG"],function(e,t,i,r,n,s,a,o,u,h){"use strict";function d(e){n.call(this,e),s.call(this,e),this.addType(a.ImageCubeMapTexture),this.urlStack=new t.MFString}const g=new Uint8Array([255,255,255,255]),p=[new o(1,1),new o(3,1),new o(0,1),new o(2,1),new o(1,0),new o(1,2)];return d.prototype=Object.assign(Object.create(n.prototype),s.prototype,{constructor:d,fieldDefinitions:new r([new i(a.inputOutput,"metadata",new t.SFNode),new i(a.inputOutput,"description",new t.SFString),new i(a.inputOutput,"url",new t.MFString),new i(a.inputOutput,"autoRefresh",new t.SFTime),new i(a.inputOutput,"autoRefreshTimeLimit",new t.SFTime(3600)),new i(a.initializeOnly,"textureProperties",new t.SFNode)]),getTypeName:function(){return"ImageCubeMapTexture"},getComponentName:function(){return"CubeMapTexturing"},getContainerField:function(){return"texture"},initialize:function(){n.prototype.initialize.call(this),s.prototype.initialize.call(this);const t=this.getBrowser().getContext();t.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)t.texImage2D(this.getTargets()[e],0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,g);this.url_.addInterest("set_url__",this),this.canvas=e("<canvas></canvas>"),this.image=e("<img></img>"),this.image.on("load",this.setImage.bind(this)),this.image.on("error",this.setError.bind(this)),this.image.bind("abort",this.setError.bind(this)),this.image[0].crossOrigin="Anonymous",this.requestImmediateLoad()},set_url__:function(){this.setLoadState(a.NOT_STARTED_STATE),this.requestImmediateLoad()},requestImmediateLoad:function(e=!0){this.checkLoadState()!==a.COMPLETE_STATE&&this.checkLoadState()!==a.IN_PROGRESS_STATE&&(this.setCache(e),this.setLoadState(a.IN_PROGRESS_STATE),this.urlStack.setValue(this.url_),this.loadNext())},loadNext:function(){if(0===this.urlStack.length)return this.clearTexture(),void this.setLoadState(a.FAILED_STATE);this.URL=new URL(this.urlStack.shift(),this.getExecutionContext().getWorldURL()),this.getBrowser().getBrowserOptions().getCache()&&this.getCache()||this.URL.searchParams.set("_",Date.now()),this.image.attr("src",this.URL.href)},setError:function(){"data:"!==this.URL.protocol&&console.warn("Error loading image:",this.URL.href),this.loadNext()},setImage:function(){h&&"data:"!==this.URL.protocol&&console.info("Done loading image cube map texture:",this.URL.href);try{const e=this.image[0],t=this.canvas[0],i=t.getContext("2d");let r=e.width,n=e.height,s=Math.floor(r/4),o=Math.floor(n/3);u.isPowerOfTwo(s)&&u.isPowerOfTwo(o)&&4*s===r&&3*o===n?(t.width=r,t.height=n,i.drawImage(e,0,0)):(s=u.nextPowerOfTwo(s),o=u.nextPowerOfTwo(o),r=4*s,n=3*o,t.width=r,t.height=n,i.drawImage(e,0,0,e.width,e.height,0,0,r,n));const h=this.getBrowser().getContext();let d=!0;h.bindTexture(this.getTarget(),this.getTexture()),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1);for(let e=0;e<6;++e){const t=i.getImageData(p[e].x*s,p[e].y*o,s,o).data;if(d)for(let e=3;e<t.length;e+=4)if(255!==t[e]){d=!1;break}h.texImage2D(this.getTargets()[e],0,h.RGBA,s,o,!1,h.RGBA,h.UNSIGNED_BYTE,new Uint8Array(t))}this.updateTextureProperties(),this.setTransparent(!d),this.setLoadState(a.COMPLETE_STATE)}catch(e){console.log(e.message),this.setError()}}}),d}),e(["x_ite/Components","x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture","x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture","x_ite/Components/CubeMapTexturing/ImageCubeMapTexture","x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode"],function(e,t,i,r,n){"use strict";e.addComponent({name:"CubeMapTexturing",types:{ComposedCubeMapTexture:t,GeneratedCubeMapTexture:i,ImageCubeMapTexture:r},abstractTypes:{X3DEnvironmentTextureNode:n}})})}();
|
|
1
|
+
!function(e,t){"undefined"==typeof __filename&&void 0;const i=X3D.define,r=X3D.require;i("x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode",["x_ite/Components/Texturing/X3DSingleTextureNode","x_ite/Bits/X3DConstants"],function(e,t){"use strict";function i(i){e.call(this,i),this.addType(t.X3DEnvironmentTextureNode);const r=this.getBrowser().getContext();this.target=r.TEXTURE_CUBE_MAP,this.targets=[r.TEXTURE_CUBE_MAP_POSITIVE_Z,r.TEXTURE_CUBE_MAP_NEGATIVE_Z,r.TEXTURE_CUBE_MAP_NEGATIVE_X,r.TEXTURE_CUBE_MAP_POSITIVE_X,r.TEXTURE_CUBE_MAP_POSITIVE_Y,r.TEXTURE_CUBE_MAP_NEGATIVE_Y]}return i.prototype=Object.assign(Object.create(e.prototype),{constructor:i,getTarget:function(){return this.target},getTargets:function(){return this.targets},clearTexture:function(){var e=new Uint8Array([255,255,255,255]);return function(){var t=this.getBrowser().getContext(),i=this.getTargets();t.bindTexture(this.getTarget(),this.getTexture());for(var r=0,n=i.length;r<n;++r)t.texImage2D(i[r],0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,e)}}(),updateTextureProperties:function(){e.prototype.updateTextureProperties.call(this,this.target,this.textureProperties_.getValue(),this.texturePropertiesNode,128,128,!1,!1,!1)},setShaderUniformsToChannel:function(e,t,i,r){e.activeTexture(e.TEXTURE0+t.getBrowser().getCubeMapTextureUnits()[r]),e.bindTexture(e.TEXTURE_CUBE_MAP,this.getTexture()),e.uniform1i(t.x3d_TextureType[r],4)}}),i}),i("x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(e,t,i,r,n,s){"use strict";function a(e){r.call(this,e),this.addType(s.ComposedCubeMapTexture),this.addAlias("front",this.frontTexture_),this.addAlias("back",this.backTexture_),this.addAlias("left",this.leftTexture_),this.addAlias("right",this.rightTexture_),this.addAlias("bottom",this.bottomTexture_),this.addAlias("top",this.topTexture_),this.textures=[null,null,null,null,null,null],this.loadStates=0}return a.prototype=Object.assign(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new t(s.inputOutput,"metadata",new e.SFNode),new t(s.inputOutput,"description",new e.SFString),new t(s.inputOutput,"frontTexture",new e.SFNode),new t(s.inputOutput,"backTexture",new e.SFNode),new t(s.inputOutput,"leftTexture",new e.SFNode),new t(s.inputOutput,"rightTexture",new e.SFNode),new t(s.inputOutput,"bottomTexture",new e.SFNode),new t(s.inputOutput,"topTexture",new e.SFNode),new t(s.initializeOnly,"textureProperties",new e.SFNode)]),getTypeName:function(){return"ComposedCubeMapTexture"},getComponentName:function(){return"CubeMapTexturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),this.clearTexture(),this.frontTexture_.addInterest("set_texture__",this,0),this.backTexture_.addInterest("set_texture__",this,1),this.leftTexture_.addInterest("set_texture__",this,2),this.rightTexture_.addInterest("set_texture__",this,3),this.topTexture_.addInterest("set_texture__",this,5),this.bottomTexture_.addInterest("set_texture__",this,4),this.set_texture__(this.frontTexture_,0),this.set_texture__(this.backTexture_,1),this.set_texture__(this.leftTexture_,2),this.set_texture__(this.rightTexture_,3),this.set_texture__(this.topTexture_,4),this.set_texture__(this.bottomTexture_,5)},set_texture__:function(e,t){var i=this.textures[t];if(i){var r="set_loadState__"+i.getId()+"_"+t;i.removeInterest("set_loadState__",this),i.loadState_.removeFieldCallback(r)}var i=this.textures[t]=n(s.X3DTexture2DNode,e);if(i){var r="set_loadState__"+i.getId()+"_"+t;i.addInterest("set_loadState__",this,i,t),i.loadState_.addFieldCallback(r,this.set_loadState__.bind(this,null,i,t))}this.set_loadState__(null,i,t)},set_loadState__:function(e,t,i){t?this.setLoadStateBit(t.checkLoadState(),t.getData(),i):this.setLoadStateBit(s.NOT_STARTED,null,i),this.setTextures()},setLoadStateBit:function(e,t,i){e===s.COMPLETE_STATE||t?this.loadStates|=1<<i:this.loadStates&=~(1<<i)},isComplete:function(){if(63!==this.loadStates)return!1;for(var e=this.textures,t=e[0].getWidth(),i=0;i<6;++i){var r=e[i];if(r.getWidth()!==t)return!1;if(r.getHeight()!==t)return!1}return!0},setTextures:function(){var e=this.getBrowser().getContext();if(e.bindTexture(this.getTarget(),this.getTexture()),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!1),this.isComplete()){for(var t=this.textures,i=0;i<6;++i){var e=this.getBrowser().getContext(),r=t[i],n=r.getWidth(),s=r.getHeight(),a=r.getData();e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,!r.getFlipY()),e.pixelStorei(e.UNPACK_ALIGNMENT,1),a instanceof Uint8Array?e.texImage2D(this.getTargets()[i],0,e.RGBA,n,s,!1,e.RGBA,e.UNSIGNED_BYTE,a):e.texImage2D(this.getTargets()[i],0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,a)}this.updateTextureProperties()}else this.clearTexture();this.set_transparent__()},set_transparent__:function(){var e=this.textures,t=!1;if(this.isComplete())for(var i=0;i<6;++i)if(e[i].transparent_.getValue()){t=!0;break}this.setTransparent(t)}}),a}),i("x_ite/Rendering/DependentRenderer",["x_ite/Basic/X3DBaseNode","x_ite/Rendering/X3DRenderObject","x_ite/Bits/TraverseType"],function(e,t,i){"use strict";function r(i){e.call(this,i),t.call(this,i),this.renderObject=null}return r.prototype=Object.assign(Object.create(e.prototype),t.prototype,{constructor:r,initialize:function(){e.prototype.initialize.call(this),t.prototype.initialize.call(this)},isIndependent:function(){return!1},setRenderer:function(e){this.renderObject=e},getBrowser:function(){return this.renderObject.getBrowser()},getLayer:function(){return this.renderObject.getLayer()},getBackground:function(){return this.renderObject.getBackground()},getFog:function(){return this.renderObject.getFog()},getNavigationInfo:function(){return this.renderObject.getNavigationInfo()},getViewpoint:function(){return this.renderObject.getViewpoint()},getLightContainer:function(){return this.renderObject.getLights()[this.lightIndex++]},render:function(e,r,n){switch(e){case i.COLLISION:t.prototype.render.call(this,e,r,n);break;case i.SHADOW:t.prototype.render.call(this,e,r,n);break;case i.DISPLAY:this.lightIndex=0,t.prototype.render.call(this,e,r,n);for(const e of this.renderObject.getLights())e.getModelViewMatrix().pop()}}}),r}),i("x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode","x_ite/Rendering/DependentRenderer","x_ite/Rendering/TextureBuffer","x_ite/Bits/X3DConstants","x_ite/Bits/TraverseType","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(e,t,i,r,n,s,a,o,u,h,d,g,p,x,c){"use strict";function l(e){r.call(this,e),this.addType(a.GeneratedCubeMapTexture),this.renderer=new n(e),this.projectionMatrix=new x,this.modelMatrix=new x,this.viewVolume=new h}var _=[new d(g.zAxis,new g(0,0,-1)),new d(g.zAxis,new g(0,0,1)),new d(g.zAxis,new g(1,0,0)),new d(g.zAxis,new g(-1,0,0)),new d(g.zAxis,new g(0,-1,0)),new d(g.zAxis,new g(0,1,0))],T=[new g(-1,-1,1),new g(-1,-1,1),new g(-1,-1,1),new g(-1,-1,1),new g(1,1,1),new g(1,1,1)],f=new x;return l.prototype=Object.assign(Object.create(r.prototype),{constructor:l,fieldDefinitions:new i([new t(a.inputOutput,"metadata",new e.SFNode),new t(a.inputOutput,"description",new e.SFString),new t(a.inputOutput,"update",new e.SFString("NONE")),new t(a.initializeOnly,"size",new e.SFInt32(128)),new t(a.initializeOnly,"textureProperties",new e.SFNode)]),getTypeName:function(){return"GeneratedCubeMapTexture"},getComponentName:function(){return"CubeMapTexturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),this.renderer.setup();var e=c.nextPowerOfTwo(this.size_.getValue());if(e>0){e=c.nextPowerOfTwo(e);var t=this.getBrowser().getContext(),i=new Uint8Array(e*e*4);t.bindTexture(this.getTarget(),this.getTexture());for(var n=0;n<6;++n)t.texImage2D(this.getTargets()[n],0,t.RGBA,e,e,0,t.RGBA,t.UNSIGNED_BYTE,i);this.viewport=new p(0,0,e,e),this.frameBuffer=new s(this.getBrowser(),e,e)}},traverse:function(e,t){e===o.DISPLAY&&"NONE"!==this.update_.getValue()&&this.frameBuffer&&t.isIndependent()&&(t.getGeneratedCubeMapTextures().push(this),this.modelMatrix.assign(t.getModelViewMatrix().get()).multRight(t.getCameraSpaceMatrix().get()))},renderTexture:function(e){this.renderer.setRenderer(e);var t=this.renderer,i=e.getBrowser(),r=e.getLayer(),n=i.getContext(),s=t.getBackground(),a=t.getNavigationInfo(),h=t.getViewpoint(),d=i.getHeadlight(),g=a.headlight_.getValue(),p=a.getNearValue(),l=a.getFarValue(h),w=u.perspective(c.radians(90),p,l,1,1,this.projectionMatrix);this.setTransparent(s.getTransparent()),this.frameBuffer.bind(),t.getViewVolumes().push(this.viewVolume.set(w,this.viewport,this.viewport)),t.getProjectionMatrix().pushMatrix(w),n.bindTexture(this.getTarget(),this.getTexture()),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,!1);for(var m=0;m<6;++m){n.clear(n.COLOR_BUFFER_BIT),t.getCameraSpaceMatrix().pushMatrix(this.modelMatrix),t.getCameraSpaceMatrix().rotate(_[m]),t.getCameraSpaceMatrix().scale(T[m]);try{t.getViewMatrix().pushMatrix(f.assign(t.getCameraSpaceMatrix().get()).inverse())}catch(e){console.log(e),t.getViewMatrix().pushMatrix(x.Identity)}t.getModelViewMatrix().pushMatrix(f),g&&(d.getModelViewMatrix().pushMatrix(f),d.getModelViewMatrix().multLeft(h.getCameraSpaceMatrix())),r.traverse(o.DISPLAY,t),g&&d.getModelViewMatrix().pop(),t.getModelViewMatrix().pop(),t.getCameraSpaceMatrix().pop(),t.getViewMatrix().pop();var C=this.frameBuffer.readPixels(),M=this.frameBuffer.getWidth(),S=this.frameBuffer.getHeight();n.texImage2D(this.getTargets()[m],0,n.RGBA,M,S,!1,n.RGBA,n.UNSIGNED_BYTE,C)}this.updateTextureProperties(),t.getProjectionMatrix().pop(),t.getViewVolumes().pop(),this.frameBuffer.unbind(),"NEXT_FRAME_ONLY"===this.update_.getValue()&&(this.update_="NONE")},setShaderUniformsToChannel:function(){const e=new Float32Array(16);return function(t,i,n,s){r.prototype.setShaderUniformsToChannel.call(this,t,i,n,s),n.isIndependent()||t.uniformMatrix4fv(i.x3d_ModelViewMatrix,!1,e)}}()}),l}),i("x_ite/Components/CubeMapTexturing/ImageCubeMapTexture",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Algorithm","x_ite/DEBUG"],function(e,t,i,r,n,s,a,o,u,h){"use strict";function d(e){n.call(this,e),s.call(this,e),this.addType(a.ImageCubeMapTexture),this.urlStack=new t.MFString}const g=new Uint8Array([255,255,255,255]),p=[new o(1,1),new o(3,1),new o(0,1),new o(2,1),new o(1,0),new o(1,2)];return d.prototype=Object.assign(Object.create(n.prototype),s.prototype,{constructor:d,fieldDefinitions:new r([new i(a.inputOutput,"metadata",new t.SFNode),new i(a.inputOutput,"description",new t.SFString),new i(a.inputOutput,"url",new t.MFString),new i(a.inputOutput,"autoRefresh",new t.SFTime),new i(a.inputOutput,"autoRefreshTimeLimit",new t.SFTime(3600)),new i(a.initializeOnly,"textureProperties",new t.SFNode)]),getTypeName:function(){return"ImageCubeMapTexture"},getComponentName:function(){return"CubeMapTexturing"},getContainerField:function(){return"texture"},initialize:function(){n.prototype.initialize.call(this),s.prototype.initialize.call(this);const t=this.getBrowser().getContext();t.bindTexture(this.getTarget(),this.getTexture());for(let e=0;e<6;++e)t.texImage2D(this.getTargets()[e],0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,g);this.url_.addInterest("set_url__",this),this.canvas=e("<canvas></canvas>"),this.image=e("<img></img>"),this.image.on("load",this.setImage.bind(this)),this.image.on("error",this.setError.bind(this)),this.image.bind("abort",this.setError.bind(this)),this.image[0].crossOrigin="Anonymous",this.requestImmediateLoad()},set_url__:function(){this.setLoadState(a.NOT_STARTED_STATE),this.requestImmediateLoad()},requestImmediateLoad:function(e=!0){this.checkLoadState()!==a.COMPLETE_STATE&&this.checkLoadState()!==a.IN_PROGRESS_STATE&&(this.setCache(e),this.setLoadState(a.IN_PROGRESS_STATE),this.urlStack.setValue(this.url_),this.loadNext())},loadNext:function(){if(0===this.urlStack.length)return this.clearTexture(),void this.setLoadState(a.FAILED_STATE);this.URL=new URL(this.urlStack.shift(),this.getExecutionContext().getWorldURL()),this.getBrowser().getBrowserOptions().getCache()&&this.getCache()||this.URL.searchParams.set("_",Date.now()),this.image.attr("src",this.URL.href)},setError:function(){"data:"!==this.URL.protocol&&console.warn("Error loading image:",this.URL.href),this.loadNext()},setImage:function(){h&&"data:"!==this.URL.protocol&&console.info("Done loading image cube map texture:",this.URL.href);try{const e=this.image[0],t=this.canvas[0],i=t.getContext("2d");let r=e.width,n=e.height,s=Math.floor(r/4),o=Math.floor(n/3);u.isPowerOfTwo(s)&&u.isPowerOfTwo(o)&&4*s===r&&3*o===n?(t.width=r,t.height=n,i.drawImage(e,0,0)):(s=u.nextPowerOfTwo(s),o=u.nextPowerOfTwo(o),r=4*s,n=3*o,t.width=r,t.height=n,i.drawImage(e,0,0,e.width,e.height,0,0,r,n));const h=this.getBrowser().getContext();let d=!0;h.bindTexture(this.getTarget(),this.getTexture()),h.pixelStorei(h.UNPACK_FLIP_Y_WEBGL,!1);for(let e=0;e<6;++e){const t=i.getImageData(p[e].x*s,p[e].y*o,s,o).data;if(d)for(let e=3;e<t.length;e+=4)if(255!==t[e]){d=!1;break}h.texImage2D(this.getTargets()[e],0,h.RGBA,s,o,!1,h.RGBA,h.UNSIGNED_BYTE,new Uint8Array(t))}this.updateTextureProperties(),this.setTransparent(!d),this.setLoadState(a.COMPLETE_STATE)}catch(e){console.log(e.message),this.setError()}}}),d}),i(r.getComponentUrl("cube-map-texturing"),["x_ite/Components","x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture","x_ite/Components/CubeMapTexturing/GeneratedCubeMapTexture","x_ite/Components/CubeMapTexturing/ImageCubeMapTexture","x_ite/Components/CubeMapTexturing/X3DEnvironmentTextureNode"],function(e,t,i,r,n){"use strict";e.addComponent({name:"CubeMapTexturing",types:{ComposedCubeMapTexture:t,GeneratedCubeMapTexture:i,ImageCubeMapTexture:r},abstractTypes:{X3DEnvironmentTextureNode:n}})})}("object"==typeof module?module:void 0,"function"==typeof require?require:void 0);
|