clampLength method

Vector4 clampLength(
  1. num min,
  2. num max
)

Implementation

Vector4 clampLength(num min, num max) {
  var length = this.length();

  return divideScalar(length)
      .multiplyScalar(Math.max(min, Math.min(max, length)));
}