normalizedOrElse

inline fun normalizedOrElse(defaultValue: Vector2F): Vector2F

Returns a normalized copy of this vector if this vector magnitude is large enough to safely normalize. Else returns defaultValue.

Parameters

defaultValue

the returned value if this vector could not be safely normalized.


inline fun normalizedOrElse(defaultValue: () -> Vector2F): Vector2F

Returns a normalized copy of this vector if this vector magnitude is large enough to safely normalize. Else returns the result of calling the defaultValue function.

Parameters

defaultValue

the function whose result is returned if the vector could not be safely normalized.