x_ite 8.6.24 → 8.7.0
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/README.md +2 -0
- package/dist/assets/components/Annotation.js +13 -13
- package/dist/assets/components/Annotation.min.js +1 -1
- package/dist/assets/components/CADGeometry.js +13 -13
- package/dist/assets/components/CADGeometry.min.js +1 -1
- package/dist/assets/components/CubeMapTexturing.js +34 -39
- package/dist/assets/components/CubeMapTexturing.min.js +1 -1
- package/dist/assets/components/DIS.js +13 -13
- package/dist/assets/components/DIS.min.js +1 -1
- package/dist/assets/components/EventUtilities.js +9 -9
- package/dist/assets/components/EventUtilities.min.js +1 -1
- package/dist/assets/components/Geometry2D.js +19 -19
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +33 -33
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +18 -18
- package/dist/assets/components/HAnim.min.js +1 -1
- package/dist/assets/components/KeyDeviceSensor.js +8 -8
- package/dist/assets/components/KeyDeviceSensor.min.js +1 -1
- package/dist/assets/components/Layout.js +27 -27
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +32 -32
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +22 -22
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +26 -26
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +20 -20
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +28 -28
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +24 -24
- package/dist/assets/components/Text.min.js +1 -1
- package/dist/assets/components/TextureProjector.js +14 -14
- package/dist/assets/components/TextureProjector.min.js +1 -1
- package/dist/assets/components/Texturing3D.js +1116 -1685
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +25 -25
- package/dist/assets/components/VolumeRendering.min.js +1 -1
- package/dist/assets/components/X_ITE.js +9 -9
- package/dist/assets/components/X_ITE.min.js +1 -1
- package/dist/x_ite.css +1 -1
- package/dist/x_ite.js +275 -235
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +1 -1
- package/docs/_posts/accessing-the-external-browser.md +1 -1
- package/docs/_posts/components/Geospatial/GeoViewpoint.md +41 -0
- package/docs/_posts/components/Navigation/OrthoViewpoint.md +41 -0
- package/docs/_posts/components/Navigation/Viewpoint.md +41 -0
- package/docs/_posts/components/Networking/Inline.md +1 -1
- package/docs/_posts/components/X_ITE/BlendMode.md +1 -1
- package/docs/_posts/getting-started.md +4 -1
- package/docs/_posts/glossary.md +3 -3
- package/docs/_posts/laboratory/x3d-file-converter.md +1 -1
- package/docs/_posts/reference/browser-services.md +48 -20
- package/docs/_posts/reference/field-services-and-objects.md +23 -23
- package/docs/_posts/reference/scene-services.md +1 -1
- package/docs/_posts/supported-nodes.md +1 -1
- package/docs/_posts/tutorials/basic-nodes.md +1 -1
- package/docs/_posts/tutorials/building-a-x3d-world.md +1 -1
- package/docs/_posts/tutorials/building-primitive-shapes.md +1 -1
- package/docs/_posts/tutorials/increasing-rendering-speed.md +1 -1
- package/docs/_posts/tutorials/introducing-x3d.md +1 -1
- package/docs/_posts/tutorials/overview.md +1 -1
- package/docs/_posts/what's-new.md +11 -1
- package/package.json +4 -4
- package/src/x_ite/Base/X3DBaseNode.js +2 -2
- package/src/x_ite/Base/X3DField.js +4 -4
- package/src/x_ite/Browser/Core/BrowserOptions.js +12 -4
- package/src/x_ite/Browser/Core/X3DCoreContext.js +79 -31
- package/src/x_ite/Browser/NURBS/NURBS.js +3 -3
- package/src/x_ite/Browser/Shaders/X3DShadersContext.js +2 -2
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +10 -11
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +52 -28
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +9 -14
- package/src/x_ite/Components/EnvironmentalEffects/Background.js +6 -6
- package/src/x_ite/Components/EnvironmentalEffects/TextureBackground.js +14 -34
- package/src/x_ite/Components/EnvironmentalEffects/X3DBackgroundNode.js +9 -36
- package/src/x_ite/Components/NURBS/NurbsCurve.js +1 -1
- package/src/x_ite/Components/NURBS/NurbsCurve2D.js +1 -1
- package/src/x_ite/Components/NURBS/NurbsOrientationInterpolator.js +1 -1
- package/src/x_ite/Components/NURBS/NurbsPositionInterpolator.js +1 -1
- package/src/x_ite/Components/NURBS/X3DNurbsSurfaceGeometryNode.js +1 -1
- package/src/x_ite/Components/Picking/LinePickSensor.js +2 -2
- package/src/x_ite/Components/Picking/PointPickSensor.js +2 -2
- package/src/x_ite/Components/Picking/PrimitivePickSensor.js +2 -2
- package/src/x_ite/Components/Picking/VolumePickSensor.js +2 -2
- package/src/x_ite/Components/RigidBodyPhysics/CollisionSensor.js +1 -1
- package/src/x_ite/Components/RigidBodyPhysics/MotorJoint.js +1 -1
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +1 -1
- package/src/x_ite/Components/Sound/ListenerPointSource.js +2 -1
- package/src/x_ite/Components/Sound/MicrophoneSource.js +2 -1
- package/src/x_ite/Components/Sound/OscillatorSource.js +2 -1
- package/src/x_ite/Components/Sound/StreamAudioSource.js +2 -1
- package/src/x_ite/Components/Sound/X3DSoundProcessingNode.js +3 -0
- package/src/x_ite/Components/VolumeRendering/IsoSurfaceVolumeData.js +2 -2
- package/src/x_ite/Components/VolumeRendering/SegmentedVolumeData.js +2 -2
- package/src/x_ite/Components/VolumeRendering/VolumeData.js +2 -2
- package/src/x_ite/Fields/SFNode.js +5 -5
- package/src/x_ite/Fields.js +5 -4
- package/src/x_ite/Parser/X3DParser.js +1 -1
- package/src/x_ite/X3DCanvasElement.js +4 -4
- package/src/x_ite.html +1 -1
- package/x_ite.min.html +1 -1
|
@@ -7,7 +7,7 @@ tags: [Supported, Nodes, Components, Profiles]
|
|
|
7
7
|
---
|
|
8
8
|
## Overview
|
|
9
9
|
|
|
10
|
-
X_ITE supports a certain number of X3D nodes. Objects in
|
|
10
|
+
X_ITE supports a certain number of X3D nodes. Objects in an X3D scene are also called nodes. These nodes are grouped into components and the components are grouped in profiles.
|
|
11
11
|
|
|
12
12
|
The following lists outlines the profiles and nodes that are supported in X_ITE.
|
|
13
13
|
|
|
@@ -253,7 +253,7 @@ DEF LookAtHouse Viewpoint {
|
|
|
253
253
|
|
|
254
254
|
Beside the Viewpoint node there is also an [OrthoViewpoint](../components/navigation/orthoviewpoint) node to define an orthographic camera.
|
|
255
255
|
|
|
256
|
-
If you define more than once viewpoint in
|
|
256
|
+
If you define more than once viewpoint in an X3D file, the first viewpoint defined will be bound if the world is loaded. To bind one of the other viewpoints send a *set\_bind* event with the value TRUE to the viewpoint. You must use a [Script](../components/scripting/script) node for that or use a Anchor node with the name of the viewpoint in the *url* field preceded by '#'.
|
|
257
257
|
|
|
258
258
|
### XML Encoding
|
|
259
259
|
|
|
@@ -7,7 +7,7 @@ tags: [Building, Primitive, Shapes]
|
|
|
7
7
|
---
|
|
8
8
|
## Motivation
|
|
9
9
|
|
|
10
|
-
Shapes are the building blocks of
|
|
10
|
+
Shapes are the building blocks of an X3D world. Primitive Shapes are standard building blocks:
|
|
11
11
|
|
|
12
12
|
- [Box](../components/geometry3d/box)
|
|
13
13
|
- [Cone](../components/geometry3d/cone)
|
|
@@ -32,7 +32,7 @@ Effective use of textures can be a relative inexpensive way to add interest and
|
|
|
32
32
|
|
|
33
33
|
### Use Lights Sparingly
|
|
34
34
|
|
|
35
|
-
Lights are expensive in terms of performance. On most platforms,
|
|
35
|
+
Lights are expensive in terms of performance. On most platforms, an X3D file should contain no more than two or three local lights per shape. Placing a directional light under a Transform node with the *global* field set to FALSE localizes the effect of the light.
|
|
36
36
|
|
|
37
37
|
### Use Fewer Nodes
|
|
38
38
|
|
|
@@ -23,7 +23,7 @@ Simple, fast and efficient, our X3D tutorials give you all the tips and tricks t
|
|
|
23
23
|
Shapes, Geometry, and Appearance
|
|
24
24
|
|
|
25
25
|
- [Introducing X3D](introducing-x3d)
|
|
26
|
-
- [Building
|
|
26
|
+
- [Building an X3D World](building-a-x3d-world)
|
|
27
27
|
- [Building Primitive Shapes ](building-primitive-shapes)
|
|
28
28
|
- [Transforming Shapes](transforming-shapes)
|
|
29
29
|
- [Controlling Appearance with Materials ](controlling-appearance-with-materials)
|
|
@@ -5,6 +5,16 @@ nav: main
|
|
|
5
5
|
categories: []
|
|
6
6
|
tags: [New, Releases]
|
|
7
7
|
---
|
|
8
|
+
## X_ITE v8.7.0 Released
|
|
9
|
+
|
|
10
|
+
*Leipzig, 14th May 2023:* This release comes with a breaking change: `Browser.createX3DFromString` is now asynchronous and returns now a Promise. This ensures that all components are loaded, and all necessary nodes can be provided.
|
|
11
|
+
|
|
12
|
+
In addition, there is now an [automated test suite](https://github.com/create3000/x_ite-tests){:target="_blank"}, which is being expanded on a daily basis.
|
|
13
|
+
|
|
14
|
+
### Breaking Changes
|
|
15
|
+
|
|
16
|
+
- `Browser.createX3DFromString` now returns a Promise.
|
|
17
|
+
|
|
8
18
|
## X_ITE v8.5.2 Released
|
|
9
19
|
|
|
10
20
|
*Leipzig, 28th January 2023:* Now, X_ITE has support for SVG as well as STL support. When a scene is parsed you can, instead of a number use special constants like PI or PI3_4.
|
|
@@ -960,7 +970,7 @@ You can tune the *shadowIntensity*. It is the intensity of the shadow. 0 means n
|
|
|
960
970
|
|
|
961
971
|
## X_ITE v4.1.3 Released
|
|
962
972
|
|
|
963
|
-
*Leipzig, 25th December 2017:* There is now the new BlendMode node in X_ITE available, which gives X3D authors the ability to specify the WebGL blend modes for a node. The node is
|
|
973
|
+
*Leipzig, 25th December 2017:* There is now the new BlendMode node in X_ITE available, which gives X3D authors the ability to specify the WebGL blend modes for a node. The node is an X3DAppearance child node and can be assigned the the new *blendMode* field of a Appearance node. Shader authors have now more control over particle systems, there are three new build in variables available in shaders: *x3d\_ParticleId, x3d\_ParticleLife, x3d\_ParticleElapsedTime, x3d\_ParticlePosition.* For more information have a look at <custom-shaders>.
|
|
964
974
|
|
|
965
975
|
## X_ITE v4.1.2 Released
|
|
966
976
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "x_ite",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.7.0",
|
|
4
4
|
"description": "X_ITE X3D Browser, view and manipulate X3D and VRML scenes in HTML.",
|
|
5
5
|
"homepage": "https://create3000.github.io/x_ite/",
|
|
6
6
|
"author": "Holger Seelig <holger.seelig@gmail.com>",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"css-element-queries": "^1.2.3",
|
|
60
60
|
"dicom-parser": "^1.8.21",
|
|
61
61
|
"jpeg-js": "^0.4.4",
|
|
62
|
-
"jpeg-lossless-decoder-js": "^2.0.
|
|
62
|
+
"jpeg-lossless-decoder-js": "^2.0.5",
|
|
63
63
|
"jquery": "^3.6.4",
|
|
64
64
|
"jquery-fullscreen-plugin": "^1.1.5",
|
|
65
65
|
"jquery-mousewheel": "^3.1.13",
|
|
@@ -71,8 +71,8 @@
|
|
|
71
71
|
"opentype.js": "^1.3.4",
|
|
72
72
|
"pako": "^2.1.0",
|
|
73
73
|
"string-replace-webpack-plugin": "^0.1.3",
|
|
74
|
-
"webpack": "^5.
|
|
75
|
-
"webpack-cli": "^5.
|
|
74
|
+
"webpack": "^5.82.1",
|
|
75
|
+
"webpack-cli": "^5.1.1",
|
|
76
76
|
"webpack-shell-plugin-next": "^2.3.1"
|
|
77
77
|
},
|
|
78
78
|
"scripts": {
|
|
@@ -318,8 +318,8 @@ X3DBaseNode .prototype = Object .assign (Object .create (X3DEventObject .prototy
|
|
|
318
318
|
{
|
|
319
319
|
get: function () { return field; },
|
|
320
320
|
set: function (value) { field .setValue (value); },
|
|
321
|
-
configurable: true,
|
|
322
|
-
enumerable:
|
|
321
|
+
configurable: true,
|
|
322
|
+
enumerable: false,
|
|
323
323
|
});
|
|
324
324
|
|
|
325
325
|
if (!this .isPrivate ())
|
|
@@ -123,15 +123,15 @@ X3DField .prototype = Object .assign (Object .create (X3DChildObject .prototype)
|
|
|
123
123
|
},
|
|
124
124
|
isInitializable: function ()
|
|
125
125
|
{
|
|
126
|
-
return this [_accessType] & X3DConstants .initializeOnly;
|
|
126
|
+
return !! (this [_accessType] & X3DConstants .initializeOnly);
|
|
127
127
|
},
|
|
128
128
|
isInput: function ()
|
|
129
129
|
{
|
|
130
|
-
return this [_accessType] & X3DConstants .inputOnly;
|
|
130
|
+
return !! (this [_accessType] & X3DConstants .inputOnly);
|
|
131
131
|
},
|
|
132
132
|
isOutput: function ()
|
|
133
133
|
{
|
|
134
|
-
return this [_accessType] & X3DConstants .outputOnly;
|
|
134
|
+
return !! (this [_accessType] & X3DConstants .outputOnly);
|
|
135
135
|
},
|
|
136
136
|
isReadable: function ()
|
|
137
137
|
{
|
|
@@ -139,7 +139,7 @@ X3DField .prototype = Object .assign (Object .create (X3DChildObject .prototype)
|
|
|
139
139
|
},
|
|
140
140
|
isWritable: function ()
|
|
141
141
|
{
|
|
142
|
-
return this [_accessType] !== X3DConstants .
|
|
142
|
+
return this [_accessType] !== X3DConstants .outputOnly;
|
|
143
143
|
},
|
|
144
144
|
setUnit: function (value)
|
|
145
145
|
{
|
|
@@ -80,7 +80,7 @@ BrowserOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototy
|
|
|
80
80
|
new X3DFieldDefinition (X3DConstants .inputOutput, "Antialiased", new Fields .SFBool (true)),
|
|
81
81
|
new X3DFieldDefinition (X3DConstants .inputOutput, "TextureQuality", new Fields .SFString ("MEDIUM")),
|
|
82
82
|
new X3DFieldDefinition (X3DConstants .inputOutput, "PrimitiveQuality", new Fields .SFString ("MEDIUM")),
|
|
83
|
-
new X3DFieldDefinition (X3DConstants .inputOutput, "QualityWhenMoving", new Fields .SFString ("
|
|
83
|
+
new X3DFieldDefinition (X3DConstants .inputOutput, "QualityWhenMoving", new Fields .SFString ("SAME")),
|
|
84
84
|
new X3DFieldDefinition (X3DConstants .inputOutput, "Shading", new Fields .SFString ("GOURAUD")),
|
|
85
85
|
new X3DFieldDefinition (X3DConstants .inputOutput, "MotionBlur", new Fields .SFBool ()),
|
|
86
86
|
new X3DFieldDefinition (X3DConstants .inputOutput, "Cache", new Fields .SFBool (true)),
|
|
@@ -131,6 +131,12 @@ BrowserOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototy
|
|
|
131
131
|
this ._Multisampling .addInterest ("set_multisampling__", this);
|
|
132
132
|
this ._Timings .addInterest ("set_timings__", this);
|
|
133
133
|
|
|
134
|
+
this .set_antialiased__ (this ._Antialiased);
|
|
135
|
+
this .set_shading__ (this ._Shading);
|
|
136
|
+
this .set_contentScale__ (this ._ContentScale);
|
|
137
|
+
this .set_logarithmicDepthBuffer__ (this ._LogarithmicDepthBuffer);
|
|
138
|
+
this .set_multisampling__ (this ._Multisampling);
|
|
139
|
+
|
|
134
140
|
this .configure ();
|
|
135
141
|
},
|
|
136
142
|
configure: (function ()
|
|
@@ -168,9 +174,11 @@ BrowserOptions .prototype = Object .assign (Object .create (X3DBaseNode .prototy
|
|
|
168
174
|
attribute = $.toLowerCaseFirst (name),
|
|
169
175
|
value = browser .getElement () .attr (attribute);
|
|
170
176
|
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
177
|
+
if (value !== undefined)
|
|
178
|
+
{
|
|
179
|
+
browser .attributeChangedCallback (attribute, null, value);
|
|
180
|
+
continue;
|
|
181
|
+
}
|
|
174
182
|
}
|
|
175
183
|
|
|
176
184
|
if (restorable .has (name))
|
|
@@ -113,10 +113,10 @@ function X3DCoreContext (element)
|
|
|
113
113
|
this [_localStorage] = new DataStorage (localStorage, "X_ITE.X3DBrowser(" + this [_instanceId] + ").");
|
|
114
114
|
this [_mobile] = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i .test (navigator .userAgent);
|
|
115
115
|
|
|
116
|
-
this [
|
|
116
|
+
this [_renderingProperties] = new RenderingProperties (this .getPrivateScene ());
|
|
117
117
|
this [_browserOptions] = new BrowserOptions (this .getPrivateScene ());
|
|
118
118
|
this [_browserProperties] = new BrowserProperties (this .getPrivateScene ());
|
|
119
|
-
this [
|
|
119
|
+
this [_browserTimings] = new BrowserTimings (this .getPrivateScene ());
|
|
120
120
|
this [_notification] = new Notification (this .getPrivateScene ());
|
|
121
121
|
this [_contextMenu] = new ContextMenu (this .getPrivateScene ());
|
|
122
122
|
|
|
@@ -136,45 +136,53 @@ X3DCoreContext .prototype =
|
|
|
136
136
|
{
|
|
137
137
|
// Setup browser nodes.
|
|
138
138
|
|
|
139
|
-
this [
|
|
139
|
+
this [_renderingProperties] .setup ();
|
|
140
140
|
this [_browserOptions] .setup ();
|
|
141
141
|
this [_browserProperties] .setup ();
|
|
142
|
-
this [
|
|
142
|
+
this [_browserTimings] .setup ();
|
|
143
143
|
this [_notification] .setup ();
|
|
144
144
|
this [_contextMenu] .setup ();
|
|
145
145
|
|
|
146
|
-
// Define
|
|
146
|
+
// Define properties of X3DCanvasElement.
|
|
147
147
|
|
|
148
|
-
Object .
|
|
148
|
+
Object .defineProperties (this .getElement () .get (0),
|
|
149
149
|
{
|
|
150
|
-
|
|
151
|
-
{
|
|
152
|
-
return this .getExecutionContext () .getWorldURL ();
|
|
153
|
-
},
|
|
154
|
-
set: (value) =>
|
|
150
|
+
browser:
|
|
155
151
|
{
|
|
156
|
-
this
|
|
152
|
+
value: this,
|
|
153
|
+
enumerable: true,
|
|
157
154
|
},
|
|
158
|
-
|
|
159
|
-
});
|
|
160
|
-
|
|
161
|
-
Object .defineProperty (this .getElement () .get (0), "url",
|
|
162
|
-
{
|
|
163
|
-
get: () =>
|
|
155
|
+
src:
|
|
164
156
|
{
|
|
165
|
-
|
|
157
|
+
get: () =>
|
|
158
|
+
{
|
|
159
|
+
return this .getExecutionContext () .getWorldURL ();
|
|
160
|
+
},
|
|
161
|
+
set: (value) =>
|
|
162
|
+
{
|
|
163
|
+
this .loadURL (new Fields .MFString (value), new Fields .MFString ());
|
|
164
|
+
},
|
|
165
|
+
enumerable: true,
|
|
166
166
|
},
|
|
167
|
-
|
|
167
|
+
url:
|
|
168
168
|
{
|
|
169
|
-
|
|
169
|
+
get: () =>
|
|
170
|
+
{
|
|
171
|
+
return new Fields .MFString (this .getExecutionContext () .getWorldURL ());
|
|
172
|
+
},
|
|
173
|
+
set: (value) =>
|
|
174
|
+
{
|
|
175
|
+
this .loadURL (value, new Fields .MFString ());
|
|
176
|
+
},
|
|
177
|
+
enumerable: true,
|
|
170
178
|
},
|
|
171
|
-
enumerable: true,
|
|
172
179
|
});
|
|
173
180
|
|
|
174
181
|
// Configure browser event handlers.
|
|
175
182
|
|
|
176
|
-
this .getElement ()
|
|
177
|
-
|
|
183
|
+
this .getElement ()
|
|
184
|
+
.on ("keydown.X3DCoreContext", this [_keydown] .bind (this))
|
|
185
|
+
.on ("keyup.X3DCoreContext", this [_keyup] .bind (this));
|
|
178
186
|
},
|
|
179
187
|
getInstanceId: function ()
|
|
180
188
|
{
|
|
@@ -310,6 +318,21 @@ X3DCoreContext .prototype =
|
|
|
310
318
|
this .setBrowserOption ("Notifications", this .parseBooleanAttribute (newValue, true));
|
|
311
319
|
break;
|
|
312
320
|
}
|
|
321
|
+
case "onerror":
|
|
322
|
+
case "oninitialized":
|
|
323
|
+
case "onshutdown":
|
|
324
|
+
{
|
|
325
|
+
try
|
|
326
|
+
{
|
|
327
|
+
this .getElement () [0] [name] = new Function ("event", newValue);
|
|
328
|
+
}
|
|
329
|
+
catch (error)
|
|
330
|
+
{
|
|
331
|
+
console .error (error);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
313
336
|
case "splashScreen":
|
|
314
337
|
case "splashscreen":
|
|
315
338
|
{
|
|
@@ -325,7 +348,9 @@ X3DCoreContext .prototype =
|
|
|
325
348
|
}
|
|
326
349
|
case "src":
|
|
327
350
|
{
|
|
328
|
-
|
|
351
|
+
if (newValue)
|
|
352
|
+
this .loadURL (new Fields .MFString (newValue), new Fields .MFString ());
|
|
353
|
+
|
|
329
354
|
break;
|
|
330
355
|
}
|
|
331
356
|
case "timings":
|
|
@@ -335,7 +360,9 @@ X3DCoreContext .prototype =
|
|
|
335
360
|
}
|
|
336
361
|
case "url":
|
|
337
362
|
{
|
|
338
|
-
|
|
363
|
+
if (newValue)
|
|
364
|
+
this .loadURL (this .parseUrlAttribute (newValue), new Fields .MFString ());
|
|
365
|
+
|
|
339
366
|
break;
|
|
340
367
|
}
|
|
341
368
|
}
|
|
@@ -358,13 +385,34 @@ X3DCoreContext .prototype =
|
|
|
358
385
|
|
|
359
386
|
return url;
|
|
360
387
|
},
|
|
361
|
-
callBrowserEventHandler: function (
|
|
388
|
+
callBrowserEventHandler: (function ()
|
|
362
389
|
{
|
|
363
|
-
const
|
|
390
|
+
const build_in = new Set (["error", "load"]);
|
|
364
391
|
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
392
|
+
return function (events)
|
|
393
|
+
{
|
|
394
|
+
const element = this .getElement () [0];
|
|
395
|
+
|
|
396
|
+
for (const name of events .split (" "))
|
|
397
|
+
{
|
|
398
|
+
// Order is attribute, then dispatch.
|
|
399
|
+
|
|
400
|
+
const event = new CustomEvent (name);
|
|
401
|
+
|
|
402
|
+
try
|
|
403
|
+
{
|
|
404
|
+
if (!build_in .has (name))
|
|
405
|
+
element [`on${name}`] ?.(event);
|
|
406
|
+
}
|
|
407
|
+
catch (error)
|
|
408
|
+
{
|
|
409
|
+
console .error (error);
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
element .dispatchEvent (event);
|
|
413
|
+
}
|
|
414
|
+
};
|
|
415
|
+
})(),
|
|
368
416
|
getShiftKey: function ()
|
|
369
417
|
{
|
|
370
418
|
return this ._shiftKey .getValue ();
|
|
@@ -320,7 +320,7 @@ const NURBS = {
|
|
|
320
320
|
controlPoints = result || [ ],
|
|
321
321
|
controlPointArray = controlPoint .getValue (),
|
|
322
322
|
dimension = controlPoint .length,
|
|
323
|
-
haveWeights =
|
|
323
|
+
haveWeights = !! weights,
|
|
324
324
|
Vector = haveWeights ? Vector3 : Vector2;
|
|
325
325
|
|
|
326
326
|
if (controlPoints .haveWeights !== haveWeights)
|
|
@@ -353,7 +353,7 @@ const NURBS = {
|
|
|
353
353
|
const
|
|
354
354
|
controlPoints = result || [ ],
|
|
355
355
|
dimension = controlPointNode .getSize (),
|
|
356
|
-
haveWeights =
|
|
356
|
+
haveWeights = !! weights,
|
|
357
357
|
Vector = haveWeights ? Vector4 : Vector3;
|
|
358
358
|
|
|
359
359
|
if (controlPoints .haveWeights !== haveWeights)
|
|
@@ -384,7 +384,7 @@ const NURBS = {
|
|
|
384
384
|
{
|
|
385
385
|
const
|
|
386
386
|
controlPoints = result || [ ],
|
|
387
|
-
haveWeights =
|
|
387
|
+
haveWeights = !! weights,
|
|
388
388
|
Vector = haveWeights ? Vector4 : Vector3;
|
|
389
389
|
|
|
390
390
|
if (controlPoints .haveWeights !== haveWeights)
|
|
@@ -160,7 +160,7 @@ X3DShadersContext .prototype =
|
|
|
160
160
|
version = gl .getVersion ();
|
|
161
161
|
|
|
162
162
|
const vertexShader = new ShaderPart (this .getPrivateScene ());
|
|
163
|
-
vertexShader ._url .push (vs .startsWith ("data:") ? vs : "data:x-shader/x-vertex," + Shaders .vertex [version] [vs]);
|
|
163
|
+
vertexShader ._url .push (encodeURI (vs .startsWith ("data:") ? vs : "data:x-shader/x-vertex," + Shaders .vertex [version] [vs]));
|
|
164
164
|
vertexShader .setPrivate (true);
|
|
165
165
|
vertexShader .setName (name + "Vertex");
|
|
166
166
|
vertexShader .setOptions (options);
|
|
@@ -168,7 +168,7 @@ X3DShadersContext .prototype =
|
|
|
168
168
|
|
|
169
169
|
const fragmentShader = new ShaderPart (this .getPrivateScene ());
|
|
170
170
|
fragmentShader ._type = "FRAGMENT";
|
|
171
|
-
fragmentShader ._url .push (fs .startsWith ("data:") ? fs : "data:x-shader/x-fragment," + Shaders .fragment [version] [fs]);
|
|
171
|
+
fragmentShader ._url .push (encodeURI (fs .startsWith ("data:") ? fs : "data:x-shader/x-fragment," + Shaders .fragment [version] [fs]));
|
|
172
172
|
fragmentShader .setPrivate (true);
|
|
173
173
|
fragmentShader .setName (name + "Fragment");
|
|
174
174
|
fragmentShader .setOptions (options);
|
|
@@ -52,9 +52,6 @@ import TextureQuality from "../Core/TextureQuality.js";
|
|
|
52
52
|
|
|
53
53
|
const
|
|
54
54
|
_maxTextures = Symbol (),
|
|
55
|
-
_maxTextureSize = Symbol (),
|
|
56
|
-
_maxCombinedTextureUnits = Symbol (),
|
|
57
|
-
_textureMemory = Symbol (),
|
|
58
55
|
_combinedTextureUnits = Symbol (),
|
|
59
56
|
_texture2DUnits = Symbol (),
|
|
60
57
|
_texture3DUnits = Symbol (),
|
|
@@ -89,13 +86,11 @@ X3DTexturingContext .prototype =
|
|
|
89
86
|
|
|
90
87
|
gl .pixelStorei (gl .UNPACK_ALIGNMENT, 1);
|
|
91
88
|
|
|
92
|
-
this [_maxTextureSize] = gl .getParameter (gl .MAX_TEXTURE_SIZE);
|
|
93
|
-
this [_maxCombinedTextureUnits] = gl .getParameter (gl .MAX_COMBINED_TEXTURE_IMAGE_UNITS);
|
|
94
|
-
this [_textureMemory] = NaN;
|
|
95
|
-
|
|
96
89
|
// Get texture Units
|
|
97
90
|
|
|
98
|
-
|
|
91
|
+
const maxCombinedTextureUnits = gl .getParameter (gl .MAX_COMBINED_TEXTURE_IMAGE_UNITS);
|
|
92
|
+
|
|
93
|
+
this [_combinedTextureUnits] = [...Array (maxCombinedTextureUnits) .keys ()];
|
|
99
94
|
this [_texture2DUnits] = [this [_combinedTextureUnits] .pop ()];
|
|
100
95
|
this [_texture3DUnits] = [this [_combinedTextureUnits] .pop ()];
|
|
101
96
|
this [_textureCubeUnits] = [this [_combinedTextureUnits] .pop ()];
|
|
@@ -160,11 +155,15 @@ X3DTexturingContext .prototype =
|
|
|
160
155
|
},
|
|
161
156
|
getMaxTextureSize: function ()
|
|
162
157
|
{
|
|
163
|
-
|
|
158
|
+
const gl = this .getContext ();
|
|
159
|
+
|
|
160
|
+
return gl .getParameter (gl .MAX_TEXTURE_SIZE);
|
|
164
161
|
},
|
|
165
162
|
getMaxCombinedTextureUnits: function ()
|
|
166
163
|
{
|
|
167
|
-
|
|
164
|
+
const gl = this .getContext ();
|
|
165
|
+
|
|
166
|
+
return gl .getParameter (gl .MAX_COMBINED_TEXTURE_IMAGE_UNITS)
|
|
168
167
|
},
|
|
169
168
|
popTexture2DUnit: function ()
|
|
170
169
|
{
|
|
@@ -253,7 +252,7 @@ X3DTexturingContext .prototype =
|
|
|
253
252
|
},
|
|
254
253
|
getTextureMemory: function ()
|
|
255
254
|
{
|
|
256
|
-
return
|
|
255
|
+
return NaN;
|
|
257
256
|
},
|
|
258
257
|
getDefaultTextureProperties: function ()
|
|
259
258
|
{
|
|
@@ -125,31 +125,36 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
125
125
|
|
|
126
126
|
// Print welcome message.
|
|
127
127
|
|
|
128
|
-
if (this .getInstanceId () > 1)
|
|
128
|
+
if (this .getInstanceId () > 1)
|
|
129
|
+
return;
|
|
129
130
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
131
|
+
if (!this .getBrowserOption ("Debug"))
|
|
132
|
+
return;
|
|
133
|
+
|
|
134
|
+
this .printWelcomeMessage ();
|
|
135
|
+
},
|
|
136
|
+
printWelcomeMessage: function ()
|
|
137
|
+
{
|
|
138
|
+
this .print ("Welcome to " + this .name + " X3D Browser v" + this .version + ":\n" +
|
|
139
|
+
" Current Graphics Renderer\n" +
|
|
140
|
+
" Name: " + this .getVendor () + " " + this .getRenderer () + "\n" +
|
|
141
|
+
" WebGL version: " + this .getWebGLVersion () + "\n" +
|
|
142
|
+
" Shading language: " + this .getShadingLanguageVersion () + "\n" +
|
|
143
|
+
" Rendering Properties\n" +
|
|
144
|
+
" Antialiased: " + this .getAntialiased () + "\n" +
|
|
145
|
+
" Max samples: " + this .getMaxSamples () + "\n" +
|
|
146
|
+
" Depth size: " + this .getDepthSize () + " bits\n" +
|
|
147
|
+
" Color depth: " + this .getColorDepth () + " bits\n" +
|
|
148
|
+
" Max clip planes per shape: " + this .getMaxClipPlanes () + "\n" +
|
|
149
|
+
" Max lights per shape: " + this .getMaxLights () + "\n" +
|
|
150
|
+
" Max multi textures per shape: " + this .getMaxTextures () + "\n" +
|
|
151
|
+
" Texture units: " + this .getMaxCombinedTextureUnits () + "\n" +
|
|
152
|
+
" Max texture size: " + this .getMaxTextureSize () + " × " + this .getMaxTextureSize () + " pixels\n" +
|
|
153
|
+
" Texture memory: " + this .getTextureMemory () + "\n" +
|
|
154
|
+
" Max vertex uniform vectors: " + this .getMaxVertexUniformVectors () + "\n" +
|
|
155
|
+
" Max fragment uniform vectors: " + this .getMaxFragmentUniformVectors () + "\n" +
|
|
156
|
+
" Max vertex attribs: " + this .getMaxVertexAttribs () + "\n" +
|
|
157
|
+
" Max varying vectors: " + this .getMaxVaryingVectors () + "\n");
|
|
153
158
|
},
|
|
154
159
|
getName: function ()
|
|
155
160
|
{
|
|
@@ -358,17 +363,36 @@ X3DBrowser .prototype = Object .assign (Object .create (X3DBrowserContext .proto
|
|
|
358
363
|
},
|
|
359
364
|
createVrmlFromString: function (vrmlSyntax)
|
|
360
365
|
{
|
|
361
|
-
|
|
366
|
+
vrmlSyntax = String (vrmlSyntax);
|
|
367
|
+
|
|
368
|
+
const
|
|
369
|
+
currentScene = this .currentScene,
|
|
370
|
+
external = this .isExternal (),
|
|
371
|
+
fileLoader = new FileLoader (this .getWorld ()),
|
|
372
|
+
scene = fileLoader .createX3DFromString (currentScene .getWorldURL (), vrmlSyntax);
|
|
373
|
+
|
|
374
|
+
if (!external)
|
|
375
|
+
{
|
|
376
|
+
currentScene .getLive () .addInterest ("setLive", scene);
|
|
377
|
+
scene .setExecutionContext (currentScene);
|
|
378
|
+
scene .setLive (currentScene .isLive ());
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return scene .rootNodes;
|
|
362
382
|
},
|
|
363
|
-
createX3DFromString: function (x3dSyntax)
|
|
383
|
+
createX3DFromString: async function (x3dSyntax)
|
|
364
384
|
{
|
|
365
385
|
x3dSyntax = String (x3dSyntax);
|
|
366
386
|
|
|
367
387
|
const
|
|
368
388
|
currentScene = this .currentScene,
|
|
369
389
|
external = this .isExternal (),
|
|
370
|
-
fileLoader = new FileLoader (this .getWorld ())
|
|
371
|
-
|
|
390
|
+
fileLoader = new FileLoader (this .getWorld ());
|
|
391
|
+
|
|
392
|
+
const scene = await new Promise ((resolve, reject) =>
|
|
393
|
+
{
|
|
394
|
+
fileLoader .createX3DFromString (currentScene .getWorldURL (), x3dSyntax, resolve, reject);
|
|
395
|
+
});
|
|
372
396
|
|
|
373
397
|
if (!external)
|
|
374
398
|
{
|
|
@@ -71,8 +71,8 @@ function ComposedCubeMapTexture (executionContext)
|
|
|
71
71
|
|
|
72
72
|
this .addChildObjects ("update", new Fields .SFTime ());
|
|
73
73
|
|
|
74
|
-
this .textureNodes
|
|
75
|
-
this .
|
|
74
|
+
this .textureNodes = [null, null, null, null, null, null];
|
|
75
|
+
this .textureBits = new BitSet ();
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
ComposedCubeMapTexture .prototype = Object .assign (Object .create (X3DEnvironmentTextureNode .prototype),
|
|
@@ -138,32 +138,27 @@ ComposedCubeMapTexture .prototype = Object .assign (Object .create (X3DEnvironme
|
|
|
138
138
|
{
|
|
139
139
|
let textureNode = this .textureNodes [index];
|
|
140
140
|
|
|
141
|
-
|
|
142
|
-
textureNode .removeInterest ("set_loadState__", this);
|
|
141
|
+
textureNode ?.removeInterest ("set_loadState__", this);
|
|
143
142
|
|
|
144
143
|
textureNode = this .textureNodes [index] = X3DCast (X3DConstants .X3DTexture2DNode, node);
|
|
145
144
|
|
|
146
|
-
|
|
147
|
-
textureNode .addInterest ("set_loadState__", this, textureNode, index);
|
|
145
|
+
textureNode ?.addInterest ("set_loadState__", this, textureNode, index);
|
|
148
146
|
|
|
149
147
|
this .set_loadState__ (textureNode, index);
|
|
150
148
|
},
|
|
151
149
|
set_loadState__: function (textureNode, index)
|
|
152
150
|
{
|
|
153
|
-
|
|
154
|
-
this .setLoadStateBit (index, textureNode, textureNode .checkLoadState ());
|
|
155
|
-
else
|
|
156
|
-
this .setLoadStateBit (index, textureNode, X3DConstants .NOT_STARTED);
|
|
151
|
+
this .setTextureBit (index, textureNode, textureNode ?.checkLoadState () ?? X3DConstants .NOT_STARTED);
|
|
157
152
|
|
|
158
153
|
this ._update .addEvent ();
|
|
159
154
|
},
|
|
160
|
-
|
|
155
|
+
setTextureBit: function (bit, textureNode, loadState)
|
|
161
156
|
{
|
|
162
|
-
this .
|
|
157
|
+
this .textureBits .set (bit, loadState === X3DConstants .COMPLETE_STATE || textureNode ?.getWidth ());
|
|
163
158
|
},
|
|
164
159
|
isComplete: function ()
|
|
165
160
|
{
|
|
166
|
-
if (+this .
|
|
161
|
+
if (+this .textureBits !== 0b111111)
|
|
167
162
|
return false;
|
|
168
163
|
|
|
169
164
|
const
|
|
@@ -212,7 +207,7 @@ ComposedCubeMapTexture .prototype = Object .assign (Object .create (X3DEnvironme
|
|
|
212
207
|
gl .texImage2D (this .getTargets () [i], 0, gl .RGBA, width, height, 0, gl .RGBA, gl .UNSIGNED_BYTE, textureNode .getElement ());
|
|
213
208
|
else
|
|
214
209
|
gl .texImage2D (this .getTargets () [i], 0, gl .RGBA, gl .RGBA, gl .UNSIGNED_BYTE, textureNode .getElement ());
|
|
215
|
-
|
|
210
|
+
|
|
216
211
|
break;
|
|
217
212
|
}
|
|
218
213
|
default:
|