Skip to content

Commit

Permalink
set normal to 0 if somehow quad doesn't have normal data
Browse files Browse the repository at this point in the history
  • Loading branch information
Luna0x01 committed Dec 30, 2024
1 parent 8535653 commit 114b956
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,13 @@ default int calculateNormal() {
* @return the per-vertex normal if it is set, otherwise the face normal.
*/
default int getAccurateNormal(int i) {
int normal = getVertexNormal(i);
int normal;

try {
normal = getVertexNormal(i);
} catch (final Exception e) {
normal = 0;
}

return normal == 0 ? getFaceNormal() : normal;
}
Expand Down

0 comments on commit 114b956

Please sign in to comment.