This commit is contained in:
2026-10-18 13:02:29 -04:00
parent ac982a2b21
commit a65e3d4f24
5 changed files with 7 additions and 10 deletions
+2 -5
View File
@@ -48,11 +48,6 @@ 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));
@@ -63,7 +58,9 @@ void Character::Render(Shader& shader) {
for (int i = 0; i < transforms.size(); i++)
shader.SetMat4(("finalBonesMatrices[" + std::to_string(i) + "]").c_str(), transforms[i]);
}
shader.Set4F("colorOverride", colorOverride);
// 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)));
shader.Set4F("colorOverride", glm::vec4(0.0f)); // don't leak into other rig draws
}