mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
56ec15c0f4
@ -38,9 +38,18 @@ function Bone.new (data, parent)
|
|||||||
if parent then
|
if parent then
|
||||||
self.worldX = self.x * parent.m00 + self.y * parent.m01 + parent.worldX
|
self.worldX = self.x * parent.m00 + self.y * parent.m01 + parent.worldX
|
||||||
self.worldY = self.x * parent.m10 + self.y * parent.m11 + parent.worldY
|
self.worldY = self.x * parent.m10 + self.y * parent.m11 + parent.worldY
|
||||||
self.worldScaleX = parent.worldScaleX * self.scaleX
|
if (self.data.inheritScale) then
|
||||||
self.worldScaleY = parent.worldScaleY * self.scaleY
|
self.worldScaleX = parent.worldScaleX * self.scaleX
|
||||||
self.worldRotation = parent.worldRotation + self.rotation
|
self.worldScaleY = parent.worldScaleY * self.scaleY
|
||||||
|
else
|
||||||
|
self.worldScaleX = self.scaleX
|
||||||
|
self.worldScaleY = self.scaleY
|
||||||
|
end
|
||||||
|
if (self.data.inheritRotation) then
|
||||||
|
self.worldRotation = parent.worldRotation + self.rotation
|
||||||
|
else
|
||||||
|
self.worldRotation = self.rotation
|
||||||
|
end
|
||||||
else
|
else
|
||||||
if flipX then
|
if flipX then
|
||||||
self.worldX = -self.x
|
self.worldX = -self.x
|
||||||
|
|||||||
@ -75,6 +75,10 @@ function SkeletonJson.new (attachmentLoader)
|
|||||||
boneData.rotation = (boneMap["rotation"] or 0)
|
boneData.rotation = (boneMap["rotation"] or 0)
|
||||||
boneData.scaleX = (boneMap["scaleX"] or 1)
|
boneData.scaleX = (boneMap["scaleX"] or 1)
|
||||||
boneData.scaleY = (boneMap["scaleY"] or 1)
|
boneData.scaleY = (boneMap["scaleY"] or 1)
|
||||||
|
-- typical 'value or default' will not work here, as in practice the possible values are 'false' or nil,
|
||||||
|
-- both of which evaluate to false and the default value is true
|
||||||
|
if boneMap["inheritScale"] == false then boneData.inheritScale = false else boneData.inheritScale = true end
|
||||||
|
if boneMap["inheritRotation"] == false then boneData.inheritRotation = false else boneData.inheritRotation = true end
|
||||||
table.insert(skeletonData.bones, boneData)
|
table.insert(skeletonData.bones, boneData)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user