last onewfds

This commit is contained in:
2026-10-18 14:24:36 -04:00
parent fbe079559a
commit d365763209
4 changed files with 6 additions and 3 deletions
+4 -3
View File
@@ -128,7 +128,6 @@ void Engine::Initiate()
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
Font* arial = new Font("assets/ft/arial.ttf"); Font* arial = new Font("assets/ft/arial.ttf");
Texture* blanktex = new Texture("assets/blanktexture.png"); Texture* blanktex = new Texture("assets/blanktexture.png");
Texture* blacktex = new Texture("assets/blacktexture.png");
Texture* magic = new Texture("assets/itsmagicbitch.jpg"); Texture* magic = new Texture("assets/itsmagicbitch.jpg");
Texture* snowflake = new Texture("assets/snowflake.png"); Texture* snowflake = new Texture("assets/snowflake.png");
Texture* shockwavetex = new Texture("assets/shockwave.png"); Texture* shockwavetex = new Texture("assets/shockwave.png");
@@ -472,7 +471,8 @@ void Engine::Initiate()
glm::vec3 grappleLineEnd(0.0f); glm::vec3 grappleLineEnd(0.0f);
Mesh* grappleLine = CreateCubeMesh(); Mesh* grappleLine = CreateCubeMesh();
grappleLine->name = "grappleline"; grappleLine->name = "grappleline";
grappleLine->meshTexture = blacktex; grappleLine->meshTexture = blanktex;
grappleLine->colorOverride = glm::vec4(0.0f, 0.0f, 0.0f, 1.0f); // black
grappleLine->t.TranslateTo({ 0.0f, -1000.0f, 0.0f }); // hidden until a grapple latches grappleLine->t.TranslateTo({ 0.0f, -1000.0f, 0.0f }); // hidden until a grapple latches
grappleLine->BindToRenderSystem(); grappleLine->BindToRenderSystem();
mainf->AddChild(grappleLine); mainf->AddChild(grappleLine);
@@ -1034,7 +1034,8 @@ void Engine::Initiate()
if (len > 0.01f) { if (len > 0.01f) {
grappleLine->t.TranslateTo(handPos + delta * 0.5f); grappleLine->t.TranslateTo(handPos + delta * 0.5f);
grappleLine->t.ScaleTo({ 0.05f, 0.05f, len }); grappleLine->t.ScaleTo({ 0.05f, 0.05f, len });
grappleLine->t.RotateToQuaternion(LookAt(delta)); // Plain shortest-arc rotation of the box's long (z) axis onto the rope; LookAt breaks on straight up/down
grappleLine->t.RotateToQuaternion(RotationBetweenVectors(glm::vec3(0.0f, 0.0f, 1.0f), delta));
} }
} }
else grappleLine->t.TranslateTo(hiddenPos); else grappleLine->t.TranslateTo(hiddenPos);
+2
View File
@@ -37,6 +37,7 @@ class Mesh : public Object , public Renderable, public t_package , public MeshDa
protected: protected:
public: public:
Texture* meshTexture = nullptr; Texture* meshTexture = nullptr;
glm::vec4 colorOverride = glm::vec4(0.0f); // rgb + strength; 0 = use the texture's own colour
VAO vao; VAO vao;
VBO vbo; VBO vbo;
@@ -469,6 +470,7 @@ public:
else glBindTexture(GL_TEXTURE_2D, 0); else glBindTexture(GL_TEXTURE_2D, 0);
ShaderProgram.SetMat4("modl", topass); ShaderProgram.SetMat4("modl", topass);
ShaderProgram.Set4F("colorOverride", colorOverride);
vao.Bind(); vao.Bind();
glDrawElements(GL_TRIANGLES, indices.size(), GL_UNSIGNED_INT, 0); glDrawElements(GL_TRIANGLES, indices.size(), GL_UNSIGNED_INT, 0);
vao.Unbind(); vao.Unbind();
Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 B

After

Width:  |  Height:  |  Size: 686 B