computeWorldVertices method

List<double> computeWorldVertices(
  1. Slot slot
)

Transforms and returns the attachment's local getVertices to world coordinates. If the slot's Slot.getDeform is not empty, it is used to deform the vertices. See World transforms in the Spine Runtimes Guide.

Implementation

/// See [World transforms](http://esotericsoftware.com/spine-runtime-skeletons#World-transforms) in the Spine
/// Runtimes Guide.
List<double> computeWorldVertices(Slot slot) {
  final worldVerticesLength = _bindings.spine_vertex_attachment_get_world_vertices_length(_attachment.cast());
  Pointer<Float> vertices = _allocator.allocate(4 * worldVerticesLength).cast();
  _bindings.spine_vertex_attachment_compute_world_vertices(_attachment.cast(), slot._slot, vertices);
  final result = vertices.asTypedList(worldVerticesLength).toList();
  _allocator.free(vertices);
  return result;
}