|
| Vec (fx8 x_=0, fx8 y_=0) |
|
Vec & | set (fx8 x_=0, fx8 y_=0) |
|
Vec & | add (fx8 x_=0, fx8 y_=0) |
|
Vec & | sub (fx8 x_=0, fx8 y_=0) |
|
Vec & | mul (fx8 v) |
|
Vec & | div (fx8 v) |
|
Vec & | clamp (fx8 xLow, fx8 xHigh, fx8 yLow, fx8 yHigh) |
|
Vec & | wrap (fx8 xLow, fx8 xHigh, fx8 yLow, fx8 yHigh) |
|
Vec & | setWithAngle (fx8 angle, fx8 length) |
|
Vec & | addWithAngle (fx8 angle, fx8 length) |
|
Vec & | swapXy () |
|
Vec & | normalize () |
|
Vec & | rotate (fx8 angle) |
|
fx8 | angleTo (fx8 x_, fx8 y_) const |
|
fx8 | distanceTo (fx8 x_, fx8 y_) const |
|
fx8 | distanceTo (const Vec &xy_) const |
|
bool | isInRect (fx8 x_, fx8 y_, fx8 width, fx8 height) const |
|
bool | isInRect (const Rect &rc) const |
|
bool | equals (const Vec &other) const |
|
Vec & | floor () |
|
Vec & | round () |
|
Vec & | ceil () |
|
fx8 | length () const |
|
fx8 | angle () const |
|
Vec & | negative () |
|
Vec | operator+ (const Vec &other) const |
|
Vec | operator- (const Vec &other) const |
|
Vec & | operator+= (const Vec &other) |
|
Vec & | operator-= (const Vec &other) |
|
Vec | operator* (fx8 scalar) const |
|
Vec & | operator*= (fx8 scalar) |
|
Vec | operator* (const Vec &other) const |
|
Vec & | operator*= (const Vec &other) |
|
Vec | operator/ (const Vec &other) const |
|
Vec & | operator/= (const Vec &other) |
|
Vec | operator/ (fx8 scalar) const |
|
Vec & | operator/= (fx8 scalar) |
|
Vec & | clampLength (fx8 maxLength) |
| Clamps the length of the vector to the specified maximum value.
|
|
◆ clampLength()
Vec & Vec::clampLength |
( |
fx8 | maxLength | ) |
|
|
inline |
Clamps the length of the vector to the specified maximum value.
If the current length of the vector exceeds the specified maxLength
, the vector's components are scaled down proportionally to match maxLength
. If the current length is less than or equal to maxLength
, no changes are made.
- Parameters
-
maxLength | The maximum allowable length for the vector. Must be a non-negative value. |
- Returns
- A reference to the modified vector.
- Note
- If the current length of the vector is zero, no scaling is performed.
The documentation for this class was generated from the following files: