You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Fix normals computation at the 'seam' of smoothed torus shape
This commit is contained in:
@@ -1530,6 +1530,9 @@ CSGBrush *CSGTorus3D::_build_brush() {
|
|||||||
for (int i = 0; i < sides; i++) {
|
for (int i = 0; i < sides; i++) {
|
||||||
float inci = float(i) / sides;
|
float inci = float(i) / sides;
|
||||||
float inci_n = float((i + 1)) / sides;
|
float inci_n = float((i + 1)) / sides;
|
||||||
|
if (i == sides - 1) {
|
||||||
|
inci_n = 0;
|
||||||
|
}
|
||||||
|
|
||||||
float angi = inci * Math_TAU;
|
float angi = inci * Math_TAU;
|
||||||
float angi_n = inci_n * Math_TAU;
|
float angi_n = inci_n * Math_TAU;
|
||||||
@@ -1540,6 +1543,9 @@ CSGBrush *CSGTorus3D::_build_brush() {
|
|||||||
for (int j = 0; j < ring_sides; j++) {
|
for (int j = 0; j < ring_sides; j++) {
|
||||||
float incj = float(j) / ring_sides;
|
float incj = float(j) / ring_sides;
|
||||||
float incj_n = float((j + 1)) / ring_sides;
|
float incj_n = float((j + 1)) / ring_sides;
|
||||||
|
if (j == ring_sides - 1) {
|
||||||
|
incj_n = 0;
|
||||||
|
}
|
||||||
|
|
||||||
float angj = incj * Math_TAU;
|
float angj = incj * Math_TAU;
|
||||||
float angj_n = incj_n * Math_TAU;
|
float angj_n = incj_n * Math_TAU;
|
||||||
|
|||||||
Reference in New Issue
Block a user