UnmodifiableVector3.copy constructor

UnmodifiableVector3.copy(
  1. Vector3 other
)

Extension of the standard Vector3 class, but fully unmodifiable.

This class can be used as a regular Vector3 class. However, if you do try to write values the calls will throw.

Direct modification of this vector's storage is not allowed.

Create a copy of the other vector.

Implementation

factory UnmodifiableVector3.copy(Vector3 other) =>
    UnmodifiableVector3.zero().._setValues(other.x, other.y, other.z);