Different animations can now be played on multiple meshes, AnimationOffset seems to make the lighting buggy
This commit is contained in:
@@ -54,32 +54,5 @@ void AnimationSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapper& a
|
||||
(double&)animationComponent["Time" + std::to_string(i)] = nextTime;
|
||||
}
|
||||
}
|
||||
|
||||
//Calculate bone transforms
|
||||
if (skeleton != nullptr) {
|
||||
std::vector<Skeleton::AnimationData> animations;
|
||||
if (entity.HasComponent("Animation")) {
|
||||
for (int i = 1; i <= 3; i++) {
|
||||
Skeleton::AnimationData animationData;
|
||||
animationData.animation = model->m_RawModel->m_Skeleton->GetAnimation(entity["Animation"]["AnimationName" + std::to_string(i)]);
|
||||
if (animationData.animation == nullptr) {
|
||||
continue;
|
||||
}
|
||||
animationData.time = (double)entity["Animation"]["Time" + std::to_string(i)];
|
||||
animationData.weight = (double)entity["Animation"]["Weight" + std::to_string(i)];
|
||||
|
||||
animations.push_back(animationData);
|
||||
}
|
||||
}
|
||||
|
||||
if (entity.HasComponent("AnimationOffset")) {
|
||||
Skeleton::AnimationOffset animationOffset;
|
||||
animationOffset.animation = skeleton->GetAnimation(entity["AnimationOffset"]["AnimationName"]);
|
||||
animationOffset.time = (double)entity["AnimationOffset"]["Time"];
|
||||
skeleton->CalculateFrameBones(animations, animationOffset);
|
||||
} else {
|
||||
skeleton->CalculateFrameBones(animations);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user