Deep clones the object, i.e. both origin and direction are cloned into a new Ray2 object.
Ray2 clone() => Ray2(origin: origin.clone(), direction: direction.clone());