Skip to content

Commit 2e9441b

Browse files
committed
refactor surface
1 parent 32c722b commit 2e9441b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

Model-Modifier/src/scene/surface/Surface.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ glm::vec3 Surface::ComputeFaceNormal(FaceRecord face)
130130
glm::vec3 pos0 = m_Vertices[face.verticesIdx[0]].position;
131131
glm::vec3 pos1 = m_Vertices[face.verticesIdx[1]].position;
132132
glm::vec3 pos2 = m_Vertices[face.verticesIdx[2]].position;
133-
return glm::normalize(glm::cross(pos1 - pos0, pos2 - pos0));
133+
return ComputeFaceNormal(pos0, pos1, pos2);
134134
}
135135

136136
glm::vec3 Surface::ComputeFaceNormal(glm::vec3 pos0, glm::vec3 pos1, glm::vec3 pos2)

Model-Modifier/src/scene/surface/Surface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

3+
#include <set>
34
#include <vector>
45
#include <unordered_map>
5-
#include <set>
66

77
#include "../../external/glm/ext/vector_float3.hpp"
88
#include "../../external/glm/ext/vector_uint2.hpp"

Model-Modifier/src/scene/surface/Surface_Loop.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ Object Surface::Loop()
7474
}
7575

7676
// update old (even) vertices (per vertex)
77-
for (unsigned int i = 0; i < m_Vertices.size(); i++)
77+
unsigned int numVertices = static_cast<unsigned int>(m_Vertices.size());
78+
for (unsigned int i = 0; i < numVertices; i++)
7879
{
7980
VertexRecord vert = m_Vertices[i];
8081
glm::vec3 vertPos = vert.position;

0 commit comments

Comments
 (0)