Aabb2.fromBuffer constructor

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 Float32List.bytesPerElement.

Implementation

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