zincjs 2.3.0 → 2.3.1-beta.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/src/utilities.js CHANGED
@@ -685,8 +685,6 @@ function PhongToToon(materialIn) {
685
685
  if (materialIn.isMeshPhongMaterial) {
686
686
  let material = new THREE.MeshToonMaterial({
687
687
  color : materialIn.color.clone(),
688
- morphTargets : materialIn.morphTargets,
689
- morphNormals : materialIn.morphNormals,
690
688
  vertexColors : materialIn.vertexColors,
691
689
  transparent : materialIn.transparent,
692
690
  opacity : materialIn.opacity,
@@ -823,12 +821,74 @@ function removeVertexAtIndex(geometry, index, maintainLength) {
823
821
  }
824
822
 
825
823
  return removed;
824
+ }
825
+
826
+ function copyVector2sArray(attribute, vectors) {
827
+ const array = attribute.array;
828
+ let offset = 0;
829
+
830
+ for (let i = 0; i < vectors.length; i++) {
831
+ const v = vectors[i];
832
+ array[offset++] = v.x;
833
+ array[offset++] = v.y;
834
+ }
835
+
836
+ attribute.needsUpdate = true;
837
+ return attribute;
838
+ }
839
+
840
+ function copyVector3sArray(attribute, vectors) {
841
+ const array = attribute.array;
842
+ let offset = 0;
843
+
844
+ for (let i = 0; i < vectors.length; i++) {
845
+ const v = vectors[i];
846
+ array[offset++] = v.x;
847
+ array[offset++] = v.y;
848
+ array[offset++] = v.z;
849
+ }
826
850
 
851
+ attribute.needsUpdate = true;
852
+ return attribute;
827
853
  }
828
854
 
855
+ function copyVector4sArray(attribute, vectors) {
856
+ const array = attribute.array;
857
+ let offset = 0;
858
+
859
+ for (let i = 0; i < vectors.length; i++) {
860
+ const v = vectors[i];
861
+ array[offset++] = v.x;
862
+ array[offset++] = v.y;
863
+ array[offset++] = v.z;
864
+ array[offset++] = v.w;
865
+ }
866
+
867
+ attribute.needsUpdate = true;
868
+ return attribute;
869
+ }
870
+
871
+ function copyColorsArray(attribute, colors) {
872
+ const array = attribute.array;
873
+ let offset = 0;
874
+
875
+ for (let i = 0; i < colors.length; i++) {
876
+ const c = colors[i];
877
+ array[offset++] = c.r;
878
+ array[offset++] = c.g;
879
+ array[offset++] = c.b;
880
+ }
881
+
882
+ attribute.needsUpdate = true;
883
+ return attribute;
884
+ }
829
885
 
830
886
  export {
831
887
  copyMorphColorsToBufferGeometry,
888
+ copyColorsArray,
889
+ copyVector2sArray,
890
+ copyVector3sArray,
891
+ copyVector4sArray,
832
892
  createBufferGeometry,
833
893
  createNewSpriteText,
834
894
  createNewURL,
@@ -59,7 +59,10 @@ const VideoHandler = function(srcIn) {
59
59
  }
60
60
 
61
61
  this.setMorphTime = function(time, duration){
62
- var actualTime = time / duration * _this.video.duration;
62
+ let actualTime = time / duration * _this.video.duration;
63
+ if (!Number.isFinite(actualTime)) {
64
+ actualTime = 0.0;
65
+ }
63
66
  _this.video.currentTime = actualTime;
64
67
  }
65
68