Vector2 RandomiseDirectionVector(const Vector2 &direction, float halfAngle) { float angle = RandFloatSigned() * halfAngle; Matrix2 rotation; rotation.FromRotation(angle); return rotation * direction; }