Hello,
Should the coordinates of attachments in skin section of spine json file, be converted into Spritekit coordinates system or they can be used as they are ?
Thank you for your help
One answer could be :
1-
bone = node
slot = node
attachment = sprite
2-
zPosition = draworder ( slots are given as arrays )
3-
all spine angles = degrees
spritekit = radians
4-
each bone has its own coordinates system
each node has its own
5-
moving parent bone will move all its children
moving parent node, will move all its children
6-
each coordinate pair given by Spine, is in local system of each bone
so that would be the same for each node placed inside another node
Somehow, there would be no need to convert coordinates
only follow the bones with nodes
7-
When a mesh is applied :
For non weighted vertices: "For each vertex either an x,y pair"
"or, for a weighted mesh,
first the number of bones which influence the vertex,
then
for that many bones: bone index, bind position X, bind position Y, weight"
"A mesh is weighted if the number of vertices > number of UVs"
ex : [ 2, 38, 18.17, 41.57, 0.72255, 39, 12.46, 46.05, 0.27745,
number of bones : 2
indice of first bone : 38
bind position X: 18.17
bind position Y: 41.57
weight: 0.72255
indice of second bone: 39
and so on
To understand that these indices are given by the ordre of input in the "bones" section of the main json file
8-
To be noticed that when we have weighted vertices, these vertices are given in the coordinate system of the corresponding bone.
in the exemple above : X: 18.17 and Y: 41.57 are given in the coordinate system of bone number 38
9-
ik :
ik are represented by a bone in Spine, so they are listed in the "bones" section
and they have a name, these two could be the same
"ik": [
{
"name": "ik-name",
"order": 0,
"bones": [ "arm", "hand" ],
"target": "ik-bone",
"mix": 0.233 // this is for the setup pose, means without any animation
}
],
mix: A value from 0 to 1 indicating the influence the constraint has on the bones,
where 0 means only FK, 1 means only IK, and between is a mix of FK and IK.
10-
if the root has an animation, every changing of its position will be overridden by its own animation,
so we need to add it to another node and change the position of that node
Hope this help others
to be completed