fix particles normals

This commit is contained in:
MihailRis 2025-07-07 20:42:30 +03:00
parent 7a98f0c411
commit a585b52aa2
4 changed files with 33 additions and 30 deletions

View file

@ -86,6 +86,7 @@ public:
const glm::vec3& pos,
const glm::vec3& right,
const glm::vec3& up,
const glm::vec3& normal,
const glm::vec2& size,
const glm::vec4& light,
const glm::vec3& tint,
@ -97,21 +98,21 @@ public:
{subregion.u1, subregion.v1},
light,
tint,
glm::cross(up, right)
normal
);
vertex(
pos + right * size.x * 0.5f - up * size.y * 0.5f,
{subregion.u2, subregion.v1},
light,
tint,
glm::cross(up, right)
normal
);
vertex(
pos + right * size.x * 0.5f + up * size.y * 0.5f,
{subregion.u2, subregion.v2},
light,
tint,
glm::cross(up, right)
normal
);
vertex(
@ -119,21 +120,21 @@ public:
{subregion.u1, subregion.v1},
light,
tint,
glm::cross(up, right)
normal
);
vertex(
pos + right * size.x * 0.5f + up * size.y * 0.5f,
{subregion.u2, subregion.v2},
light,
tint,
glm::cross(up, right)
normal
);
vertex(
pos - right * size.x * 0.5f + up * size.y * 0.5f,
{subregion.u1, subregion.v2},
light,
tint,
glm::cross(up, right)
normal
);
}