- Edited
Spine + Physics : attachment moving independently
While working on Spine+Physics (my Psi-Engine) I came across something funny and I need your opinion.
Is it currently possible (I think not) to animate an attachment independently to its parent bone? The only way I can see is with a deform timeline which makes something like mesh morphing, but this doesn't "count" cause mesh morphing can't be simulated by Box2d (and for good reasons).
I also don't see any spRegionAttachment WorldToLocal and LocalToWorld functions which further imply that their local transformation generally stays put.
You could place an additional bone and place the attachment on that. This would allow you to animate the new bone independently.
If you want to make sure the extra bone isn't receiving any transforms from its parent you can use a transform constraint instead of parenting. Then when you want to animate it independently you set the constraint mix to 0.
What does "mesh morphing"/deform timeline have to do with physics integration?
You can still manipulate bone world values (the 2x2 world rotate/scale/shear transform matrix and world position) at runtime to integrate with physics. That way you can still leave the rendering to SkeletonRenderer code, and even interpolate between animation-controlled and physics-controlled positions.
If not, you can switch to your own renderer, and render all the attachments, pretending your box2D bodies or whatever analog, are bones (which are really just transforms in a hierarchy).
The first way is probably better.