Home > decentraland-ecs > Vector3 > Clamp
Returns a new Vector3 set with the coordinates of "value", if the vector "value" is in the cube defined by the vectors "min" and "max" If a coordinate value of "value" is lower than one of the "min" coordinate, then this "value" coordinate is set with the "min" one If a coordinate value of "value" is greater than one of the "max" coordinate, then this "value" coordinate is set with the "max" one
Signature:
static Clamp(value: ReadOnlyVector3, min: ReadOnlyVector3, max: ReadOnlyVector3): Vector3;
Returns: Vector3
the new Vector3
Parameter | Type | Description |
---|---|---|
value |
ReadOnlyVector3 |
defines the current value |
min |
ReadOnlyVector3 |
defines the lower range value |
max |
ReadOnlyVector3 |
defines the upper range value |