@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
18 lines (17 loc) • 486 B
JavaScript
;
import { BaseMethod } from "./_Base";
import { MathUtils } from "three";
export class SmoothstepExpression extends BaseMethod {
static requiredArguments() {
return [, ["x", "value"], ["min", "range min"], ["max", "range max"]];
}
async processArguments(args) {
if (args.length == 3) {
const x = args[0];
const rangeMin = args[1];
const rangeMax = args[2];
return MathUtils.smoothstep(x, rangeMin, rangeMax);
}
return 0;
}
}