From 69d5de632e04d48a247d50c1dc2c09322129c73a Mon Sep 17 00:00:00 2001 From: "Andrii Doroshenko (Xrayez)" Date: Mon, 25 May 2020 20:20:45 +0300 Subject: Split `Geometry` singleton into `Geometry2D` and `Geometry3D` Extra `_2d` suffixes are removed from 2D methods accoringly. --- servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp | 2 +- servers/rendering/rendering_server_canvas.cpp | 4 +++- servers/rendering/rendering_server_scene.h | 1 - 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'servers/rendering') diff --git a/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp index 4f216d7cb5..a5151d1ff8 100644 --- a/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp +++ b/servers/rendering/rasterizer_rd/rasterizer_storage_rd.cpp @@ -4295,7 +4295,7 @@ void RasterizerStorageRD::lightmap_tap_sh_light(RID p_lightmap, const Vector3 &p uint32_t *tetrahedron = (uint32_t *)&lm->tetrahedra[node * 4]; Vector3 points[4] = { lm->points[tetrahedron[0]], lm->points[tetrahedron[1]], lm->points[tetrahedron[2]], lm->points[tetrahedron[3]] }; const Color *sh_colors[4]{ &lm->point_sh[tetrahedron[0] * 9], &lm->point_sh[tetrahedron[1] * 9], &lm->point_sh[tetrahedron[2] * 9], &lm->point_sh[tetrahedron[3] * 9] }; - Color barycentric = Geometry::tetrahedron_get_barycentric_coords(points[0], points[1], points[2], points[3], p_point); + Color barycentric = Geometry3D::tetrahedron_get_barycentric_coords(points[0], points[1], points[2], points[3], p_point); for (int i = 0; i < 4; i++) { float c = CLAMP(barycentric[i], 0.0, 1.0); diff --git a/servers/rendering/rendering_server_canvas.cpp b/servers/rendering/rendering_server_canvas.cpp index 0c9290a765..5c0741bb3b 100644 --- a/servers/rendering/rendering_server_canvas.cpp +++ b/servers/rendering/rendering_server_canvas.cpp @@ -29,6 +29,8 @@ /*************************************************************************/ #include "rendering_server_canvas.h" + +#include "core/math/geometry_2d.h" #include "rendering_server_globals.h" #include "rendering_server_raster.h" #include "rendering_server_viewport.h" @@ -774,7 +776,7 @@ void RenderingServerCanvas::canvas_item_add_polygon(RID p_item, const Vector indices = Geometry::triangulate_polygon(p_points); + Vector indices = Geometry2D::triangulate_polygon(p_points); ERR_FAIL_COND_MSG(indices.empty(), "Invalid polygon data, triangulation failed."); Item::CommandPolygon *polygon = canvas_item->alloc_command(); diff --git a/servers/rendering/rendering_server_scene.h b/servers/rendering/rendering_server_scene.h index f59028603f..f2e2918f21 100644 --- a/servers/rendering/rendering_server_scene.h +++ b/servers/rendering/rendering_server_scene.h @@ -33,7 +33,6 @@ #include "servers/rendering/rasterizer.h" -#include "core/math/geometry.h" #include "core/math/octree.h" #include "core/os/semaphore.h" #include "core/os/thread.h" -- cgit v1.2.3