diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-08-13 15:13:55 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-08-14 21:40:04 +0300 |
commit | 89a2cb9297379bd952033bd4f536a38c47fb760e (patch) | |
tree | a01fc000860b46d6df4abe47e269154ea6f0c1e1 | |
parent | c81c5358ac72883b459bcba224f04cc692933737 (diff) |
DRW: Debug: Fix drw_debug_sphere not positioning and scaling the sphere
It was an oversight.
-rw-r--r-- | source/blender/draw/intern/shaders/common_debug_draw_lib.glsl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/draw/intern/shaders/common_debug_draw_lib.glsl b/source/blender/draw/intern/shaders/common_debug_draw_lib.glsl index 7a79f957462..6e5a6cf0398 100644 --- a/source/blender/draw/intern/shaders/common_debug_draw_lib.glsl +++ b/source/blender/draw/intern/shaders/common_debug_draw_lib.glsl @@ -148,14 +148,14 @@ void drw_debug_sphere(vec3 p, float radius, vec4 color) for (int axis = 0; axis < 3; axis++) { for (int edge = 0; edge < circle_resolution; edge++) { float angle1 = (2.0 * 3.141592) * float(edge + 0) / float(circle_resolution); - vec3 p1 = vec3(cos(angle1), sin(angle1), 0.0); + vec3 p1 = vec3(cos(angle1), sin(angle1), 0.0) * radius; p1 = vec3(p1[(0 + axis) % 3], p1[(1 + axis) % 3], p1[(2 + axis) % 3]); float angle2 = (2.0 * 3.141592) * float(edge + 1) / float(circle_resolution); - vec3 p2 = vec3(cos(angle2), sin(angle2), 0.0); + vec3 p2 = vec3(cos(angle2), sin(angle2), 0.0) * radius; p2 = vec3(p2[(0 + axis) % 3], p2[(1 + axis) % 3], p2[(2 + axis) % 3]); - drw_debug_line(vertid, p1, p2, pcolor); + drw_debug_line(vertid, p + p1, p + p2, pcolor); } } } |