x_ite 8.9.6 → 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 +9157 -8799
- 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/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 -14
- 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
|
@@ -11,12 +11,19 @@ in vec4 x3d_Vertex;
|
|
|
11
11
|
|
|
12
12
|
out vec3 vertex;
|
|
13
13
|
|
|
14
|
+
#pragma X3D include "include/Utils.glsl"
|
|
15
|
+
#pragma X3D include "include/Skin.glsl"
|
|
14
16
|
#pragma X3D include "include/Particle.glsl"
|
|
15
17
|
#pragma X3D include "include/PointSize.glsl"
|
|
16
18
|
|
|
17
19
|
void
|
|
18
20
|
main ()
|
|
19
21
|
{
|
|
22
|
+
vec4 x3d_TransformedVertex = getParticleVertex (getSkinVertex (x3d_Vertex, vec3 (0.0)));
|
|
23
|
+
vec4 position = x3d_ModelViewMatrix * x3d_TransformedVertex;
|
|
24
|
+
|
|
25
|
+
vertex = position .xyz;
|
|
26
|
+
|
|
20
27
|
#if defined (X3D_GEOMETRY_0D)
|
|
21
28
|
#if defined (X3D_STYLE_PROPERTIES)
|
|
22
29
|
gl_PointSize = max (pointSize = getPointSize (vertex), 2.0);
|
|
@@ -25,10 +32,6 @@ main ()
|
|
|
25
32
|
#endif
|
|
26
33
|
#endif
|
|
27
34
|
|
|
28
|
-
vec4 position = x3d_ModelViewMatrix * getVertex (x3d_Vertex);
|
|
29
|
-
|
|
30
|
-
vertex = position .xyz;
|
|
31
|
-
|
|
32
35
|
gl_Position = x3d_ProjectionMatrix * position;
|
|
33
36
|
}
|
|
34
37
|
`;
|
|
@@ -7,12 +7,24 @@ uniform mat4 modelViewProjectionMatrix;
|
|
|
7
7
|
uniform mat4 invModelViewProjectionMatrix;
|
|
8
8
|
uniform float scale;
|
|
9
9
|
|
|
10
|
-
in
|
|
11
|
-
in vec3
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
10
|
+
in float x3d_CoordIndex0;
|
|
11
|
+
in vec3 x3d_LineStipple0;
|
|
12
|
+
in float x3d_FogDepth0;
|
|
13
|
+
in vec4 x3d_Color0;
|
|
14
|
+
in vec3 x3d_Normal0;
|
|
15
|
+
in vec4 x3d_Vertex0;
|
|
16
|
+
|
|
17
|
+
in float x3d_CoordIndex1;
|
|
18
|
+
in vec3 x3d_LineStipple1;
|
|
19
|
+
in float x3d_FogDepth1;
|
|
20
|
+
in vec4 x3d_Color1;
|
|
21
|
+
in vec3 x3d_Normal1;
|
|
22
|
+
in vec4 x3d_Vertex1;
|
|
23
|
+
|
|
24
|
+
// Registered in X3DShapeContext.
|
|
25
|
+
out float coordIndex0; out vec3 lineStipple0; out float fogDepth0; out vec4 color0; out vec3 normal0; out vec4 vertex0;
|
|
26
|
+
out float coordIndex1; out vec3 lineStipple1; out float fogDepth1; out vec4 color1; out vec3 normal1; out vec4 vertex1;
|
|
27
|
+
out float coordIndex2; out vec3 lineStipple2; out float fogDepth2; out vec4 color2; out vec3 normal2; out vec4 vertex2;
|
|
16
28
|
|
|
17
29
|
vec3
|
|
18
30
|
projectPoint (const in vec4 point, const in mat4 modelViewProjectionMatrix, const in vec4 viewport)
|
|
@@ -56,9 +68,9 @@ main ()
|
|
|
56
68
|
vec4 p1 = unProjectPoint (vec3 (pq1 .xy, projected0 .z), invModelViewProjectionMatrix, viewport);
|
|
57
69
|
vec4 p2 = unProjectPoint (vec3 (pq2 .xy, projected1 .z), invModelViewProjectionMatrix, viewport);
|
|
58
70
|
|
|
59
|
-
lineStipple0 = x3d_LineStipple0; fogDepth0 = x3d_FogDepth0; color0 = x3d_Color0; normal0 = x3d_Normal0; vertex0 = p0;
|
|
60
|
-
lineStipple1 = x3d_LineStipple0; fogDepth1 = x3d_FogDepth0; color1 = x3d_Color0; normal1 = x3d_Normal0; vertex1 = p1;
|
|
61
|
-
lineStipple2 = x3d_LineStipple1; fogDepth2 = x3d_FogDepth1; color2 = x3d_Color1; normal2 = x3d_Normal1; vertex2 = p2;
|
|
71
|
+
coordIndex0 = x3d_CoordIndex0; lineStipple0 = x3d_LineStipple0; fogDepth0 = x3d_FogDepth0; color0 = x3d_Color0; normal0 = x3d_Normal0; vertex0 = p0;
|
|
72
|
+
coordIndex1 = x3d_CoordIndex0; lineStipple1 = x3d_LineStipple0; fogDepth1 = x3d_FogDepth0; color1 = x3d_Color0; normal1 = x3d_Normal0; vertex1 = p1;
|
|
73
|
+
coordIndex2 = x3d_CoordIndex1; lineStipple2 = x3d_LineStipple1; fogDepth2 = x3d_FogDepth1; color2 = x3d_Color1; normal2 = x3d_Normal1; vertex2 = p2;
|
|
62
74
|
}
|
|
63
75
|
else
|
|
64
76
|
{
|
|
@@ -70,9 +82,9 @@ main ()
|
|
|
70
82
|
vec4 p2 = unProjectPoint (vec3 (pq2 .xy, projected1 .z), invModelViewProjectionMatrix, viewport);
|
|
71
83
|
vec4 p3 = unProjectPoint (vec3 (pq3 .xy, projected1 .z), invModelViewProjectionMatrix, viewport);
|
|
72
84
|
|
|
73
|
-
lineStipple0 = x3d_LineStipple0; fogDepth0 = x3d_FogDepth0; color0 = x3d_Color0; normal0 = x3d_Normal0; vertex0 = p0;
|
|
74
|
-
lineStipple1 = x3d_LineStipple1; fogDepth1 = x3d_FogDepth1; color1 = x3d_Color1; normal1 = x3d_Normal1; vertex1 = p2;
|
|
75
|
-
lineStipple2 = x3d_LineStipple1; fogDepth2 = x3d_FogDepth1; color2 = x3d_Color1; normal2 = x3d_Normal1; vertex2 = p3;
|
|
85
|
+
coordIndex0 = x3d_CoordIndex0; lineStipple0 = x3d_LineStipple0; fogDepth0 = x3d_FogDepth0; color0 = x3d_Color0; normal0 = x3d_Normal0; vertex0 = p0;
|
|
86
|
+
coordIndex1 = x3d_CoordIndex1; lineStipple1 = x3d_LineStipple1; fogDepth1 = x3d_FogDepth1; color1 = x3d_Color1; normal1 = x3d_Normal1; vertex1 = p2;
|
|
87
|
+
coordIndex2 = x3d_CoordIndex1; lineStipple2 = x3d_LineStipple1; fogDepth2 = x3d_FogDepth1; color2 = x3d_Color1; normal2 = x3d_Normal1; vertex2 = p3;
|
|
76
88
|
}
|
|
77
89
|
}
|
|
78
90
|
`;
|
|
@@ -31,31 +31,34 @@ out vec3 normal;
|
|
|
31
31
|
out vec2 midPoint;
|
|
32
32
|
#endif
|
|
33
33
|
|
|
34
|
+
#pragma X3D include "include/Utils.glsl"
|
|
35
|
+
#pragma X3D include "include/Skin.glsl"
|
|
34
36
|
#pragma X3D include "include/Particle.glsl"
|
|
35
37
|
#pragma X3D include "include/PointSize.glsl"
|
|
36
38
|
|
|
37
39
|
void
|
|
38
40
|
main ()
|
|
39
41
|
{
|
|
40
|
-
#if defined (X3D_GEOMETRY_0D)
|
|
41
|
-
#if defined (X3D_STYLE_PROPERTIES)
|
|
42
|
-
gl_PointSize = max (pointSize = getPointSize (vertex), 2.0);
|
|
43
|
-
#else
|
|
44
|
-
gl_PointSize = 2.0;
|
|
45
|
-
#endif
|
|
46
|
-
#endif
|
|
47
|
-
|
|
48
42
|
#if defined (X3D_GEOMETRY_1D) && defined (X3D_STYLE_PROPERTIES)
|
|
49
43
|
lengthSoFar = x3d_LineStipple .z;
|
|
50
44
|
startPoint = x3d_LineStipple .xy;
|
|
51
45
|
midPoint = x3d_LineStipple .xy;
|
|
52
46
|
#endif
|
|
53
47
|
|
|
54
|
-
vec4
|
|
48
|
+
vec4 x3d_TransformedVertex = getParticleVertex (getSkinVertex (x3d_Vertex, vec3 (0.0)));
|
|
49
|
+
vec4 position = x3d_ModelViewMatrix * x3d_TransformedVertex;
|
|
55
50
|
|
|
56
51
|
vertex = position .xyz;
|
|
57
52
|
normal = x3d_Normal;
|
|
58
53
|
|
|
54
|
+
#if defined (X3D_GEOMETRY_0D)
|
|
55
|
+
#if defined (X3D_STYLE_PROPERTIES)
|
|
56
|
+
gl_PointSize = max (pointSize = getPointSize (vertex), 2.0);
|
|
57
|
+
#else
|
|
58
|
+
gl_PointSize = 2.0;
|
|
59
|
+
#endif
|
|
60
|
+
#endif
|
|
61
|
+
|
|
59
62
|
#if ! defined (X3D_GEOMETRY_0D) && ! defined (X3D_GEOMETRY_1D)
|
|
60
63
|
texCoord0 = x3d_TexCoord0;
|
|
61
64
|
#endif
|
|
@@ -7,17 +7,7 @@ uniform sampler2D x3d_TexCoordRamp;
|
|
|
7
7
|
in vec4 x3d_Particle;
|
|
8
8
|
|
|
9
9
|
vec4
|
|
10
|
-
|
|
11
|
-
{
|
|
12
|
-
int x = textureSize (sampler, lod) .x;
|
|
13
|
-
ivec2 p = ivec2 (index % x, index / x);
|
|
14
|
-
vec4 t = texelFetch (sampler, p, lod);
|
|
15
|
-
|
|
16
|
-
return t;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
vec4
|
|
20
|
-
getTexCoord (const in vec4 texCoord)
|
|
10
|
+
getParticleTexCoord (const in vec4 texCoord)
|
|
21
11
|
{
|
|
22
12
|
const int map [6] = int [6] (0, 1, 2, 0, 2, 3);
|
|
23
13
|
|
|
@@ -26,19 +16,19 @@ getTexCoord (const in vec4 texCoord)
|
|
|
26
16
|
return texelFetch (x3d_TexCoordRamp, index0 + map [gl_VertexID % 6], 0);
|
|
27
17
|
}
|
|
28
18
|
#else
|
|
29
|
-
#define
|
|
19
|
+
#define getParticleTexCoord(texCoord) (texCoord)
|
|
30
20
|
#endif
|
|
31
21
|
|
|
32
22
|
in mat4 x3d_ParticleMatrix;
|
|
33
23
|
|
|
34
24
|
vec4
|
|
35
|
-
|
|
25
|
+
getParticleVertex (const in vec4 vertex)
|
|
36
26
|
{
|
|
37
27
|
return x3d_ParticleMatrix * vertex;
|
|
38
28
|
}
|
|
39
29
|
|
|
40
30
|
#else
|
|
41
|
-
#define
|
|
42
|
-
#define
|
|
31
|
+
#define getParticleVertex(vertex) (vertex)
|
|
32
|
+
#define getParticleTexCoord(texCoord) (texCoord)
|
|
43
33
|
#endif
|
|
44
34
|
`;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export default /* glsl */ `
|
|
2
|
+
#if defined (X3D_SKINNING)
|
|
3
|
+
|
|
4
|
+
in float x3d_CoordIndex;
|
|
5
|
+
|
|
6
|
+
uniform sampler2D x3d_JointsTexture;
|
|
7
|
+
uniform sampler2D x3d_DisplacementsTexture;
|
|
8
|
+
uniform sampler2D x3d_JointMatricesTexture;
|
|
9
|
+
|
|
10
|
+
mat4
|
|
11
|
+
getJointMatrix (const in int joint)
|
|
12
|
+
{
|
|
13
|
+
vec4 a = texelFetch (x3d_JointMatricesTexture, joint * 8, 0);
|
|
14
|
+
vec4 b = texelFetch (x3d_JointMatricesTexture, joint * 8 + 1, 0);
|
|
15
|
+
vec4 c = texelFetch (x3d_JointMatricesTexture, joint * 8 + 2, 0);
|
|
16
|
+
vec4 d = texelFetch (x3d_JointMatricesTexture, joint * 8 + 3, 0);
|
|
17
|
+
|
|
18
|
+
return mat4 (a, b, c, d);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
mat3
|
|
22
|
+
getDisplacementJointMatrix (const in int joint)
|
|
23
|
+
{
|
|
24
|
+
mat4 m = getJointMatrix (joint);
|
|
25
|
+
|
|
26
|
+
return mat3 (m [0] .xyz, m [1] .xyz, m [2] .xyz);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
#if defined (X3D_NORMALS)
|
|
30
|
+
vec3 skinNormal = vec3 (0.0);
|
|
31
|
+
|
|
32
|
+
mat3
|
|
33
|
+
getJointNormalMatrix (const in int joint)
|
|
34
|
+
{
|
|
35
|
+
vec4 a = texelFetch (x3d_JointMatricesTexture, joint * 8 + 4, 0);
|
|
36
|
+
vec4 b = texelFetch (x3d_JointMatricesTexture, joint * 8 + 5, 0);
|
|
37
|
+
vec4 c = texelFetch (x3d_JointMatricesTexture, joint * 8 + 6, 0);
|
|
38
|
+
|
|
39
|
+
return mat3 (a .xyz, vec3 (a .w, b .xy), vec3 (b .zw, c .x));
|
|
40
|
+
}
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
vec4
|
|
44
|
+
getSkinVertex (const in vec4 vertex, const in vec3 normal)
|
|
45
|
+
{
|
|
46
|
+
int coordIndex2 = int (x3d_CoordIndex) * 2;
|
|
47
|
+
ivec4 joints = ivec4 (texelFetch (x3d_JointsTexture, coordIndex2, 0));
|
|
48
|
+
vec4 weights = texelFetch (x3d_JointsTexture, coordIndex2 + 1, 0);
|
|
49
|
+
int width = textureSize (x3d_DisplacementsTexture, 0) .x;
|
|
50
|
+
int offset = (width * width) / 2;
|
|
51
|
+
vec4 skin = vertex;
|
|
52
|
+
|
|
53
|
+
for (int i = 0; i < 2; ++ i)
|
|
54
|
+
{
|
|
55
|
+
vec4 displacement = texelFetch (x3d_DisplacementsTexture, coordIndex2 + i, 0);
|
|
56
|
+
float weight = texelFetch (x3d_DisplacementsTexture, coordIndex2 + offset, 0) [i];
|
|
57
|
+
|
|
58
|
+
skin .xyz += (getDisplacementJointMatrix (int (displacement .w)) * displacement .xyz) * weight;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
for (int i = 0; i < 4; ++ i)
|
|
62
|
+
skin += (getJointMatrix (joints [i]) * vertex - vertex) * weights [i];
|
|
63
|
+
|
|
64
|
+
#if defined (X3D_NORMALS)
|
|
65
|
+
{
|
|
66
|
+
skinNormal = normal;
|
|
67
|
+
|
|
68
|
+
for (int i = 0; i < 4; ++ i)
|
|
69
|
+
skinNormal += (getJointNormalMatrix (joints [i]) * normal - normal) * weights [i];
|
|
70
|
+
}
|
|
71
|
+
#endif
|
|
72
|
+
|
|
73
|
+
return skin;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
#if defined (X3D_NORMALS)
|
|
77
|
+
vec3
|
|
78
|
+
getSkinNormal (const in vec3)
|
|
79
|
+
{
|
|
80
|
+
return skinNormal;
|
|
81
|
+
}
|
|
82
|
+
#endif
|
|
83
|
+
|
|
84
|
+
#else
|
|
85
|
+
#define getSkinVertex(vertex,normal) (vertex)
|
|
86
|
+
#define getSkinNormal(normal) (normal)
|
|
87
|
+
#endif
|
|
88
|
+
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export default /* glsl */ `
|
|
2
|
+
#if defined (X3D_SKINNING) || defined (X3D_PARTICLE_SYSTEM)
|
|
3
|
+
vec4
|
|
4
|
+
texelFetch (const in sampler2D sampler, const in int index, const in int lod)
|
|
5
|
+
{
|
|
6
|
+
int x = textureSize (sampler, lod) .x;
|
|
7
|
+
ivec2 p = ivec2 (index % x, index / x);
|
|
8
|
+
vec4 t = texelFetch (sampler, p, lod);
|
|
9
|
+
|
|
10
|
+
return t;
|
|
11
|
+
}
|
|
12
|
+
#endif
|
|
13
|
+
`;
|
|
@@ -98,13 +98,22 @@ out vec3 vertex;
|
|
|
98
98
|
|
|
99
99
|
// Main
|
|
100
100
|
|
|
101
|
+
#pragma X3D include "Utils.glsl"
|
|
102
|
+
#pragma X3D include "Skin.glsl"
|
|
101
103
|
#pragma X3D include "Particle.glsl"
|
|
102
104
|
#pragma X3D include "PointSize.glsl"
|
|
103
105
|
|
|
104
106
|
void
|
|
105
107
|
vertex_main ()
|
|
106
108
|
{
|
|
107
|
-
|
|
109
|
+
#if defined (X3D_NORMALS)
|
|
110
|
+
vec4 x3d_TransformedVertex = getParticleVertex (getSkinVertex (x3d_Vertex, x3d_Normal));
|
|
111
|
+
vec3 x3d_TransformedNormal = getSkinNormal (x3d_Normal);
|
|
112
|
+
#else
|
|
113
|
+
vec4 x3d_TransformedVertex = getParticleVertex (getSkinVertex (x3d_Vertex, vec3 (0.0)));
|
|
114
|
+
#endif
|
|
115
|
+
|
|
116
|
+
vec4 position = x3d_ModelViewMatrix * x3d_TransformedVertex;
|
|
108
117
|
|
|
109
118
|
vertex = position .xyz;
|
|
110
119
|
|
|
@@ -133,33 +142,33 @@ vertex_main ()
|
|
|
133
142
|
#if ! defined (X3D_GEOMETRY_0D) && ! defined (X3D_GEOMETRY_1D)
|
|
134
143
|
#if defined (X3D_TEXTURE) || defined (X3D_MATERIAL_TEXTURES)
|
|
135
144
|
#if X3D_NUM_TEXTURE_COORDINATES > 0
|
|
136
|
-
texCoord0 =
|
|
145
|
+
texCoord0 = getParticleTexCoord (x3d_TexCoord0);
|
|
137
146
|
#endif
|
|
138
147
|
|
|
139
148
|
#if X3D_NUM_TEXTURE_COORDINATES > 1
|
|
140
|
-
texCoord1 =
|
|
149
|
+
texCoord1 = getParticleTexCoord (x3d_TexCoord1);
|
|
141
150
|
#endif
|
|
142
151
|
|
|
143
152
|
#if X3D_NUM_TEXTURE_COORDINATES > 2
|
|
144
|
-
texCoord2 =
|
|
153
|
+
texCoord2 = getParticleTexCoord (x3d_TexCoord2);
|
|
145
154
|
#endif
|
|
146
155
|
|
|
147
156
|
#if X3D_NUM_TEXTURE_COORDINATES > 3
|
|
148
|
-
texCoord3 =
|
|
157
|
+
texCoord3 = getParticleTexCoord (x3d_TexCoord3);
|
|
149
158
|
#endif
|
|
150
159
|
#endif
|
|
151
160
|
#endif
|
|
152
161
|
|
|
153
162
|
#if defined (X3D_NORMALS)
|
|
154
|
-
normal = x3d_NormalMatrix *
|
|
163
|
+
normal = x3d_NormalMatrix * x3d_TransformedNormal;
|
|
155
164
|
|
|
156
165
|
#if defined (X3D_TEXTURE) || defined (X3D_MATERIAL_TEXTURES)
|
|
157
|
-
localNormal =
|
|
166
|
+
localNormal = x3d_TransformedNormal;
|
|
158
167
|
#endif
|
|
159
168
|
#endif
|
|
160
169
|
|
|
161
170
|
#if defined (X3D_TEXTURE) || defined (X3D_MATERIAL_TEXTURES)
|
|
162
|
-
localVertex =
|
|
171
|
+
localVertex = x3d_TransformedVertex .xyz;
|
|
163
172
|
#endif
|
|
164
173
|
|
|
165
174
|
gl_Position = x3d_ProjectionMatrix * position;
|
package/src/bookmarks.js
CHANGED
|
@@ -54,11 +54,13 @@ const Bookmarks = (() =>
|
|
|
54
54
|
{
|
|
55
55
|
this .browser = browser;
|
|
56
56
|
this .element = element;
|
|
57
|
+
|
|
58
|
+
browser .addBrowserCallback ("bookmarks", X3D .X3DConstants .INITIALIZED_EVENT, event => this .browserEvent (event));
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
Object .assign (Bookmarks .prototype,
|
|
60
62
|
{
|
|
61
|
-
setup
|
|
63
|
+
setup (array)
|
|
62
64
|
{
|
|
63
65
|
for (const bookmarks of array)
|
|
64
66
|
{
|
|
@@ -120,7 +122,7 @@ const Bookmarks = (() =>
|
|
|
120
122
|
this .browser .getLocalStorage () ["Bookmarks.scrollLeft"] = this .element .scrollLeft ();
|
|
121
123
|
});
|
|
122
124
|
},
|
|
123
|
-
|
|
125
|
+
async loadURL (url)
|
|
124
126
|
{
|
|
125
127
|
const
|
|
126
128
|
base = url .replace (/(?:\.O)?\.[^\.]+$/, ""),
|
|
@@ -152,6 +154,56 @@ const Bookmarks = (() =>
|
|
|
152
154
|
|
|
153
155
|
console .log (`Scene loaded in ${loadTime .toPrecision (3)}s.`)
|
|
154
156
|
},
|
|
157
|
+
browserEvent (event)
|
|
158
|
+
{
|
|
159
|
+
try
|
|
160
|
+
{
|
|
161
|
+
$("#animations") .empty ();
|
|
162
|
+
|
|
163
|
+
$("<span></span>")
|
|
164
|
+
.text ("▣")
|
|
165
|
+
.attr ("title", "View All")
|
|
166
|
+
.on ("click", () => this .browser .viewAll (0))
|
|
167
|
+
.appendTo ($("#animations"));
|
|
168
|
+
|
|
169
|
+
$("<span></span>") .addClass ("separator") .appendTo ($("#animations"));
|
|
170
|
+
|
|
171
|
+
const animations = this .browser .currentScene .getExportedNode ("Animations");
|
|
172
|
+
|
|
173
|
+
const stop = function ()
|
|
174
|
+
{
|
|
175
|
+
for (const animation of animations .children)
|
|
176
|
+
animation .children [0] .stopTime = Date .now () / 1000;
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
for (const animation of animations .children)
|
|
180
|
+
{
|
|
181
|
+
const timeSensor = animation .children [0];
|
|
182
|
+
|
|
183
|
+
$("<span></span>")
|
|
184
|
+
.text ("▶")
|
|
185
|
+
.attr ("title", timeSensor .description)
|
|
186
|
+
.on ("click", () =>
|
|
187
|
+
{
|
|
188
|
+
stop ();
|
|
189
|
+
|
|
190
|
+
timeSensor .loop = true;
|
|
191
|
+
timeSensor .startTime = Date .now () / 1000;
|
|
192
|
+
})
|
|
193
|
+
.appendTo ($("#animations"));
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
$("<span></span>")
|
|
197
|
+
.text ("◼")
|
|
198
|
+
.attr ("title", "Stop")
|
|
199
|
+
.on ("click", stop)
|
|
200
|
+
.appendTo ($("#animations"));
|
|
201
|
+
}
|
|
202
|
+
catch (error)
|
|
203
|
+
{
|
|
204
|
+
// console .log (error)
|
|
205
|
+
}
|
|
206
|
+
}
|
|
155
207
|
});
|
|
156
208
|
|
|
157
209
|
return Bookmarks;
|