BBMOD_Vec4.ClampLengthSelf

A function defined in BBMOD_Vec4.gml

ClampLengthSelf(_min, _max)

Description

Clamps the length of the vector between _min and _max and stores the result into self.

Arguments

Name Type Description
_min Real The minimum length of the vector.
_max Real The maximum length of the vector.

Returns

Struct.BBMOD_Vec4 Returns self.

Example

// => BBMOD_Vec4(3.0, 0.0, 0.0, 0.0):
new BBMOD_Vec4(3.0, 0.0, 0.0, 0.0).ClampLengthSelf(1.0, 5.0);
// => BBMOD_Vec4(4.0, 0.0, 0.0, 0.0):
new BBMOD_Vec4(3.0, 0.0, 0.0, 0.0).ClampLengthSelf(4.0, 5.0);
// => BBMOD_Vec4(2.0, 0.0, 0.0, 0.0):
new BBMOD_Vec4(3.0, 0.0, 0.0, 0.0).ClampLengthSelf(1.0, 2.0);
Do you find this page helpful?

Copyright © 2024, BlueBurn. Built on July 03, 2024 using GMDoc.