This commit is contained in:
2026-10-18 12:57:14 -04:00
parent e1337c2560
commit ac982a2b21
4 changed files with 15 additions and 2 deletions
+8 -1
View File
@@ -48,6 +48,11 @@ Character::Character() {
void Character::Render(Shader& shader) {
if (!body || !body->rig || !body->animator) return;
if (skin) {
glActiveTexture(GL_TEXTURE1);
glBindTexture(GL_TEXTURE_2D, skin->ID);
shader.SetInt("tex", 1);
}
if (body->animator->m_CurrentAnimation == nullptr) {
for (int i = 0; i < 100; i++)
shader.SetMat4(("finalBonesMatrices[" + std::to_string(i) + "]").c_str(), glm::mat4(1.0f));
@@ -58,5 +63,7 @@ void Character::Render(Shader& shader) {
for (int i = 0; i < transforms.size(); i++)
shader.SetMat4(("finalBonesMatrices[" + std::to_string(i) + "]").c_str(), transforms[i]);
}
body->rig->Render(shader, body->t.GetTranslationMatrix() * body->t.GetRotationMatrix());
// body->t's scale is the hitbox only; the rig is drawn at visualScale so it fills that hitbox
body->rig->Render(shader, body->t.GetTranslationMatrix() * body->t.GetRotationMatrix()
* glm::scale(glm::mat4(1.0f), glm::vec3(visualScale)));
}