Add Get Center Method for Rect2/Rect2i and AABB.

This commit is contained in:
Anilforextra 2021-09-21 00:33:52 +05:45
parent 87de2e7c4a
commit 90908cd67d
33 changed files with 133 additions and 56 deletions

View file

@ -1621,7 +1621,7 @@ void RendererCanvasRenderRD::light_update_directional_shadow(RID p_rid, int p_sh
Vector2 light_dir = p_light_xform.elements[1].normalized();
Vector2 center = p_clip_rect.position + p_clip_rect.size * 0.5;
Vector2 center = p_clip_rect.get_center();
float to_edge_distance = ABS(light_dir.dot(p_clip_rect.get_support(light_dir)) - light_dir.dot(center));