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#clampScalar

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

If this vector's x or y values are greater than the max value, they are replaced by the max value. If this vector's x or y values are less than the min value, they are replaced by the min value.

Parameters

min: number

the minimum value the components will be clamped to.

max: number

the maximum value the components will be clamped to.