Bläddra i källkod

Updated builds.

Mr.doob 4 år sedan
förälder
incheckning
2fc8719ca3
3 ändrade filer med 16 tillägg och 0 borttagningar
  1. 8 0
      build/three.js
  2. 0 0
      build/three.min.js
  3. 8 0
      build/three.module.js

+ 8 - 0
build/three.js

@@ -1147,6 +1147,14 @@
 		lerp: function lerp(x, y, t) {
 			return (1 - t) * x + t * y;
 		},
+		// https://www.desmos.com/calculator/vcsjnyz7x4
+		pingpong: function pingpong(x, length) {
+			if (length === void 0) {
+				length = 1;
+			}
+
+			return length - Math.abs(MathUtils.euclideanModulo(x, length * 2) - length);
+		},
 		// http://en.wikipedia.org/wiki/Smoothstep
 		smoothstep: function smoothstep(x, min, max) {
 			if (x <= min) return 0;

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 0 - 0
build/three.min.js


+ 8 - 0
build/three.module.js

@@ -349,6 +349,14 @@ const MathUtils = {
 
 	},
 
+	// https://www.desmos.com/calculator/vcsjnyz7x4
+
+	pingpong: function ( x, length = 1 ) {
+
+		return length - Math.abs( MathUtils.euclideanModulo( x, length * 2 ) - length );
+
+	},
+
 	// http://en.wikipedia.org/wiki/Smoothstep
 
 	smoothstep: function ( x, min, max ) {

Vissa filer visades inte eftersom för många filer har ändrats