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

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

If this vector's x or y value is greater than the max vector's x or y value, it is replaced by the corresponding value. If this vector's x or y value is less than the min vector's x or y value, it is replaced by the corresponding value.

Parameters

min: Vector2

the minimum x and y values.

max: Vector2

the maximum x and y values in the desired range.