Fixed joint hierarchy not being used fully in the animation system.
This commit is contained in:
parent
d30aae862f
commit
babd54bb87
1 changed files with 9 additions and 3 deletions
|
@ -282,11 +282,17 @@ public final class Clips
|
||||||
return Optional.absent();
|
return Optional.absent();
|
||||||
}
|
}
|
||||||
IJoint joint = (IJoint)part.get();
|
IJoint joint = (IJoint)part.get();
|
||||||
if(!joint.getParent().isPresent())
|
TRSRTransformation jointTransform = clip.apply(joint).apply(time).compose(joint.getInvBindPose());
|
||||||
|
Optional<TRSRTransformation> parentTransform = Optional.absent();
|
||||||
|
if(joint.getParent().isPresent())
|
||||||
{
|
{
|
||||||
return Optional.of(clip.apply(joint).apply(time).compose(joint.getInvBindPose()));
|
parentTransform = apply(Optional.of(joint.getParent().get()));
|
||||||
}
|
}
|
||||||
return Optional.of(clip.apply(joint.getParent().get()).apply(time).compose(clip.apply(joint).apply(time)).compose(joint.getInvBindPose()));
|
if(parentTransform.isPresent())
|
||||||
|
{
|
||||||
|
jointTransform = parentTransform.get().compose(jointTransform);
|
||||||
|
}
|
||||||
|
return Optional.of(jointTransform);
|
||||||
}
|
}
|
||||||
}, clip.pastEvents(lastPollTime, time));
|
}, clip.pastEvents(lastPollTime, time));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue