Fixed joint animation application correctly.
This commit is contained in:
parent
58d26618f6
commit
92800f61d3
1 changed files with 6 additions and 7 deletions
|
@ -282,15 +282,14 @@ public final class Clips
|
||||||
return Optional.absent();
|
return Optional.absent();
|
||||||
}
|
}
|
||||||
IJoint joint = (IJoint)part.get();
|
IJoint joint = (IJoint)part.get();
|
||||||
|
// TODO: Cache clip application?
|
||||||
TRSRTransformation jointTransform = clip.apply(joint).apply(time).compose(joint.getInvBindPose());
|
TRSRTransformation jointTransform = clip.apply(joint).apply(time).compose(joint.getInvBindPose());
|
||||||
Optional<TRSRTransformation> parentTransform = Optional.absent();
|
Optional<? extends IJoint> parent = joint.getParent();
|
||||||
if(joint.getParent().isPresent())
|
while(parent.isPresent())
|
||||||
{
|
{
|
||||||
parentTransform = apply(Optional.of(joint.getParent().get()));
|
TRSRTransformation parentTransform = clip.apply(parent.get()).apply(time);
|
||||||
}
|
jointTransform = parentTransform.compose(jointTransform);
|
||||||
if(parentTransform.isPresent())
|
parent = parent.get().getParent();
|
||||||
{
|
|
||||||
jointTransform = parentTransform.get().compose(jointTransform);
|
|
||||||
}
|
}
|
||||||
return Optional.of(jointTransform);
|
return Optional.of(jointTransform);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue