Custom Animations should now work. We also save color values if there's no texture.

This commit is contained in:
antc13
2016-01-24 13:28:40 +01:00
parent 3baa988ad4
commit b5b1140f5c
11 changed files with 341 additions and 28 deletions
+3 -3
View File
@@ -21,7 +21,7 @@ void DrawFinalPass::InitializeShaderPrograms()
m_ForwardPlusProgram->Compile();
m_ForwardPlusProgram->Link();
}
static double tempTime = 0.0;
void DrawFinalPass::Draw(RenderScene& scene)
{
GLERROR("DrawFinalPass::Draw: Pre");
@@ -53,14 +53,14 @@ void DrawFinalPass::Draw(RenderScene& scene)
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, m_WhiteTexture->m_Texture);
}
tempTime += 0.01f;
//TODO: Fixa så att modelsJobs kan spela upp olika animationer och så att den kan få in en tid istället för 1.0f - Hälsningar Johan och Andreas :)
if (modelJob->Model->m_RawModel->m_Skeleton != nullptr) {
auto animation = modelJob->Model->m_RawModel->m_Skeleton->GetAnimation("running");
if (animation != nullptr) {
std::vector<glm::mat4> frameBones = modelJob->Model->m_RawModel->m_Skeleton->GetFrameBones(
*animation,
1.0f
tempTime
);
glUniformMatrix4fv(glGetUniformLocation(shaderHandle, "Bones"), frameBones.size(), GL_FALSE, glm::value_ptr(frameBones[0]));
}