class VertexAttachment
package spine.attachments
extends Attachment
extended by BoundingBoxAttachment, ClippingAttachment, MeshAttachment, PathAttachment, PointAttachment
Base class for an attachment with vertices that are transformed by one or more bones and can be deformed by a slot's Slot.deform
.
Variables
bones:Null<Array<Int>>
The bones which affect the vertices
. The array entries are, for each vertex, the number of bones affecting
the vertex followed by that many bone indices, which is the index of the bone in Skeleton.bones
. Will be null
if this attachment has no weights.
deformAttachment:Null<VertexAttachment>
Deform keys for the deform attachment are also applied to this attachment. May be null if no deform keys should be applied.
vertices:Array<Float>
The vertex positions in the bone's coordinate system. For a non-weighted attachment, the values are x,y
entries for each vertex. For a weighted attachment, the values are x,y,weight
entries for each bone affecting
each vertex.
worldVerticesLength:Int = 0
The maximum number of world vertex values that can be output by
computeWorldVertices
using the count
parameter.
Methods
computeWorldVertices(slot:Slot, start:Int, count:Int, worldVertices:Array<Float>, offset:Int, stride:Int):Void
Transforms the attachment's local vertices
to world coordinates. If the slot's Slot.deform
is
not empty, it is used to deform the vertices.
See World transforms in the Spine Runtimes Guide.
Parameters:
start | The index of the first |
---|---|
count | The number of world vertex values to output. Must be <= |
worldVertices | The output world vertices. Must have a length >= |
offset | The |
stride | The number of |