Vector.clamp

From GiderosMobile
Revision as of 09:16, 3 February 2026 by MoKaLux (talk | contribs) (Created page with "__NOTOC__ '''Available since:''' Gideros 2026.1<br/> '''Class:''' vector library<br/> === Description === Applies ''math.clamp'' to every components of the input vector....")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Available since: Gideros 2026.1
Class: vector library

Description

Applies math.clamp to every components of the input vector.

(vector) = vector.clamp(vec)

Parameters

vec: (vector) the input vector

Return values

Returns (vector) returns the new vector with math.clamp applied to every components

Example

local vec : vector = vector.create(1, -2.5, 3)

--local clam = vector.clamp(vec, vector(0, 0, 0), vector(2, 2, 2))
local clam = vector.clamp(vec, vector.create(0, 0, 0), vector.create(2, 2, 2))
print(typeof(clam), clam) -- vector	1, 0, 2