mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-13 02:28:44 +08:00
Add Lua support for inheriting scale and rotation
This commit is contained in:
parent
22fabe8769
commit
fb21554a49
@ -38,9 +38,18 @@ function Bone.new (data, parent)
|
||||
if parent then
|
||||
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.worldScaleX = parent.worldScaleX * self.scaleX
|
||||
self.worldScaleY = parent.worldScaleY * self.scaleY
|
||||
self.worldRotation = parent.worldRotation + self.rotation
|
||||
if (self.data.inheritScale) then
|
||||
self.worldScaleX = parent.worldScaleX * self.scaleX
|
||||
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
|
||||
if flipX then
|
||||
self.worldX = -self.x
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user