x_ite 4.7.5 → 4.7.6

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/docs/index.md CHANGED
@@ -8,7 +8,7 @@ X3D is an ISO-ratified, royalty-free open standards file format and run-time arc
8
8
 
9
9
  X\_ITE supports custom shaders, clip planes, reflection mapping, script nodes, prototyping capabilities and event driven programming to provide you with an improved quality level of virtual effects and tools ready for the Internet.
10
10
 
11
- **Developer note:** X\_ITE runs best in fresh installs of Google Chrome, Chromium, Firefox, Safari, Opera, and Microsoft Edge. X\_ITE uses the latest JavaScript standard, but is also compatible with older browser, and is either now available on your desktop computer or on your modern smart-phone.
11
+ **Developer note:** X\_ITE runs best in fresh installs of Google Chrome, Chromium, Firefox, Safari, Opera, and Microsoft Edge. X\_ITE uses the latest JavaScript standard, but is also compatible with older browser, and is available both on your desktop computer and on your modern smart-phone.
12
12
  {: .notice--info}
13
13
 
14
14
  If you ever get in trouble, please [file a bug](https://github.com/create3000/x_ite/issues).
@@ -817,8 +817,8 @@ GitCDN serves raw files directly from GitHub with proper Content-Type headers an
817
817
  If you are on production and everything works fine, then use a numbered version.
818
818
 
819
819
  ```html
820
- <link rel="stylesheet" type="text/css" href="https://create3000.github.io/code/x_ite/4.7.5/dist/x_ite.css"/>
821
- <script type="text/javascript" src="https://create3000.github.io/code/x_ite/4.7.5/dist/x_ite.min.js"></script>
820
+ <link rel="stylesheet" type="text/css" href="https://create3000.github.io/code/x_ite/4.7.6/dist/x_ite.css"/>
821
+ <script type="text/javascript" src="https://create3000.github.io/code/x_ite/4.7.6/dist/x_ite.min.js"></script>
822
822
  ```
823
823
 
824
824
  #### Latest Stable Version
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x_ite",
3
- "version": "4.7.5",
4
- "revision": "1122",
3
+ "version": "4.7.6",
4
+ "revision": "1127",
5
5
  "description": "X_ITE X3D Browser, a framework for integrating and manipulating X3D and VRML scenes in HTML.",
6
6
  "main": "src/x_ite.js",
7
7
  "repository": {
@@ -12,9 +12,14 @@
12
12
  "X3D",
13
13
  "VRML",
14
14
  "WebGL",
15
- "browser"
15
+ "browser",
16
+ "3D",
17
+ "wrl",
18
+ "JavaScript",
19
+ "JSON",
20
+ "xite"
16
21
  ],
17
- "author": "Holger Seelig <holger.seelig@yahoo.de>",
22
+ "author": "Holger Seelig <holger.seelig@gmail.com>",
18
23
  "license": "GPL-3.0",
19
24
  "homepage": "https://create3000.github.io/x_ite/",
20
25
  "contributors": [
package/src/tests.js CHANGED
@@ -296,6 +296,7 @@ var X_ITE_TESTS = [
296
296
  { path: "Shape/LineProperties.x3dv" },
297
297
  { path: "Shape/BackMaterial.x3d" },
298
298
  { path: "Shape/UnlitMaterial.x3d" },
299
+ { path: "Shape/Transparency.x3dv" },
299
300
  { path: "Shape/TwoSidedMaterial.x3d" },
300
301
  { component: "Sound" },
301
302
  { path: "Sound/04. Like A Virgin.mp3" },
@@ -49,5 +49,5 @@
49
49
 
50
50
  define (function ()
51
51
  {
52
- return "4.7.5";
52
+ return "4.7.6";
53
53
  });
@@ -72,7 +72,7 @@ function (Fields,
72
72
 
73
73
  this .addType (X3DConstants .Switch);
74
74
 
75
- if (executionContext .getSpecificationVersion () == "2.0")
75
+ if (executionContext .getSpecificationVersion () === "2.0")
76
76
  this .addAlias ("choice", this .children_);
77
77
 
78
78
  this .childNode = null;
@@ -273,7 +273,7 @@ function (Fields,
273
273
 
274
274
  this .addType (X3DConstants .DirectionalLight);
275
275
 
276
- if (executionContext .getSpecificationVersion () == "2.0")
276
+ if (executionContext .getSpecificationVersion () === "2.0")
277
277
  this .global_ = true;
278
278
  }
279
279
 
@@ -75,7 +75,7 @@ function (Fields,
75
75
 
76
76
  this .addType (X3DConstants .Collision);
77
77
 
78
- if (executionContext .getSpecificationVersion () == "2.0")
78
+ if (executionContext .getSpecificationVersion () === "2.0")
79
79
  this .addAlias ("collide", this .enabled_); // VRML2
80
80
  }
81
81
 
@@ -76,7 +76,7 @@ function (Fields,
76
76
 
77
77
  this .addType (X3DConstants .LOD);
78
78
 
79
- if (executionContext .getSpecificationVersion () == "2.0")
79
+ if (executionContext .getSpecificationVersion () === "2.0")
80
80
  this .addAlias ("level", this .children_); // VRML2
81
81
 
82
82
  this .center_ .setUnit ("length");
@@ -912,7 +912,7 @@ function (Fields,
912
912
  backMaterialNode = appearanceNode .backMaterialNode,
913
913
  frontShaderNode = appearanceNode .shaderNode || materialNode .getShader (context .browser, context .shadow);
914
914
 
915
- if (this .solid || !backMaterialNode || context .wireframe)
915
+ if (this .solid || !backMaterialNode || frontShaderNode .wireframe)
916
916
  {
917
917
  this .displayGeometry (gl, context, appearanceNode, frontShaderNode, true, true);
918
918
  }
@@ -962,12 +962,19 @@ function (Fields,
962
962
 
963
963
  // Draw depending on wireframe, solid and transparent.
964
964
 
965
- if (context .wireframe)
965
+ if (shaderNode .wireframe)
966
966
  {
967
- // Wireframes are always solid so only one drawing call is needed.
967
+ // Points and Wireframes.
968
968
 
969
- for (let i = 0, length = this .vertexCount; i < length; i += 3)
970
- gl .drawArrays (shaderNode .primitiveMode, i, 3);
969
+ if (shaderNode .primitiveMode === gl .POINTS)
970
+ {
971
+ gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
972
+ }
973
+ else
974
+ {
975
+ for (let i = 0, length = this .vertexCount; i < length; i += 3)
976
+ gl .drawArrays (shaderNode .primitiveMode, i, 3);
977
+ }
971
978
  }
972
979
  else
973
980
  {
@@ -983,7 +990,7 @@ function (Fields,
983
990
 
984
991
  // Render back.
985
992
 
986
- if (back)
993
+ if (back && !this .solid)
987
994
  {
988
995
  gl .cullFace (gl .FRONT);
989
996
  gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
@@ -1071,7 +1078,7 @@ function (Fields,
1071
1078
  backMaterialNode = appearanceNode .backMaterialNode,
1072
1079
  frontShaderNode = appearanceNode .shaderNode || materialNode .getShader (context .browser, context .shadow);
1073
1080
 
1074
- if (this .solid || !backMaterialNode || context .wireframe)
1081
+ if (this .solid || !backMaterialNode || frontShaderNode .wireframe)
1075
1082
  {
1076
1083
  this .displayParticlesGeometry (gl, context, appearanceNode, frontShaderNode, true, true, particles, numParticles);
1077
1084
  }
@@ -1131,7 +1138,7 @@ function (Fields,
1131
1138
 
1132
1139
  if (shaderNode .wireframe)
1133
1140
  {
1134
- // Wireframes are always solid so only one drawing call is needed.
1141
+ // Points and Wireframes.
1135
1142
 
1136
1143
  for (let p = 0; p < numParticles; ++ p)
1137
1144
  {
@@ -1145,8 +1152,15 @@ function (Fields,
1145
1152
 
1146
1153
  shaderNode .setParticle (gl, particle, modelViewMatrix);
1147
1154
 
1148
- for (let i = 0, length = this .vertexCount; i < length; i += 3)
1149
- gl .drawArrays (shaderNode .primitiveMode, i, 3);
1155
+ if (shaderNode .primitiveMode === gl .POINTS)
1156
+ {
1157
+ gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
1158
+ }
1159
+ else
1160
+ {
1161
+ for (let i = 0, length = this .vertexCount; i < length; i += 3)
1162
+ gl .drawArrays (shaderNode .primitiveMode, i, 3);
1163
+ }
1150
1164
  }
1151
1165
  }
1152
1166
  else
@@ -1173,7 +1187,7 @@ function (Fields,
1173
1187
 
1174
1188
  gl .enable (gl .CULL_FACE);
1175
1189
 
1176
- if (back)
1190
+ if (back && !this .solid)
1177
1191
  {
1178
1192
  gl .cullFace (gl .FRONT);
1179
1193
  gl .drawArrays (shaderNode .primitiveMode, 0, this .vertexCount);
@@ -80,6 +80,35 @@ function (X3DGeometryNode,
80
80
  {
81
81
  return false;
82
82
  },
83
+ transfer: function ()
84
+ {
85
+ // Line stipple support.
86
+
87
+ if (this .getGeometryType () === 1)
88
+ {
89
+ const
90
+ texCoords = this .getTexCoords (),
91
+ vertices = this .getVertices ();
92
+
93
+ this .getMultiTexCoords () .push (texCoords);
94
+
95
+ for (let i = 0, length = vertices .length; i < length; i += 8)
96
+ {
97
+ texCoords .push (vertices [i],
98
+ vertices [i + 1],
99
+ vertices [i + 2],
100
+ vertices [i + 3],
101
+ vertices [i],
102
+ vertices [i + 1],
103
+ vertices [i + 2],
104
+ vertices [i + 3]);
105
+ }
106
+
107
+ texCoords .shrinkToFit ();
108
+ }
109
+
110
+ X3DGeometryNode .prototype .transfer .call (this);
111
+ },
83
112
  display: function (gl, context)
84
113
  {
85
114
  try
@@ -115,6 +144,9 @@ function (X3DGeometryNode,
115
144
  if (this .colorMaterial)
116
145
  shaderNode .enableColorAttribute (gl, this .colorBuffer);
117
146
 
147
+ if (this .getMultiTexCoords () .length)
148
+ shaderNode .enableTexCoordAttribute (gl, this .texCoordBuffers, true);
149
+
118
150
  shaderNode .enableVertexAttribute (gl, this .vertexBuffer);
119
151
 
120
152
  // Wireframes are always solid so only one drawing call is needed.
@@ -130,7 +162,9 @@ function (X3DGeometryNode,
130
162
  if (this .colorMaterial)
131
163
  shaderNode .disableColorAttribute (gl);
132
164
 
133
- shaderNode .disableTexCoordAttribute (gl);
165
+ if (this .getMultiTexCoords () .length)
166
+ shaderNode .disableTexCoordAttribute (gl);
167
+
134
168
  shaderNode .disable (gl);
135
169
 
136
170
  if (blendModeNode)