update method

Recomputes the polygons from the instance's current pose.

Implementation

OpenBoneSkeletonBounds update(OpenBoneInstance instance) => using((arena) {
      final h = _handle;
      final n = _b.ob_bounds_update(h, instance.handle);
      final box = arena<ob_bounding_box>();
      _boxes = List.unmodifiable([
        for (var i = 0; i < n; i++)
          if (_b.ob_bounds_box(h, i, box) != 0)
            OpenBoneBoundingBox(
              index: i,
              slot: box.ref.slot.dart,
              attachment: box.ref.attachment.dart,
              vertices: box.ref.vertex_count > 0 && box.ref.vertices != nullptr
                  ? Float32List.fromList(box.ref.vertices.asTypedList(box.ref.vertex_count * 2))
                  : Float32List(0),
              minX: box.ref.min_x,
              minY: box.ref.min_y,
              maxX: box.ref.max_x,
              maxY: box.ref.max_y,
            ),
      ]);
      return this;
    });