mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
out of bounds in normals calculation
This commit is contained in:
@@ -206,8 +206,14 @@ void TGroundNode::InitNormals()
|
|||||||
}
|
}
|
||||||
if (Vertices[i].Normal == vector3(0, 0, 0))
|
if (Vertices[i].Normal == vector3(0, 0, 0))
|
||||||
Vertices[i].Normal = (n1 + n2) / 2;
|
Vertices[i].Normal = (n1 + n2) / 2;
|
||||||
|
if (i + 1 < iNumVerts)
|
||||||
|
{
|
||||||
if (Vertices[i + 1].Normal == vector3(0, 0, 0))
|
if (Vertices[i + 1].Normal == vector3(0, 0, 0))
|
||||||
Vertices[i + 1].Normal = n2;
|
Vertices[i + 1].Normal = n2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
WriteLog("odd number of vertices, normals may be wrong!");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case GL_TRIANGLE_FAN:
|
case GL_TRIANGLE_FAN:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user