+ /// An attachment which is a single point and a rotation. This can be used to spawn projectiles, particles, etc. A bone can be
+ /// used in similar ways, but a PointAttachment is slightly less expensive to compute and can be hidden, shown, and placed in a
+ /// skin.
+ ///
+ /// See Point Attachments in the Spine User Guide.
+ ///
+ public class PointAttachment : Attachment {
+ internal float x, y, rotation;
+ public float X { get { return x; } set { x = value; } }
+ public float Y { get { return y; } set { y = value; } }
+ public float Rotation { get { return rotation; } set { rotation = value; } }
+
+ public PointAttachment (string name)
+ : base(name) {
+ }
+
+ public void ComputeWorldPosition (Bone bone, float x, float y, out float ox, out float oy) {
+ bone.LocalToWorld(x, y, out ox, out oy);
+ }
+
+ public float ComputeWorldRotation (Bone bone) {
+ float cos = MathUtils.CosDeg(rotation), sin = MathUtils.SinDeg(rotation);
+ float ix = cos * bone.a + sin * bone.b;
+ float iy = cos * bone.c + sin * bone.d;
+ return MathUtils.Atan2(iy, ix) * MathUtils.RadDeg;
+ }
+ }
+}
+
diff --git a/spine-csharp/src/Attachments/VertexAttachment.cs b/spine-csharp/src/Attachments/VertexAttachment.cs
index ffdcd9b28..ff20b04c8 100644
--- a/spine-csharp/src/Attachments/VertexAttachment.cs
+++ b/spine-csharp/src/Attachments/VertexAttachment.cs
@@ -55,7 +55,8 @@ namespace Spine {
///