From 91f2f71abf6e4c6646622678851ab1c87bf8f711 Mon Sep 17 00:00:00 2001 From: Mario Zechner Date: Mon, 30 Jun 2025 23:25:32 +0200 Subject: [PATCH] [cpp] 4.3 porting WIP --- .gitignore | 1 + .../spine-cpp/include/spine/VertexAttachment.h | 15 ++++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 0caacbb45..35b563230 100644 --- a/.gitignore +++ b/.gitignore @@ -233,3 +233,4 @@ spine-libgdx/spine-libgdx-tests/.settings/org.eclipse.buildship.core.prefs spine-libgdx/spine-libgdx-tests/.settings/org.eclipse.jdt.apt.core.prefs spine-libgdx/spine-skeletonviewer/.settings/org.eclipse.buildship.core.prefs spine-libgdx/spine-skeletonviewer/.settings/org.eclipse.jdt.apt.core.prefs +spine-cpp/.cache diff --git a/spine-cpp/spine-cpp/include/spine/VertexAttachment.h b/spine-cpp/spine-cpp/include/spine/VertexAttachment.h index 3d8fd508a..0ac1a31b4 100644 --- a/spine-cpp/spine-cpp/include/spine/VertexAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/VertexAttachment.h @@ -38,7 +38,8 @@ namespace spine { class Slot; class Skeleton; - /// An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices. + /// An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's + /// SlotPose::getDeform(). class SP_API VertexAttachment : public Attachment { friend class SkeletonBinary; @@ -54,10 +55,14 @@ namespace spine { virtual ~VertexAttachment(); - /// Transforms local vertices to world coordinates. - /// @param start The index of the first Vertices value to transform. Each vertex has 2 values, x and y. - /// @param count The number of world vertex values to output. Must be less than or equal to WorldVerticesLength - start. - /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + count. + /// Transforms the attachment's local vertices to world coordinates. If the slot's SlotPose::getDeform() + /// is not empty, it is used to deform the vertices. + /// + /// See https://esotericsoftware.com/spine-runtime-skeletons#World-transforms World transforms in the Spine + /// Runtimes Guide. + /// @param start The index of the first vertices value to transform. Each vertex has 2 values, x and y. + /// @param count The number of world vertex values to output. Must be <= WorldVerticesLength - start. + /// @param worldVertices The output world vertices. Must have a length >= offset + count * stride / 2. /// @param offset The worldVertices index to begin writing values. /// @param stride The number of worldVertices entries between the value pairs written. virtual void computeWorldVertices(Skeleton &skeleton, Slot &slot, size_t start, size_t count, float *worldVertices, size_t offset,