Fixed spine-lua IK timelines.

This commit is contained in:
NathanSweet 2014-11-17 23:06:52 +01:00
parent 97bc171bdd
commit 66dee75951
2 changed files with 3 additions and 3 deletions

View File

@ -691,7 +691,7 @@ function Animation.IkConstraintTimeline.new ()
local frames = self.frames
if time < frames[0] then return end -- Time is before first frame.
local ikConstraint = skeleton.ikConstraints[ikConstraintIndex]
local ikConstraint = skeleton.ikConstraints[self.ikConstraintIndex]
if time >= frames[#frames - 2] then -- Time is after last frame.
ikConstraint.mix = ikConstraint.mix + (frames[#frames - 1] - ikConstraint.mix) * alpha

View File

@ -440,8 +440,8 @@ function SkeletonJson.new (attachmentLoader)
local ik = map["ik"]
if ik then
for ikConstraintName,values in pairs(ik) do
local ikConstraint = skeletonData.findIkConstraint(ikConstraintName)
local timeline = IkConstraintTimeline.new()
local ikConstraint = skeletonData:findIkConstraint(ikConstraintName)
local timeline = Animation.IkConstraintTimeline.new()
for i,other in pairs(skeletonData.ikConstraints) do
if other == ikConstraint then
timeline.ikConstraintIndex = i