small optimizations with Triangle.cpp (normal vector calculated once in constructor)
parent
435db3ad0e
commit
389936268a
|
@ -177,8 +177,7 @@ GLfloat *Screen::glMeshToGLfloatArray(std::shared_ptr<Mesh> mesh) {
|
||||||
int stride = 21 * i;
|
int stride = 21 * i;
|
||||||
|
|
||||||
Triangle triangle = triangles[i];
|
Triangle triangle = triangles[i];
|
||||||
Vec3D norm = triangles[i].norm();
|
float dot = static_cast<float>(triangle.norm().dot(Vec3D(0, 0.5, 1)));
|
||||||
float dot = norm.dot(Vec3D(2, 1, 0).normalized());
|
|
||||||
|
|
||||||
for (int k = 0; k < 3; k++) {
|
for (int k = 0; k < 3; k++) {
|
||||||
sf::Color color = triangle.color();
|
sf::Color color = triangle.color();
|
||||||
|
|
Loading…
Reference in New Issue