Fixed BoneAttachment offset rotation
This commit is contained in:
@@ -127,7 +127,6 @@ void AnimationSystem::UpdateAnimations(double dt)
|
||||
void AnimationSystem::UpdateWeights(double dt)
|
||||
{
|
||||
for (auto it = m_AutoBlendQueues.begin(); it != m_AutoBlendQueues.end(); ) {
|
||||
it->second.PrintQueue();
|
||||
if(it->second.HasActiveBlendJob()) {
|
||||
AutoBlendQueue::AutoBlendJob& blendJob = it->second.GetActiveBlendJob();
|
||||
|
||||
@@ -152,7 +151,6 @@ void AnimationSystem::UpdateWeights(double dt)
|
||||
}
|
||||
}
|
||||
}
|
||||
LOG_INFO("");
|
||||
}
|
||||
|
||||
bool AnimationSystem::OnAutoAnimationBlend(Events::AutoAnimationBlend& e)
|
||||
|
||||
@@ -49,14 +49,19 @@ void BoneAttachmentSystem::UpdateComponent(EntityWrapper& entity, ComponentWrapp
|
||||
glm::vec3 skew;
|
||||
glm::vec4 perspective;
|
||||
glm::decompose(boneTransform, scale, rotation, translation, skew, perspective);
|
||||
|
||||
glm::vec3 angles = glm::vec3(-glm::pitch(rotation), -glm::yaw(rotation), -glm::roll(rotation));
|
||||
|
||||
|
||||
|
||||
rotation = rotation * glm::quat((glm::vec3)entity["BoneAttachment"]["OrientationOffset"]);
|
||||
|
||||
rotation.w = -rotation.w;
|
||||
glm::vec3 angles = glm::eulerAngles(rotation);
|
||||
|
||||
if ((bool)entity["BoneAttachment"]["InheritPosition"]) {
|
||||
(glm::vec3&)entity["Transform"]["Position"] = translation + (glm::vec3)entity["BoneAttachment"]["PositionOffset"];
|
||||
}
|
||||
if ((bool)entity["BoneAttachment"]["InheritOrientation"]) {
|
||||
(glm::vec3&)entity["Transform"]["Orientation"] = angles + (glm::vec3)entity["BoneAttachment"]["OrientationOffset"];
|
||||
(glm::vec3&)entity["Transform"]["Orientation"] = angles;
|
||||
}
|
||||
if ((bool)entity["BoneAttachment"]["InheritScale"]) {
|
||||
(glm::vec3&)entity["Transform"]["Scale"] = scale * (glm::vec3)entity["BoneAttachment"]["ScaleOffset"];
|
||||
|
||||
@@ -444,18 +444,18 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
EntityWrapper dashEffectModel;
|
||||
dashEffectModel = playerModel.Clone();
|
||||
player["Transform"].Copy(dashEffectModel["Transform"]);
|
||||
|
||||
|
||||
/* dashEffectModel.AttachComponent("ExplosionEffect");
|
||||
dashEffectModel.AttachComponent("ExplosionEffect");
|
||||
dashEffectModel["ExplosionEffect"]["EndColor"] = (glm::vec4)playerModel["Model"]["Color"];
|
||||
((glm::vec4&)dashEffectModel["ExplosionEffect"]["EndColor"]).w = 0.f;
|
||||
(double&)dashEffectModel["ExplosionEffect"]["ExplosionDuration"] = dashEffect["Lifetime"]["Lifetime"];
|
||||
(glm::vec3&)dashEffectModel["ExplosionEffect"]["ExplosionOrigin"] = glm::vec3(0, 1, 0) + (0.2f * controller->Movement());
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -464,7 +464,9 @@ bool PlayerMovementSystem::OnDashAbility(Events::DashAbility & e)
|
||||
for (auto animationEntity : animationChildren) {
|
||||
(bool&)animationEntity["Animation"]["Play"] = false;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user