You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-10 13:00:37 +00:00
Fix CSG vertex normal calculation.
This commit is contained in:
@@ -296,7 +296,6 @@ void CSGShape::_update_shape() {
|
|||||||
int mat = n->faces[i].material;
|
int mat = n->faces[i].material;
|
||||||
ERR_CONTINUE(mat < -1 || mat >= face_count.size());
|
ERR_CONTINUE(mat < -1 || mat >= face_count.size());
|
||||||
int idx = mat == -1 ? face_count.size() - 1 : mat;
|
int idx = mat == -1 ? face_count.size() - 1 : mat;
|
||||||
if (n->faces[i].smooth) {
|
|
||||||
|
|
||||||
Plane p(n->faces[i].vertices[0], n->faces[i].vertices[1], n->faces[i].vertices[2]);
|
Plane p(n->faces[i].vertices[0], n->faces[i].vertices[1], n->faces[i].vertices[2]);
|
||||||
|
|
||||||
@@ -310,7 +309,6 @@ void CSGShape::_update_shape() {
|
|||||||
}
|
}
|
||||||
vec_map.set(v, add);
|
vec_map.set(v, add);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
face_count.write[idx]++;
|
face_count.write[idx]++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user