Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/threejs_4_deno/src/math/Vector2.js>Vector2#clampLength

A simple transformation of three.js for use within a Deno workflow
Go to Latest
method Vector2.prototype.clampLength
import { Vector2 } from "https://deno.land/x/threejs_4_deno@v121/src/math/Vector2.js";

If this vector's length is greater than the max value, it is replaced by the max value. If this vector's length is less than the min value, it is replaced by the min value.

Parameters

min: number

the minimum value the length will be clamped to.

max: number

the maximum value the length will be clamped to.