AutoAnimationBlend now working correctly for unique nodes

This commit is contained in:
viktorljung
2016-03-02 17:06:51 +01:00
parent 8422742a9e
commit 1aefa1dec6
9 changed files with 240 additions and 309 deletions
@@ -50,6 +50,19 @@ void BoneAttachmentSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapp
glm::vec4 perspective;
glm::decompose(boneTransform, scale, rotation, translation, skew, perspective);
float lowRange = 0.98f;
float highRange = 1.02f;
if(scale.x < lowRange || scale.y < lowRange || scale.z < lowRange ||
scale.x > highRange || scale.y > highRange || scale.z > highRange) {
if (entity.HasComponent("Model")) {
(glm::vec4&)entity["Model"]["Color"] = glm::vec4(1, 0, 0, 1);
}
} else {
if (entity.HasComponent("Model")) {
(glm::vec4&)entity["Model"]["Color"] = glm::vec4(0, 1, 0, 1);
}
}
glm::vec3 angles = glm::vec3(-glm::pitch(rotation), -glm::yaw(rotation), -glm::roll(rotation));
if ((bool)entity["BoneAttachment"]["InheritPosition"]) {