zincjs 1.19.3 → 1.19.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zincjs",
3
- "version": "1.19.3",
3
+ "version": "1.19.4",
4
4
  "description": "ZincJS (Web-based-Zinc-Visualisation)",
5
5
  "main": "build/zinc.js",
6
6
  "directories": {
@@ -15,6 +15,7 @@ const defaultTextureSettings = {
15
15
  "position": [0, 0, 0],
16
16
  "scale": [1, 1, 1],
17
17
  "flipY": false,
18
+ "flipZ": false,
18
19
  "reference_point": "corner"
19
20
  }
20
21
  ],
@@ -21,6 +21,7 @@ const TextureSlides = function (textureIn) {
21
21
  this.morph.userData = this;
22
22
  let edgesLine = undefined;
23
23
  let flipY = true;
24
+ let flipZ = false;
24
25
  let brightness = 0.0;
25
26
  let contrast = 1.0;
26
27
  let discardAlpha = true;
@@ -124,6 +125,7 @@ const TextureSlides = function (textureIn) {
124
125
  uniforms.discardAlpha.value = discardAlpha;
125
126
  uniforms.depth.value = this.texture.size.depth;
126
127
  uniforms.flipY.value = flipY;
128
+ uniforms.flipZ.value = flipZ;
127
129
  const options = {
128
130
  fs: shader.fs,
129
131
  vs: shader.vs,
@@ -330,6 +332,9 @@ const TextureSlides = function (textureIn) {
330
332
  if ("flipY" in locations[0]) {
331
333
  flipY = locations[0].flipY;
332
334
  }
335
+ if ("flipZ" in locations[0]) {
336
+ flipZ = locations[0].flipZ;
337
+ }
333
338
  }
334
339
  this.createSlides(textureData.settings.slides);
335
340
  if (finishCallback != undefined && (typeof finishCallback == 'function')) {
@@ -20,6 +20,7 @@ const TextureSlides = function (textureIn) {
20
20
  this.morph.userData = this;
21
21
  let edgesLine = undefined;
22
22
  let flipY = true;
23
+ let flipZ = false;
23
24
 
24
25
  /**
25
26
  @typedef SLIDE_SETTINGS
@@ -113,6 +114,7 @@ const TextureSlides = function (textureIn) {
113
114
  uniforms.diffuse.value = this.texture.impl;
114
115
  uniforms.depth.value = this.texture.size.depth;
115
116
  uniforms.flipY.value = flipY;
117
+ uniforms.flipZ.value = flipZ;
116
118
 
117
119
  const options = {
118
120
  fs: shader.fs,
@@ -284,6 +286,9 @@ const TextureSlides = function (textureIn) {
284
286
  if ("flipY" in locations[0]) {
285
287
  flipY = locations[0].flipY;
286
288
  }
289
+ if ("flipZ" in locations[0]) {
290
+ flipZ = locations[0].flipZ;
291
+ }
287
292
  }
288
293
  this.createSlides(textureData.settings.slides);
289
294
  if (finishCallback != undefined && (typeof finishCallback == 'function')) {
@@ -41,6 +41,7 @@ uniform float depth;
41
41
  uniform vec3 slide;
42
42
  uniform int direction;
43
43
  uniform bool flipY;
44
+ uniform bool flipZ;
44
45
 
45
46
  void main() {
46
47
 
@@ -56,6 +57,8 @@ void main() {
56
57
 
57
58
  if (flipY)
58
59
  slidePos.y = 1.0 - slidePos.y;
60
+ if (flipZ)
61
+ slidePos.z = 1.0 - slidePos.z;
59
62
 
60
63
  vUw.xyz = vec3(slidePos.x, slidePos.y, slidePos.z * depth);
61
64
 
@@ -72,6 +75,7 @@ const getUniforms = function() {
72
75
  diffuse1: { value: undefined },
73
76
  direction: {value: 1},
74
77
  flipY: { value: true},
78
+ flipZ: { value: false},
75
79
  slide: { value: new THREE.Vector3( 0, 0, 1 ) },
76
80
  time: { value: 0 }
77
81
  };
@@ -1455,7 +1455,7 @@ class GLTFWriter {
1455
1455
  let warned = false;
1456
1456
 
1457
1457
  for ( const attributeName in geometry.morphAttributes ) {
1458
-
1458
+
1459
1459
 
1460
1460
  // glTF 2.0 morph supports only POSITION/NORMAL/TANGENT.
1461
1461
  // Three.js doesn't support TANGENT yet.
@@ -1502,7 +1502,7 @@ class GLTFWriter {
1502
1502
  if ( ! geometry.morphTargetsRelative ) {
1503
1503
 
1504
1504
  if (baseAttribute) {
1505
-
1505
+
1506
1506
  for ( let j = 0, jl = attribute.count; j < jl; j ++ ) {
1507
1507
 
1508
1508
  if (baseAttribute.count > j) {