Skip to content

Commit 2fc8719

Browse files
committed
Updated builds.
1 parent c4d3bbe commit 2fc8719

File tree

3 files changed

+17
-1
lines changed

3 files changed

+17
-1
lines changed

build/three.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,6 +1147,14 @@
11471147
lerp: function lerp(x, y, t) {
11481148
return (1 - t) * x + t * y;
11491149
},
1150+
// https://www.desmos.com/calculator/vcsjnyz7x4
1151+
pingpong: function pingpong(x, length) {
1152+
if (length === void 0) {
1153+
length = 1;
1154+
}
1155+
1156+
return length - Math.abs(MathUtils.euclideanModulo(x, length * 2) - length);
1157+
},
11501158
// http://en.wikipedia.org/wiki/Smoothstep
11511159
smoothstep: function smoothstep(x, min, max) {
11521160
if (x <= min) return 0;

build/three.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/three.module.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,14 @@ const MathUtils = {
349349

350350
},
351351

352+
// https://www.desmos.com/calculator/vcsjnyz7x4
353+
354+
pingpong: function ( x, length = 1 ) {
355+
356+
return length - Math.abs( MathUtils.euclideanModulo( x, length * 2 ) - length );
357+
358+
},
359+
352360
// http://en.wikipedia.org/wiki/Smoothstep
353361

354362
smoothstep: function ( x, min, max ) {

0 commit comments

Comments
 (0)