withRandomDirection

open override fun withRandomDirection(rng: Random = MathUtils.random): ImmutableVector2

Returns a vector of same length and a random direction.

Parameters

rng

Random number generator to use (MathUtils.random by default)