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();
|
||||
}
|
||||
IJoint joint = (IJoint)part.get();
|
||||
// TODO: Cache clip application?
|
||||
TRSRTransformation jointTransform = clip.apply(joint).apply(time).compose(joint.getInvBindPose());
|
||||
Optional<TRSRTransformation> parentTransform = Optional.absent();
|
||||
if(joint.getParent().isPresent())
|
||||
Optional<? extends IJoint> parent = joint.getParent();
|
||||
while(parent.isPresent())
|
||||
{
|
||||
parentTransform = apply(Optional.of(joint.getParent().get()));
|
||||
}
|
||||
if(parentTransform.isPresent())
|
||||
{
|
||||
jointTransform = parentTransform.get().compose(jointTransform);
|
||||
TRSRTransformation parentTransform = clip.apply(parent.get()).apply(time);
|
||||
jointTransform = parentTransform.compose(jointTransform);
|
||||
parent = parent.get().getParent();
|
||||
}
|
||||
return Optional.of(jointTransform);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue