Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_view3d/view3d_gizmo_navigate_type.c
| Context not available. | |||||
| bool ok = true; | bool ok = true; | ||||
| /* skip view align axis */ | /* skip view align axis */ | ||||
| if ((axis_align == axis) && (gz->matrix_offset[axis][2] > 0.0f) == is_pos) { | if ((axis_align == axis) && (gz->matrix_offset[axis][2] < 0.0f) && !is_pos) { | ||||
| ok = false; | ok = false; | ||||
| } | } | ||||
| if (ok) { | if (ok) { | ||||
| Context not available. | |||||
| float color_current_fade[4]; | float color_current_fade[4]; | ||||
| copy_v4_v4(color_current_fade, color_current); | copy_v4_v4(color_current_fade, color_current); | ||||
| color_current_fade[3] *= 0.2; | color_current_fade[3] *= 0.2; | ||||
| bool in_front = (gz->matrix_offset[axis][2] >= -0.01f) == is_pos; | |||||
| /* Axis Line. */ | /* Axis Line. */ | ||||
| if (is_pos) { | if (is_pos) { | ||||
| float v_start[3]; | float v_start[3]; | ||||
| GPU_line_width(2.0f); | GPU_line_width(2.0f); | ||||
| immUniformColor4fv(color_current); | immUniformColor4fv(in_front ? color_current : color_current_fade); | ||||
| immBegin(GPU_PRIM_LINES, 2); | immBegin(GPU_PRIM_LINES, 2); | ||||
| if (axis_align == -1) { | if (axis_align == -1) { | ||||
| zero_v3(v_start); | zero_v3(v_start); | ||||
| Context not available. | |||||
| GPUBatch *sphere = GPU_batch_preset_sphere(0); | GPUBatch *sphere = GPU_batch_preset_sphere(0); | ||||
| GPU_batch_program_set_builtin(sphere, GPU_SHADER_3D_UNIFORM_COLOR); | GPU_batch_program_set_builtin(sphere, GPU_SHADER_3D_UNIFORM_COLOR); | ||||
| GPU_batch_uniform_4fv(sphere, "color", is_pos ? color_current : color_current_fade); | GPU_batch_uniform_4fv(sphere, "color", in_front ? color_current : color_current_fade); | ||||
| GPU_batch_draw(sphere); | GPU_batch_draw(sphere); | ||||
| GPU_matrix_pop(); | GPU_matrix_pop(); | ||||
| } | } | ||||
| Context not available. | |||||