x_ite 8.9.5 → 8.10.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/build/bin/tests.pl +1 -1
- 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 +26 -26
- 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 +35 -34
- package/dist/assets/components/Geometry2D.min.js +1 -1
- package/dist/assets/components/Geospatial.js +37 -37
- package/dist/assets/components/Geospatial.min.js +1 -1
- package/dist/assets/components/HAnim.js +370 -208
- 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 -30
- package/dist/assets/components/Layout.min.js +1 -1
- package/dist/assets/components/NURBS.js +26 -26
- package/dist/assets/components/NURBS.min.js +1 -1
- package/dist/assets/components/ParticleSystems.js +23 -23
- package/dist/assets/components/ParticleSystems.min.js +1 -1
- package/dist/assets/components/Picking.js +18 -18
- package/dist/assets/components/Picking.min.js +1 -1
- package/dist/assets/components/RigidBodyPhysics.js +23 -23
- package/dist/assets/components/RigidBodyPhysics.min.js +1 -1
- package/dist/assets/components/Scripting.js +37 -37
- package/dist/assets/components/Scripting.min.js +1 -1
- package/dist/assets/components/Text.js +31 -31
- 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 +33 -33
- package/dist/assets/components/Texturing3D.min.js +1 -1
- package/dist/assets/components/VolumeRendering.js +18 -18
- 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 +8088 -7729
- package/dist/x_ite.min.js +1 -1
- package/dist/x_ite.zip +0 -0
- package/docs/_config.yml +5 -5
- package/docs/_posts/components/Core/MetadataBoolean.md +1 -1
- package/docs/_posts/components/Core/MetadataDouble.md +1 -1
- package/docs/_posts/components/Core/MetadataFloat.md +1 -1
- package/docs/_posts/components/Core/MetadataInteger.md +1 -1
- package/docs/_posts/components/Core/MetadataSet.md +1 -1
- package/docs/_posts/components/Core/MetadataString.md +1 -1
- package/docs/_posts/components/Core/WorldInfo.md +1 -1
- package/docs/_posts/components/EventUtilities/BooleanFilter.md +2 -2
- package/docs/_posts/components/EventUtilities/BooleanSequencer.md +2 -2
- package/docs/_posts/components/EventUtilities/BooleanToggle.md +2 -2
- package/docs/_posts/components/EventUtilities/BooleanTrigger.md +2 -2
- package/docs/_posts/components/EventUtilities/IntegerSequencer.md +2 -2
- package/docs/_posts/components/EventUtilities/IntegerTrigger.md +2 -2
- package/docs/_posts/components/EventUtilities/TimeTrigger.md +2 -2
- package/docs/_posts/components/Geometry2D/Arc2D.md +1 -1
- package/docs/_posts/components/Geometry2D/ArcClose2D.md +1 -1
- package/docs/_posts/components/Geometry2D/Circle2D.md +1 -1
- package/docs/_posts/components/Geometry2D/Disk2D.md +1 -1
- package/docs/_posts/components/Geometry2D/Polyline2D.md +1 -1
- package/docs/_posts/components/Geometry2D/Polypoint2D.md +1 -1
- package/docs/_posts/components/Geometry2D/Rectangle2D.md +1 -1
- package/docs/_posts/components/HAnim/HAnimHumanoid.md +17 -17
- package/docs/_posts/components/Interpolation/ColorInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/CoordinateInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/CoordinateInterpolator2D.md +1 -1
- package/docs/_posts/components/Interpolation/NormalInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/OrientationInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/PositionInterpolator.md +1 -1
- package/docs/_posts/components/Interpolation/PositionInterpolator2D.md +1 -1
- package/docs/_posts/components/Interpolation/ScalarInterpolator.md +1 -1
- package/docs/_posts/components/KeyDeviceSensor/KeySensor.md +1 -1
- package/docs/_posts/components/KeyDeviceSensor/StringSensor.md +1 -1
- package/docs/_posts/components/Networking/LoadSensor.md +1 -1
- package/docs/_posts/components/PointingDeviceSensor/CylinderSensor.md +1 -1
- package/docs/_posts/components/PointingDeviceSensor/PlaneSensor.md +1 -1
- package/docs/_posts/components/PointingDeviceSensor/TouchSensor.md +1 -1
- package/docs/_posts/components/Text/Text.md +1 -1
- package/docs/_posts/components/Time/TimeSensor.md +1 -1
- package/docs/_posts/reference/browser-services.md +6 -6
- package/docs/laboratory/gltf-sample-viewer.html +1 -1
- package/package.json +1 -1
- package/src/assets/shaders/webgl1/Depth.vs.js +4 -4
- package/src/assets/shaders/webgl1/Pointing.fs.js +1 -1
- package/src/assets/shaders/webgl2/Depth.vs.js +7 -4
- package/src/assets/shaders/webgl2/LineTransform.vs.js +24 -12
- package/src/assets/shaders/webgl2/Pointing.fs.js +1 -1
- package/src/assets/shaders/webgl2/Pointing.vs.js +12 -9
- package/src/assets/shaders/webgl2/include/Particle.glsl.js +5 -15
- package/src/assets/shaders/webgl2/include/Skin.glsl.js +88 -0
- package/src/assets/shaders/webgl2/include/Utils.glsl.js +13 -0
- package/src/assets/shaders/webgl2/include/Vertex.glsl.js +17 -8
- package/src/bookmarks.js +54 -2
- package/src/tests.js +0 -360
- package/src/x_ite/Base/X3DArrayField.js +18 -3
- package/src/x_ite/Base/X3DBaseNode.js +73 -56
- package/src/x_ite/Base/X3DChildObject.js +5 -3
- package/src/x_ite/Base/X3DObjectArrayField.js +6 -4
- package/src/x_ite/Browser/Core/Context.js +14 -4
- package/src/x_ite/Browser/Core/Notification.js +4 -3
- package/src/x_ite/Browser/Core/X3DCoreContext.js +8 -8
- package/src/x_ite/Browser/Geometry2D/Arc2DOptions.js +4 -3
- package/src/x_ite/Browser/Geometry2D/ArcClose2DOptions.js +4 -3
- package/src/x_ite/Browser/Geometry2D/Circle2DOptions.js +6 -6
- package/src/x_ite/Browser/Geometry2D/Disk2DOptions.js +9 -10
- package/src/x_ite/Browser/Geometry3D/ConeOptions.js +5 -4
- package/src/x_ite/Browser/Geometry3D/CylinderOptions.js +5 -4
- package/src/x_ite/Browser/Geometry3D/IcoSphereOptions.js +3 -2
- package/src/x_ite/Browser/Geometry3D/QuadSphereOptions.js +3 -2
- package/src/x_ite/Browser/Layout/ScreenText.js +2 -2
- package/src/x_ite/Browser/Navigation/ExamineViewer.js +4 -4
- package/src/x_ite/Browser/Navigation/LookAtViewer.js +4 -4
- package/src/x_ite/Browser/Navigation/PlaneViewer.js +3 -3
- package/src/x_ite/Browser/Navigation/X3DFlyViewer.js +3 -3
- package/src/x_ite/Browser/Navigation/X3DNavigationContext.js +6 -5
- package/src/x_ite/Browser/Navigation/X3DViewer.js +2 -13
- package/src/x_ite/Browser/Networking/X3DNetworkingContext.js +5 -4
- package/src/x_ite/Browser/PointingDeviceSensor/PointingDevice.js +8 -18
- package/src/x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext.js +17 -5
- package/src/x_ite/Browser/Rendering/X3DRenderingContext.js +6 -5
- package/src/x_ite/Browser/Shaders/Shaders.js +4 -0
- package/src/x_ite/Browser/Shape/X3DShapeContext.js +3 -3
- package/src/x_ite/Browser/Sound/X3DSoundContext.js +4 -3
- package/src/x_ite/Browser/Text/PolygonText.js +2 -2
- package/src/x_ite/Browser/Texturing/X3DTexturingContext.js +1 -1
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Browser/X3DBrowser.js +49 -17
- package/src/x_ite/Browser/X3DBrowserContext.js +8 -7
- package/src/x_ite/Components/Core/X3DChildNode.js +2 -5
- package/src/x_ite/Components/Core/X3DPrototypeInstance.js +14 -16
- package/src/x_ite/Components/CubeMapTexturing/ComposedCubeMapTexture.js +1 -1
- package/src/x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode.js +1 -1
- package/src/x_ite/Components/Geometry3D/ElevationGrid.js +5 -2
- package/src/x_ite/Components/Geometry3D/Extrusion.js +24 -13
- package/src/x_ite/Components/Geometry3D/IndexedFaceSet.js +5 -2
- package/src/x_ite/Components/Geospatial/GeoElevationGrid.js +2 -2
- package/src/x_ite/Components/Geospatial/GeoViewpoint.js +2 -2
- package/src/x_ite/Components/Grouping/X3DBoundedObject.js +1 -2
- package/src/x_ite/Components/HAnim/HAnimHumanoid.js +314 -161
- package/src/x_ite/Components/HAnim/HAnimJoint.js +37 -25
- package/src/x_ite/Components/Layering/X3DLayerNode.js +2 -2
- 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/Navigation/NavigationInfo.js +4 -4
- package/src/x_ite/Components/Navigation/OrthoViewpoint.js +1 -1
- package/src/x_ite/Components/Navigation/X3DViewpointNode.js +12 -12
- package/src/x_ite/Components/Networking/X3DUrlObject.js +18 -11
- package/src/x_ite/Components/Rendering/IndexedLineSet.js +17 -14
- package/src/x_ite/Components/Rendering/LineSet.js +16 -13
- package/src/x_ite/Components/Rendering/PointSet.js +16 -12
- package/src/x_ite/Components/Rendering/X3DColorNode.js +1 -3
- package/src/x_ite/Components/Rendering/X3DComposedGeometryNode.js +3 -0
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +48 -77
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +31 -12
- package/src/x_ite/Components/Rendering/X3DPointGeometryNode.js +3 -0
- package/src/x_ite/Components/RigidBodyPhysics/RigidBody.js +3 -3
- package/src/x_ite/Components/RigidBodyPhysics/X3DNBodyCollidableNode.js +2 -2
- package/src/x_ite/Components/RigidBodyPhysics/X3DRigidJointNode.js +1 -1
- package/src/x_ite/Components/Shaders/X3DProgrammableShaderObject.js +24 -7
- package/src/x_ite/Components/Shaders/X3DVertexAttributeNode.js +1 -1
- package/src/x_ite/Components/Shape/FillProperties.js +1 -3
- package/src/x_ite/Components/Shape/X3DAppearanceNode.js +1 -3
- package/src/x_ite/Components/Shape/X3DMaterialNode.js +8 -6
- package/src/x_ite/Components/Shape/X3DOneSidedMaterialNode.js +0 -2
- package/src/x_ite/Components/Sound/AudioClip.js +1 -1
- package/src/x_ite/Components/Sound/BufferAudioSource.js +1 -1
- package/src/x_ite/Components/Sound/ListenerPointSource.js +2 -2
- package/src/x_ite/Components/Sound/MicrophoneSource.js +2 -2
- package/src/x_ite/Components/Sound/OscillatorSource.js +2 -2
- package/src/x_ite/Components/Sound/Sound.js +1 -1
- package/src/x_ite/Components/Sound/StreamAudioSource.js +2 -2
- package/src/x_ite/Components/Sound/X3DSoundProcessingNode.js +1 -1
- package/src/x_ite/Components/Text/X3DFontStyleNode.js +4 -4
- package/src/x_ite/Components/Texturing/MultiTexture.js +1 -1
- package/src/x_ite/Components/Texturing/PixelTexture.js +1 -1
- package/src/x_ite/Components/Texturing/X3DSingleTextureCoordinateNode.js +2 -2
- package/src/x_ite/Components/Texturing/X3DTextureNode.js +1 -3
- package/src/x_ite/Components/Texturing3D/ComposedTexture3D.js +2 -2
- package/src/x_ite/Components/Texturing3D/PixelTexture3D.js +1 -1
- package/src/x_ite/Components/Time/TimeSensor.js +1 -1
- package/src/x_ite/Components/Time/X3DTimeDependentNode.js +2 -2
- package/src/x_ite/Execution/X3DExecutionContext.js +3 -4
- package/src/x_ite/Execution/X3DScene.js +4 -4
- package/src/x_ite/Execution/X3DWorld.js +1 -1
- package/src/x_ite/Parser/GLTF2Parser.js +196 -116
- package/src/x_ite/Parser/X3DOptimizer.js +47 -18
- package/src/x_ite/Prototype/X3DExternProtoDeclaration.js +4 -4
- package/src/x_ite/Prototype/X3DProtoDeclarationNode.js +1 -1
- package/src/x_ite/Rendering/X3DRenderObject.js +20 -12
- package/src/x_ite.html +36 -10
- package/x_ite.min.html +36 -10
|
@@ -138,7 +138,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
|
|
|
138
138
|
|
|
139
139
|
this .event = event;
|
|
140
140
|
|
|
141
|
-
const
|
|
141
|
+
const { x, y } = this .getBrowser () .getPointerFromEvent (event);
|
|
142
142
|
|
|
143
143
|
if (!this .isPointerInRectangle (x, y))
|
|
144
144
|
return;
|
|
@@ -246,7 +246,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
|
|
|
246
246
|
|
|
247
247
|
this .event = event;
|
|
248
248
|
|
|
249
|
-
const
|
|
249
|
+
const { x, y } = this .getBrowser () .getPointerFromEvent (event);
|
|
250
250
|
|
|
251
251
|
switch (this .getButton (this .button))
|
|
252
252
|
{
|
|
@@ -293,7 +293,7 @@ Object .assign (Object .setPrototypeOf (X3DFlyViewer .prototype, X3DViewer .prot
|
|
|
293
293
|
},
|
|
294
294
|
mousewheel (event)
|
|
295
295
|
{
|
|
296
|
-
const
|
|
296
|
+
const { x, y } = this .getBrowser () .getPointerFromEvent (event);
|
|
297
297
|
|
|
298
298
|
if (!this .isPointerInRectangle (x, y))
|
|
299
299
|
return;
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
+
import X3DConstants from "../../Base/X3DConstants.js";
|
|
48
49
|
import Fields from "../../Fields.js";
|
|
49
50
|
import ExamineViewer from "./ExamineViewer.js";
|
|
50
51
|
import WalkViewer from "./WalkViewer.js";
|
|
@@ -76,11 +77,11 @@ function getHeadlight (browser)
|
|
|
76
77
|
|
|
77
78
|
function X3DNavigationContext ()
|
|
78
79
|
{
|
|
79
|
-
this .addChildObjects ("activeLayer", new Fields .SFNode (),
|
|
80
|
-
"activeNavigationInfo", new Fields .SFNode (),
|
|
81
|
-
"activeViewpoint", new Fields .SFNode (),
|
|
82
|
-
"availableViewers", new Fields .MFString (),
|
|
83
|
-
"viewer", new Fields .SFString ("EXAMINE"));
|
|
80
|
+
this .addChildObjects (X3DConstants .outputOnly, "activeLayer", new Fields .SFNode (),
|
|
81
|
+
X3DConstants .outputOnly, "activeNavigationInfo", new Fields .SFNode (),
|
|
82
|
+
X3DConstants .outputOnly, "activeViewpoint", new Fields .SFNode (),
|
|
83
|
+
X3DConstants .outputOnly, "availableViewers", new Fields .MFString (),
|
|
84
|
+
X3DConstants .outputOnly, "viewer", new Fields .SFString ("EXAMINE"));
|
|
84
85
|
|
|
85
86
|
this [_activeCollisions] = new Set ();
|
|
86
87
|
this [_viewerNode] = new NoneViewer (this .getPrivateScene ());
|
|
@@ -95,17 +95,6 @@ Object .assign (Object .setPrototypeOf (X3DViewer .prototype, X3DBaseNode .proto
|
|
|
95
95
|
|
|
96
96
|
return button;
|
|
97
97
|
},
|
|
98
|
-
getPointer (event)
|
|
99
|
-
{
|
|
100
|
-
const
|
|
101
|
-
browser = this .getBrowser (),
|
|
102
|
-
rect = browser .getSurface () [0] .getBoundingClientRect (),
|
|
103
|
-
viewport = browser .getViewport (),
|
|
104
|
-
x = (event .pageX - rect .left) / rect .width * viewport [2],
|
|
105
|
-
y = (rect .height - (event .pageY - rect .top)) / rect .height * viewport [3];
|
|
106
|
-
|
|
107
|
-
return [x, y];
|
|
108
|
-
},
|
|
109
98
|
isPointerInRectangle: (() =>
|
|
110
99
|
{
|
|
111
100
|
const pointer = new Vector2 (0, 0);
|
|
@@ -172,7 +161,7 @@ Object .assign (Object .setPrototypeOf (X3DViewer .prototype, X3DBaseNode .proto
|
|
|
172
161
|
viewpoint = this .getActiveViewpoint (),
|
|
173
162
|
hit = this .getBrowser () .getHit ();
|
|
174
163
|
|
|
175
|
-
viewpoint .lookAtPoint (this .getActiveLayer (), hit .point, 2 - 1.618034, straightenHorizon);
|
|
164
|
+
viewpoint .lookAtPoint (this .getActiveLayer (), hit .point, 1, 2 - 1.618034, straightenHorizon);
|
|
176
165
|
},
|
|
177
166
|
lookAtBBox (x, y, straightenHorizon)
|
|
178
167
|
{
|
|
@@ -187,7 +176,7 @@ Object .assign (Object .setPrototypeOf (X3DViewer .prototype, X3DBaseNode .proto
|
|
|
187
176
|
.multRight (hit .modelViewMatrix)
|
|
188
177
|
.multRight (viewpoint .getCameraSpaceMatrix ());
|
|
189
178
|
|
|
190
|
-
viewpoint .lookAtBBox (this .getActiveLayer (), bbox, 2 - 1.618034, straightenHorizon);
|
|
179
|
+
viewpoint .lookAtBBox (this .getActiveLayer (), bbox, 1, 2 - 1.618034, straightenHorizon);
|
|
191
180
|
},
|
|
192
181
|
touch (x, y)
|
|
193
182
|
{
|
|
@@ -45,9 +45,10 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
48
|
+
import X3DConstants from "../../Base/X3DConstants.js";
|
|
49
|
+
import Fields from "../../Fields.js";
|
|
50
|
+
import URLs from "./URLs.js";
|
|
51
|
+
import _ from "../../../locale/gettext.js";
|
|
51
52
|
|
|
52
53
|
const
|
|
53
54
|
_loadingDisplay = Symbol (),
|
|
@@ -71,7 +72,7 @@ function getBaseURI (element)
|
|
|
71
72
|
|
|
72
73
|
function X3DNetworkingContext ()
|
|
73
74
|
{
|
|
74
|
-
this .addChildObjects ("loadCount", new Fields .SFInt32 ());
|
|
75
|
+
this .addChildObjects (X3DConstants .outputOnly, "loadCount", new Fields .SFInt32 ());
|
|
75
76
|
|
|
76
77
|
this [_loadingDisplay] = 0;
|
|
77
78
|
this [_loadingTotal] = 0;
|
|
@@ -76,17 +76,6 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, X3DBaseNode .
|
|
|
76
76
|
element .on ("touchstart.PointingDevice" + this .getId (), this .touchstart .bind (this));
|
|
77
77
|
element .on ("touchend.PointingDevice" + this .getId (), this .touchend .bind (this));
|
|
78
78
|
},
|
|
79
|
-
getPointer (event)
|
|
80
|
-
{
|
|
81
|
-
const
|
|
82
|
-
browser = this .getBrowser (),
|
|
83
|
-
rect = browser .getSurface () [0] .getBoundingClientRect (),
|
|
84
|
-
viewport = browser .getViewport (),
|
|
85
|
-
x = (event .pageX - rect .left) / rect .width * viewport [2],
|
|
86
|
-
y = (rect .height - (event .pageY - rect .top)) / rect .height * viewport [3];
|
|
87
|
-
|
|
88
|
-
return [x, y];
|
|
89
|
-
},
|
|
90
79
|
mousewheel (event)
|
|
91
80
|
{
|
|
92
81
|
// event .preventDefault () must be done in the all viewers.
|
|
@@ -104,14 +93,15 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, X3DBaseNode .
|
|
|
104
93
|
|
|
105
94
|
if (event .button === 0)
|
|
106
95
|
{
|
|
107
|
-
const
|
|
96
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
108
97
|
|
|
109
98
|
element .off ("mousemove.PointingDevice" + this .getId ());
|
|
110
99
|
|
|
111
|
-
$(document)
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
100
|
+
$(document)
|
|
101
|
+
.on ("mouseup.PointingDevice" + this .getId (), this .mouseup .bind (this))
|
|
102
|
+
.on ("mousemove.PointingDevice" + this .getId (), this .mousemove .bind (this))
|
|
103
|
+
.on ("touchend.PointingDevice" + this .getId (), this .touchend .bind (this))
|
|
104
|
+
.on ("touchmove.PointingDevice" + this .getId (), this .touchmove .bind (this));
|
|
115
105
|
|
|
116
106
|
if (browser .buttonPressEvent (x, y))
|
|
117
107
|
{
|
|
@@ -133,7 +123,7 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, X3DBaseNode .
|
|
|
133
123
|
browser = this .getBrowser (),
|
|
134
124
|
element = browser .getSurface ();
|
|
135
125
|
|
|
136
|
-
const
|
|
126
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
137
127
|
|
|
138
128
|
$(document) .off (".PointingDevice" + this .getId ());
|
|
139
129
|
element .on ("mousemove.PointingDevice" + this .getId (), this .mousemove .bind (this));
|
|
@@ -162,7 +152,7 @@ Object .assign (Object .setPrototypeOf (PointingDevice .prototype, X3DBaseNode .
|
|
|
162
152
|
|
|
163
153
|
this .motionTime = browser .getCurrentTime ();
|
|
164
154
|
|
|
165
|
-
const
|
|
155
|
+
const { x, y } = browser .getPointerFromEvent (event);
|
|
166
156
|
|
|
167
157
|
this .onmotion (x, y);
|
|
168
158
|
},
|
|
@@ -153,6 +153,17 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
|
|
|
153
153
|
{
|
|
154
154
|
return this [_pointer];
|
|
155
155
|
},
|
|
156
|
+
getPointerFromEvent ({ pageX, pageY })
|
|
157
|
+
{
|
|
158
|
+
const
|
|
159
|
+
offset = this .getSurface () .offset (),
|
|
160
|
+
rect = this .getSurface () [0] .getBoundingClientRect (),
|
|
161
|
+
viewport = this .getViewport (),
|
|
162
|
+
x = (pageX - offset .left) / rect .width * viewport [2],
|
|
163
|
+
y = (1 - (pageY - offset .top) / rect .height) * viewport [3];
|
|
164
|
+
|
|
165
|
+
return new Vector2 (x, y);
|
|
166
|
+
},
|
|
156
167
|
isPointerInRectangle (rectangle, pointer = this [_pointer])
|
|
157
168
|
{
|
|
158
169
|
return pointer .x >= rectangle .x &&
|
|
@@ -320,7 +331,7 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
|
|
|
320
331
|
for (const sensor of this [_activeSensors])
|
|
321
332
|
sensor .set_motion__ (hit);
|
|
322
333
|
},
|
|
323
|
-
getPointingShader (numClipPlanes, shapeNode)
|
|
334
|
+
getPointingShader (numClipPlanes, shapeNode, humanoidNode)
|
|
324
335
|
{
|
|
325
336
|
const geometryContext = shapeNode .getGeometryContext ();
|
|
326
337
|
|
|
@@ -330,6 +341,7 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
|
|
|
330
341
|
key += ".";
|
|
331
342
|
key += shapeNode .getShapeKey ();
|
|
332
343
|
key += geometryContext .geometryType;
|
|
344
|
+
key += humanoidNode ? 1 : 0;
|
|
333
345
|
|
|
334
346
|
if (geometryContext .geometryType >= 2)
|
|
335
347
|
{
|
|
@@ -346,9 +358,9 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
|
|
|
346
358
|
key += appearanceNode .getMaterial () .getTextureBits () .toString (4); // Textures for point and line.
|
|
347
359
|
}
|
|
348
360
|
|
|
349
|
-
return this [_pointingShaders] .get (key) || this .createPointingShader (key, numClipPlanes, shapeNode);
|
|
361
|
+
return this [_pointingShaders] .get (key) || this .createPointingShader (key, numClipPlanes, shapeNode, humanoidNode);
|
|
350
362
|
},
|
|
351
|
-
createPointingShader (key, numClipPlanes, shapeNode)
|
|
363
|
+
createPointingShader (key, numClipPlanes, shapeNode, humanoidNode)
|
|
352
364
|
{
|
|
353
365
|
const
|
|
354
366
|
appearanceNode = shapeNode .getAppearance (),
|
|
@@ -369,8 +381,8 @@ Object .assign (X3DPointingDeviceSensorContext .prototype,
|
|
|
369
381
|
if (appearanceNode .getStyleProperties (geometryContext .geometryType))
|
|
370
382
|
options .push ("X3D_STYLE_PROPERTIES");
|
|
371
383
|
|
|
372
|
-
if (
|
|
373
|
-
options .push ("
|
|
384
|
+
if (humanoidNode)
|
|
385
|
+
options .push ("X3D_SKINNING");
|
|
374
386
|
|
|
375
387
|
const shaderNode = this .createShader ("PointingShader", "Pointing", "Pointing", options);
|
|
376
388
|
|
|
@@ -166,7 +166,7 @@ Object .assign (X3DRenderingContext .prototype,
|
|
|
166
166
|
{
|
|
167
167
|
return this [_frameBuffer];
|
|
168
168
|
},
|
|
169
|
-
getDepthShader (numClipPlanes, shapeNode)
|
|
169
|
+
getDepthShader (numClipPlanes, shapeNode, humanoidNode)
|
|
170
170
|
{
|
|
171
171
|
const geometryContext = shapeNode .getGeometryContext ();
|
|
172
172
|
|
|
@@ -176,6 +176,7 @@ Object .assign (X3DRenderingContext .prototype,
|
|
|
176
176
|
key += ".";
|
|
177
177
|
key += shapeNode .getShapeKey ();
|
|
178
178
|
key += geometryContext .geometryType;
|
|
179
|
+
key += humanoidNode ? 1 : 0;
|
|
179
180
|
|
|
180
181
|
if (geometryContext .geometryType >= 2)
|
|
181
182
|
{
|
|
@@ -192,9 +193,9 @@ Object .assign (X3DRenderingContext .prototype,
|
|
|
192
193
|
key += appearanceNode .getMaterial () .getTextureBits () .toString (4); // Textures for point and line.
|
|
193
194
|
}
|
|
194
195
|
|
|
195
|
-
return this [_depthShaders] .get (key) || this .createDepthShader (key, numClipPlanes, shapeNode);
|
|
196
|
+
return this [_depthShaders] .get (key) || this .createDepthShader (key, numClipPlanes, shapeNode, humanoidNode);
|
|
196
197
|
},
|
|
197
|
-
createDepthShader (key, numClipPlanes, shapeNode)
|
|
198
|
+
createDepthShader (key, numClipPlanes, shapeNode, humanoidNode)
|
|
198
199
|
{
|
|
199
200
|
const
|
|
200
201
|
appearanceNode = shapeNode .getAppearance (),
|
|
@@ -215,8 +216,8 @@ Object .assign (X3DRenderingContext .prototype,
|
|
|
215
216
|
if (appearanceNode .getStyleProperties (geometryContext .geometryType))
|
|
216
217
|
options .push ("X3D_STYLE_PROPERTIES");
|
|
217
218
|
|
|
218
|
-
if (
|
|
219
|
-
options .push ("
|
|
219
|
+
if (humanoidNode)
|
|
220
|
+
options .push ("X3D_SKINNING");
|
|
220
221
|
|
|
221
222
|
const shaderNode = this .createShader ("DepthShader", "Depth", "Depth", options);
|
|
222
223
|
|
|
@@ -75,9 +75,11 @@ import Perlin2 from "../../../assets/shaders/webgl2/include/Perli
|
|
|
75
75
|
import Point2 from "../../../assets/shaders/webgl2/include/Point.glsl.js";
|
|
76
76
|
import PointSize2 from "../../../assets/shaders/webgl2/include/PointSize.glsl.js";
|
|
77
77
|
import Shadow2 from "../../../assets/shaders/webgl2/include/Shadow.glsl.js";
|
|
78
|
+
import Skin2 from "../../../assets/shaders/webgl2/include/Skin.glsl.js";
|
|
78
79
|
import Stipple2 from "../../../assets/shaders/webgl2/include/Stipple.glsl.js";
|
|
79
80
|
import SpotFactor2 from "../../../assets/shaders/webgl2/include/SpotFactor.glsl.js";
|
|
80
81
|
import Texture2 from "../../../assets/shaders/webgl2/include/Texture.glsl.js";
|
|
82
|
+
import Utils2 from "../../../assets/shaders/webgl2/include/Utils.glsl.js";
|
|
81
83
|
import Vertex2 from "../../../assets/shaders/webgl2/include/Vertex.glsl.js";
|
|
82
84
|
|
|
83
85
|
/* WebGL 1 */
|
|
@@ -138,9 +140,11 @@ const Shaders = {
|
|
|
138
140
|
Point: Point2,
|
|
139
141
|
PointSize: PointSize2,
|
|
140
142
|
Shadow: Shadow2,
|
|
143
|
+
Skin: Skin2,
|
|
141
144
|
Stipple: Stipple2,
|
|
142
145
|
SpotFactor: SpotFactor2,
|
|
143
146
|
Texture: Texture2,
|
|
147
|
+
Utils: Utils2,
|
|
144
148
|
Vertex: Vertex2,
|
|
145
149
|
},
|
|
146
150
|
},
|
|
@@ -179,9 +179,9 @@ Object .assign (X3DShapeContext .prototype,
|
|
|
179
179
|
];
|
|
180
180
|
|
|
181
181
|
const transformFeedbackVaryings = [
|
|
182
|
-
"lineStipple0", "fogDepth0", "color0", "normal0", "vertex0",
|
|
183
|
-
"lineStipple1", "fogDepth1", "color1", "normal1", "vertex1",
|
|
184
|
-
"lineStipple2", "fogDepth2", "color2", "normal2", "vertex2",
|
|
182
|
+
"coordIndex0", "lineStipple0", "fogDepth0", "color0", "normal0", "vertex0",
|
|
183
|
+
"coordIndex1", "lineStipple1", "fogDepth1", "color1", "normal1", "vertex1",
|
|
184
|
+
"coordIndex2", "lineStipple2", "fogDepth2", "color2", "normal2", "vertex2",
|
|
185
185
|
];
|
|
186
186
|
|
|
187
187
|
this [_lineTransformShaderNode] = this .createShader ("LineTransformShader", "LineTransform", "LineTransform", [ ], uniformNames, transformFeedbackVaryings);
|
|
@@ -45,12 +45,13 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
-
import
|
|
48
|
+
import X3DConstants from "../../Base/X3DConstants.js";
|
|
49
|
+
import Fields from "../../Fields.js";
|
|
49
50
|
|
|
50
51
|
function X3DSoundContext ()
|
|
51
52
|
{
|
|
52
|
-
this .addChildObjects ("volume", new Fields .SFFloat (1),
|
|
53
|
-
"mute", new Fields .SFBool ());
|
|
53
|
+
this .addChildObjects (X3DConstants .outputOnly, "volume", new Fields .SFFloat (1),
|
|
54
|
+
X3DConstants .outputOnly, "mute", new Fields .SFBool ());
|
|
54
55
|
}
|
|
55
56
|
|
|
56
57
|
export default X3DSoundContext;
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
*
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
|
+
import Fields from "../../Fields.js";
|
|
48
49
|
import PrimitiveQuality from "../Core/PrimitiveQuality.js";
|
|
49
50
|
import X3DTextGeometry from "./X3DTextGeometry.js";
|
|
50
|
-
import X3DGeometryNode from "../../Components/Rendering/X3DGeometryNode.js";
|
|
51
51
|
import Vector3 from "../../../standard/Math/Numbers/Vector3.js";
|
|
52
52
|
import Matrix4 from "../../../standard/Math/Numbers/Matrix4.js";
|
|
53
53
|
import Bezier from "../../../standard/Math/Algorithms/Bezier.js";
|
|
@@ -59,7 +59,7 @@ function PolygonText (text, fontStyle)
|
|
|
59
59
|
|
|
60
60
|
text ._transparent = false;
|
|
61
61
|
|
|
62
|
-
this .texCoordArray =
|
|
62
|
+
this .texCoordArray = new Fields .MFFloat ();
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
Object .assign (Object .setPrototypeOf (PolygonText .prototype, X3DTextGeometry .prototype),
|
|
@@ -90,7 +90,7 @@ Object .assign (X3DTexturingContext .prototype,
|
|
|
90
90
|
|
|
91
91
|
const maxCombinedTextureUnits = gl .getParameter (gl .MAX_COMBINED_TEXTURE_IMAGE_UNITS);
|
|
92
92
|
|
|
93
|
-
this [_combinedTextureUnits] = [...Array (maxCombinedTextureUnits) .keys ()];
|
|
93
|
+
this [_combinedTextureUnits] = [...Array (maxCombinedTextureUnits) .keys ()] .reverse ();
|
|
94
94
|
this [_texture2DUnits] = [this [_combinedTextureUnits] .pop ()];
|
|
95
95
|
this [_texture3DUnits] = [this [_combinedTextureUnits] .pop ()];
|
|
96
96
|
this [_textureCubeUnits] = [this [_combinedTextureUnits] .pop ()];
|
|
@@ -96,9 +96,16 @@ function X3DBrowser (element)
|
|
|
96
96
|
this [_supportedComponents] = SupportedComponents .copy ();
|
|
97
97
|
this [_concreteNodes] = ConcreteNodes .copy ();
|
|
98
98
|
this [_abstractNodes] = AbstractNodes .copy ();
|
|
99
|
-
this [_browserCallbacks] = new Map ();
|
|
100
99
|
this [_console] = document .getElementsByClassName ("x_ite-console");
|
|
101
100
|
|
|
101
|
+
this [_browserCallbacks] = new Map ([
|
|
102
|
+
[X3DConstants .CONNECTION_ERROR, new Map ()],
|
|
103
|
+
[X3DConstants .BROWSER_EVENT, new Map ()],
|
|
104
|
+
[X3DConstants .INITIALIZED_EVENT, new Map ()],
|
|
105
|
+
[X3DConstants .SHUTDOWN_EVENT, new Map ()],
|
|
106
|
+
[X3DConstants .INITIALIZED_ERROR, new Map ()],
|
|
107
|
+
]);
|
|
108
|
+
|
|
102
109
|
this .setup ();
|
|
103
110
|
};
|
|
104
111
|
|
|
@@ -216,7 +223,7 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, X3DBrowserContext
|
|
|
216
223
|
|
|
217
224
|
if (component)
|
|
218
225
|
{
|
|
219
|
-
return new ComponentInfo (name,
|
|
226
|
+
return new ComponentInfo (component .name,
|
|
220
227
|
Algorithm .clamp (level || component .level, 1, component .level),
|
|
221
228
|
component .title,
|
|
222
229
|
component .providerUrl,
|
|
@@ -666,30 +673,52 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, X3DBrowserContext
|
|
|
666
673
|
{
|
|
667
674
|
// The string describes the name of the callback function to be called within the current ECMAScript context.
|
|
668
675
|
},
|
|
669
|
-
addBrowserCallback (
|
|
676
|
+
addBrowserCallback (... args)
|
|
670
677
|
{
|
|
671
|
-
|
|
678
|
+
switch (args .length)
|
|
679
|
+
{
|
|
680
|
+
case 2:
|
|
681
|
+
{
|
|
682
|
+
const [key, object] = args;
|
|
683
|
+
|
|
684
|
+
this [_browserCallbacks] .forEach (map => map .set (key, object));
|
|
685
|
+
break;
|
|
686
|
+
}
|
|
687
|
+
case 3:
|
|
688
|
+
{
|
|
689
|
+
const [key, event, object] = args;
|
|
690
|
+
|
|
691
|
+
this [_browserCallbacks] .get (event) .set (key, object);
|
|
692
|
+
break;
|
|
693
|
+
}
|
|
694
|
+
}
|
|
672
695
|
},
|
|
673
|
-
removeBrowserCallback (key)
|
|
696
|
+
removeBrowserCallback (key, event)
|
|
674
697
|
{
|
|
675
|
-
|
|
698
|
+
if (arguments .length === 2)
|
|
699
|
+
this [_browserCallbacks] .get (event) .delete (key);
|
|
700
|
+
else
|
|
701
|
+
this [_browserCallbacks] .forEach (map => map .delete (key));
|
|
676
702
|
},
|
|
677
|
-
getBrowserCallbacks ()
|
|
703
|
+
getBrowserCallbacks (event)
|
|
678
704
|
{
|
|
679
|
-
|
|
705
|
+
if (arguments .length === 1)
|
|
706
|
+
return this [_browserCallbacks] .get (event);
|
|
707
|
+
else
|
|
708
|
+
return new Map ([... this [_browserCallbacks]] .flatMap (([event, map]) => [... map]));
|
|
680
709
|
},
|
|
681
710
|
callBrowserCallbacks: (() =>
|
|
682
711
|
{
|
|
683
|
-
const
|
|
712
|
+
const values = [ ];
|
|
684
713
|
|
|
685
|
-
return function (
|
|
714
|
+
return function (event)
|
|
686
715
|
{
|
|
687
|
-
|
|
716
|
+
const browserCallbacks = this [_browserCallbacks] .get (event);
|
|
717
|
+
|
|
718
|
+
if (browserCallbacks .size)
|
|
688
719
|
{
|
|
689
|
-
for (const
|
|
690
|
-
|
|
691
|
-
browserCallback (browserEvent);
|
|
692
|
-
}
|
|
720
|
+
for (const callback of MapUtilities .values (values, browserCallbacks))
|
|
721
|
+
callback (event);
|
|
693
722
|
}
|
|
694
723
|
};
|
|
695
724
|
})(),
|
|
@@ -749,14 +778,17 @@ Object .assign (Object .setPrototypeOf (X3DBrowser .prototype, X3DBrowserContext
|
|
|
749
778
|
{
|
|
750
779
|
return this .getRenderingProperties () .getField (name) .getValue ();
|
|
751
780
|
},
|
|
752
|
-
viewAll (layerNode)
|
|
781
|
+
viewAll (layerNode, transitionTime = 1)
|
|
753
782
|
{
|
|
783
|
+
if (arguments .length === 1 && typeof layerNode === "number")
|
|
784
|
+
transitionTime = layerNode;
|
|
785
|
+
|
|
754
786
|
layerNode = X3DCast (X3DConstants .X3DLayerNode, layerNode) ?? this .getActiveLayer ();
|
|
755
787
|
|
|
756
788
|
if (!layerNode)
|
|
757
789
|
return;
|
|
758
790
|
|
|
759
|
-
layerNode .viewAll (1, this .getBrowserOption ("StraightenHorizon"));
|
|
791
|
+
layerNode .viewAll (transitionTime, 1, this .getBrowserOption ("StraightenHorizon"));
|
|
760
792
|
},
|
|
761
793
|
firstViewpoint (layerNode)
|
|
762
794
|
{
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
******************************************************************************/
|
|
47
47
|
|
|
48
48
|
import SFTime from "../Fields/SFTime.js";
|
|
49
|
+
import X3DConstants from "../Base/X3DConstants.js";
|
|
49
50
|
import X3DBaseNode from "../Base/X3DBaseNode.js";
|
|
50
51
|
import X3DCoreContext from "./Core/X3DCoreContext.js";
|
|
51
52
|
import X3DEnvironmentalEffectsContext from "./EnvironmentalEffects/X3DEnvironmentalEffectsContext.js";
|
|
@@ -117,13 +118,13 @@ function X3DBrowserContext (element)
|
|
|
117
118
|
for (const browserContext of browserContexts)
|
|
118
119
|
browserContext .call (this);
|
|
119
120
|
|
|
120
|
-
this .addChildObjects ("initialized", new SFTime (),
|
|
121
|
-
"shutdown", new SFTime (),
|
|
122
|
-
"prepareEvents", new SFTime (),
|
|
123
|
-
"timeEvents", new SFTime (),
|
|
124
|
-
"sensorEvents", new SFTime (),
|
|
125
|
-
"displayEvents", new SFTime (),
|
|
126
|
-
"finishedEvents", new SFTime ());
|
|
121
|
+
this .addChildObjects (X3DConstants .outputOnly, "initialized", new SFTime (),
|
|
122
|
+
X3DConstants .outputOnly, "shutdown", new SFTime (),
|
|
123
|
+
X3DConstants .outputOnly, "prepareEvents", new SFTime (),
|
|
124
|
+
X3DConstants .outputOnly, "timeEvents", new SFTime (),
|
|
125
|
+
X3DConstants .outputOnly, "sensorEvents", new SFTime (),
|
|
126
|
+
X3DConstants .outputOnly, "displayEvents", new SFTime (),
|
|
127
|
+
X3DConstants .outputOnly, "finishedEvents", new SFTime ());
|
|
127
128
|
|
|
128
129
|
this [_changedTime] = 0;
|
|
129
130
|
this [_previousTime] = 0;
|
|
@@ -58,11 +58,8 @@ function X3DChildNode (executionContext)
|
|
|
58
58
|
|
|
59
59
|
this .addType (X3DConstants .X3DChildNode);
|
|
60
60
|
|
|
61
|
-
this .addChildObjects ("isCameraObject", new Fields .SFBool (),
|
|
62
|
-
"isPickableObject", new Fields .SFBool ());
|
|
63
|
-
|
|
64
|
-
this ._isCameraObject .setAccessType (X3DConstants .outputOnly);
|
|
65
|
-
this ._isPickableObject .setAccessType (X3DConstants .outputOnly);
|
|
61
|
+
this .addChildObjects (X3DConstants .outputOnly, "isCameraObject", new Fields .SFBool (),
|
|
62
|
+
X3DConstants .outputOnly, "isPickableObject", new Fields .SFBool ());
|
|
66
63
|
}
|
|
67
64
|
|
|
68
65
|
Object .assign (Object .setPrototypeOf (X3DChildNode .prototype, X3DNode .prototype),
|
|
@@ -96,6 +96,19 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, X3DNode
|
|
|
96
96
|
|
|
97
97
|
if (protoNode .isExternProto)
|
|
98
98
|
{
|
|
99
|
+
if (protoNode .checkLoadState () !== X3DConstants .COMPLETE_STATE)
|
|
100
|
+
{
|
|
101
|
+
this [_body] = null;
|
|
102
|
+
|
|
103
|
+
if (this .isInitialized ())
|
|
104
|
+
X3DChildObject .prototype .addEvent .call (this);
|
|
105
|
+
|
|
106
|
+
protoNode ._updateInstances .addInterest ("construct", this);
|
|
107
|
+
protoNode .requestImmediateLoad () .catch (Function .prototype);
|
|
108
|
+
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
99
112
|
for (const protoField of proto .getUserDefinedFields ())
|
|
100
113
|
{
|
|
101
114
|
try
|
|
@@ -233,22 +246,7 @@ Object .assign (Object .setPrototypeOf (X3DPrototypeInstance .prototype, X3DNode
|
|
|
233
246
|
|
|
234
247
|
protoNode ._name_changed .addFieldInterest (this ._typeName_changed);
|
|
235
248
|
|
|
236
|
-
|
|
237
|
-
{
|
|
238
|
-
this [_body] = null;
|
|
239
|
-
|
|
240
|
-
if (this .isInitialized ())
|
|
241
|
-
X3DChildObject .prototype .addEvent .call (this);
|
|
242
|
-
|
|
243
|
-
protoNode ._updateInstances .addInterest ("construct", this);
|
|
244
|
-
protoNode .requestImmediateLoad () .catch (Function .prototype);
|
|
245
|
-
|
|
246
|
-
return;
|
|
247
|
-
}
|
|
248
|
-
else
|
|
249
|
-
{
|
|
250
|
-
this .construct ();
|
|
251
|
-
}
|
|
249
|
+
this .construct ();
|
|
252
250
|
},
|
|
253
251
|
getBody ()
|
|
254
252
|
{
|
|
@@ -69,7 +69,7 @@ function ComposedCubeMapTexture (executionContext)
|
|
|
69
69
|
this .addAlias ("bottom", this ._bottomTexture);
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
this .addChildObjects ("update", new Fields .SFTime ());
|
|
72
|
+
this .addChildObjects (X3DConstants .inputOutput, "update", new Fields .SFTime ());
|
|
73
73
|
|
|
74
74
|
this .textureNodes = [null, null, null, null, null, null];
|
|
75
75
|
this .textureBits = new BitSet ();
|
|
@@ -56,7 +56,7 @@ function X3DEnvironmentalSensorNode (executionContext)
|
|
|
56
56
|
|
|
57
57
|
this .addType (X3DConstants .X3DEnvironmentalSensorNode);
|
|
58
58
|
|
|
59
|
-
this .addChildObjects ("traversed", new Fields .SFBool (true));
|
|
59
|
+
this .addChildObjects (X3DConstants .outputOnly, "traversed", new Fields .SFBool (true));
|
|
60
60
|
|
|
61
61
|
this ._size .setUnit ("length");
|
|
62
62
|
this ._center .setUnit ("length");
|
|
@@ -223,8 +223,8 @@ Object .assign (Object .setPrototypeOf (ElevationGrid .prototype, X3DGeometryNod
|
|
|
223
223
|
normals .push (normal);
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
-
|
|
227
|
-
|
|
226
|
+
if (!this ._normalPerVertex .getValue ())
|
|
227
|
+
return normals;
|
|
228
228
|
|
|
229
229
|
return this .refineNormals (normalIndex, normals, this ._creaseAngle .getValue ());
|
|
230
230
|
},
|
|
@@ -293,6 +293,7 @@ Object .assign (Object .setPrototypeOf (ElevationGrid .prototype, X3DGeometryNod
|
|
|
293
293
|
colorPerVertex = this ._colorPerVertex .getValue (),
|
|
294
294
|
normalPerVertex = this ._normalPerVertex .getValue (),
|
|
295
295
|
coordIndex = this .createCoordIndex (),
|
|
296
|
+
coordIndicesArray = this .getCoordIndices (),
|
|
296
297
|
attribNodes = this .getAttrib (),
|
|
297
298
|
numAttribNodes = attribNodes .length,
|
|
298
299
|
attribArrays = this .getAttribs (),
|
|
@@ -332,6 +333,8 @@ Object .assign (Object .setPrototypeOf (ElevationGrid .prototype, X3DGeometryNod
|
|
|
332
333
|
index = coordIndex [c],
|
|
333
334
|
point = points [index];
|
|
334
335
|
|
|
336
|
+
coordIndicesArray .push (index);
|
|
337
|
+
|
|
335
338
|
for (let a = 0; a < numAttribNodes; ++ a)
|
|
336
339
|
attribNodes [a] .addValue (index, attribArrays [a]);
|
|
337
340
|
|