Set new type of animation
This commit is contained in:
1 parent
52c4ad8ee0
commit
4d9a5b0a6e
49 files changed
+684419
-64
No files matched your search
+24
-22
@@ -315,10 +315,14 @@ void Character::draw(Renderer& renderer) {
|
||||
renderer.RotateMatrix(modelCorrectionRotation.toRotationMatrix());
|
||||
|
||||
auto& anim = it->second;
|
||||
modelMutable.AssignFrom(anim.model.mesh);
|
||||
modelMutable.RefreshVBO();
|
||||
glBindTexture(GL_TEXTURE_2D, texture->getTexID());
|
||||
renderer.DrawVertexRenderStruct(modelMutable);
|
||||
for (const auto& name : anim.model.meshNamesOrdered) {
|
||||
auto mit = anim.model.meshes.find(name);
|
||||
if (mit == anim.model.meshes.end()) continue;
|
||||
modelMutable.AssignFrom(mit->second.mesh);
|
||||
modelMutable.RefreshVBO();
|
||||
renderer.DrawVertexRenderStruct(modelMutable);
|
||||
}
|
||||
|
||||
renderer.PopMatrix();
|
||||
|
||||
@@ -370,17 +374,7 @@ void Character::drawGpuSkinning(Renderer& renderer) {
|
||||
|
||||
glBindTexture(GL_TEXTURE_2D, texture->getTexID());
|
||||
|
||||
// Bind VAO (desktop only)
|
||||
#ifndef EMSCRIPTEN
|
||||
#ifndef __ANDROID__
|
||||
if (anim.gpuSkinningShaderData.bindPoseMutable.vao) {
|
||||
glBindVertexArray(anim.gpuSkinningShaderData.bindPoseMutable.vao->getBuffer());
|
||||
renderer.shaderManager.EnableVertexAttribArrays();
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
anim.gpuSkinningShaderData.RenderVBO(renderer);
|
||||
anim.gpuSkinningShaderData.RenderVBO(renderer, anim.model.meshNamesOrdered);
|
||||
|
||||
renderer.PopMatrix();
|
||||
|
||||
@@ -477,9 +471,13 @@ void Character::drawShadowDepthCpu(Renderer& renderer) {
|
||||
renderer.RotateMatrix(modelCorrectionRotation.toRotationMatrix());
|
||||
|
||||
auto& anim = it->second;
|
||||
modelMutable.AssignFrom(anim.model.mesh);
|
||||
modelMutable.RefreshVBO();
|
||||
renderer.DrawVertexRenderStruct(modelMutable);
|
||||
for (const auto& name : anim.model.meshNamesOrdered) {
|
||||
auto mit = anim.model.meshes.find(name);
|
||||
if (mit == anim.model.meshes.end()) continue;
|
||||
modelMutable.AssignFrom(mit->second.mesh);
|
||||
modelMutable.RefreshVBO();
|
||||
renderer.DrawVertexRenderStruct(modelMutable);
|
||||
}
|
||||
renderer.PopMatrix();
|
||||
|
||||
drawAttachedWeapon(renderer);
|
||||
@@ -516,7 +514,7 @@ void Character::drawShadowDepthGpuSkinning(Renderer& renderer) {
|
||||
it->second.gpuSkinningShaderData.skinningMatrices[0].data());
|
||||
|
||||
CheckGlError(__FILE__, __LINE__);
|
||||
it->second.gpuSkinningShaderData.RenderVBO(renderer);
|
||||
it->second.gpuSkinningShaderData.RenderVBO(renderer, it->second.model.meshNamesOrdered);
|
||||
|
||||
CheckGlError(__FILE__, __LINE__);
|
||||
renderer.PopMatrix();
|
||||
@@ -565,10 +563,14 @@ void Character::drawCpuWithShadow(Renderer& renderer, const Eigen::Matrix4f& lig
|
||||
renderer.RotateMatrix(modelCorrectionRotation.toRotationMatrix());
|
||||
|
||||
auto& anim = it->second;
|
||||
modelMutable.AssignFrom(anim.model.mesh);
|
||||
modelMutable.RefreshVBO();
|
||||
glBindTexture(GL_TEXTURE_2D, texture->getTexID());
|
||||
renderer.DrawVertexRenderStruct(modelMutable);
|
||||
for (const auto& name : anim.model.meshNamesOrdered) {
|
||||
auto mit = anim.model.meshes.find(name);
|
||||
if (mit == anim.model.meshes.end()) continue;
|
||||
modelMutable.AssignFrom(mit->second.mesh);
|
||||
modelMutable.RefreshVBO();
|
||||
renderer.DrawVertexRenderStruct(modelMutable);
|
||||
}
|
||||
|
||||
renderer.PopMatrix();
|
||||
|
||||
@@ -628,7 +630,7 @@ void Character::drawGpuSkinningWithShadow(Renderer& renderer, const Eigen::Matri
|
||||
glBindTexture(GL_TEXTURE_2D, texture->getTexID());
|
||||
|
||||
CheckGlError(__FILE__, __LINE__);
|
||||
it->second.gpuSkinningShaderData.RenderVBO(renderer);
|
||||
it->second.gpuSkinningShaderData.RenderVBO(renderer, it->second.model.meshNamesOrdered);
|
||||
|
||||
renderer.PopMatrix();
|
||||
|
||||
|
||||
Reference in new issue
Block a user