Aabb2.fromBuffer constructor Null safety

Aabb2.fromBuffer(
  1. ByteBuffer buffer,
  2. int offset
)

Constructs Aabb2 with a min/max storage that views given buffer starting at offset. offset has to be multiple of Float64List.bytesPerElement.

Implementation

Aabb2.fromBuffer(ByteBuffer buffer, int offset)
    : _min = Vector2.fromBuffer(buffer, offset),
      _max = Vector2.fromBuffer(
          buffer, offset + Float64List.bytesPerElement * 2);