|
Blender
V2.93
|
#include "gpu_context_private.hh"#include "gpu_matrix_private.h"#include "GPU_matrix.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_math_vector.h"#include "MEM_guardedalloc.h"Go to the source code of this file.
Classes | |
| struct | MatrixStack |
| struct | GPUMatrixState |
Macros | |
| #define | SUPPRESS_GENERIC_MATRIX_API |
| #define | USE_GPU_PY_MATRIX_API /* only so values are declared */ |
| #define | MATRIX_STACK_DEPTH 32 |
| #define | ModelViewStack Context::get()->matrix_state->model_view_stack |
| #define | ModelView ModelViewStack.stack[ModelViewStack.top] |
| #define | ProjectionStack Context::get()->matrix_state->projection_stack |
| #define | Projection ProjectionStack.stack[ProjectionStack.top] |
| #define | MATRIX_4X4_IDENTITY |
| #define | CHECKMAT(m) |
Typedefs | |
| using | Mat4 = float[4][4] |
| using | Mat3 = float[3][3] |
| #define CHECKMAT | ( | m | ) |
Definition at line 131 of file gpu_matrix.cc.
| #define MATRIX_4X4_IDENTITY |
| #define MATRIX_STACK_DEPTH 32 |
Definition at line 40 of file gpu_matrix.cc.
| #define ModelView ModelViewStack.stack[ModelViewStack.top] |
Definition at line 65 of file gpu_matrix.cc.
| #define ModelViewStack Context::get()->matrix_state->model_view_stack |
Definition at line 64 of file gpu_matrix.cc.
| #define Projection ProjectionStack.stack[ProjectionStack.top] |
Definition at line 68 of file gpu_matrix.cc.
| #define ProjectionStack Context::get()->matrix_state->projection_stack |
Definition at line 67 of file gpu_matrix.cc.
| #define SUPPRESS_GENERIC_MATRIX_API |
Definition at line 27 of file gpu_matrix.cc.
| #define USE_GPU_PY_MATRIX_API /* only so values are declared */ |
Definition at line 28 of file gpu_matrix.cc.
Definition at line 43 of file gpu_matrix.cc.
Definition at line 42 of file gpu_matrix.cc.
| BLI_STATIC_ASSERT | ( | GPU_PY_MATRIX_STACK_LEN+ | 1 = =MATRIX_STACK_DEPTH, |
| "define mismatch" | |||
| ) |
| void GPU_matrix_bind | ( | GPUShader * | shader | ) |
Definition at line 646 of file gpu_matrix.cc.
References GPU_matrix_model_view_get(), GPU_matrix_model_view_projection_get(), GPU_matrix_normal_get(), GPU_matrix_projection_get(), gpu_matrix_state_active_set_dirty(), GPU_shader_get_builtin_uniform(), GPU_shader_uniform_vector(), GPU_UNIFORM_MODELVIEW, GPU_UNIFORM_MODELVIEW_INV, GPU_UNIFORM_MVP, GPU_UNIFORM_NORMAL, GPU_UNIFORM_PROJECTION, GPU_UNIFORM_PROJECTION_INV, invert_m4(), N, P(), and shader().
Referenced by GPU_shader_bind(), and immBindShader().
| bool GPU_matrix_dirty_get | ( | void | ) |
Definition at line 690 of file gpu_matrix.cc.
References blender::gpu::Context::get(), blender::gpu::Context::matrix_state, and state.
Referenced by GPU_shader_bind().
| void GPU_matrix_frustum_set | ( | float | left, |
| float | right, | ||
| float | bottom, | ||
| float | top, | ||
| float | near, | ||
| float | far | ||
| ) |
Definition at line 438 of file gpu_matrix.cc.
References bottom, CHECKMAT, gpu_matrix_state_active_set_dirty(), left, mat4_frustum_set(), Projection, right, and top.
Referenced by GPU_matrix_perspective_set(), and view3d_winmatrix_set().
| void GPU_matrix_identity_projection_set | ( | void | ) |
Definition at line 170 of file gpu_matrix.cc.
References CHECKMAT, gpu_matrix_state_active_set_dirty(), Projection, and unit_m4().
Referenced by DRW_draw_render_loop_offscreen(), DRW_transform_none(), gpencil_render_offscreen(), GPU_viewport_stereo_composite(), playanim_toscreen(), and sequencer_draw_display_buffer().
| void GPU_matrix_identity_set | ( | void | ) |
Definition at line 184 of file gpu_matrix.cc.
References gpu_matrix_state_active_set_dirty(), ModelView, and unit_m4().
Referenced by draw_nodespace_back_pix(), DRW_draw_render_loop_offscreen(), drw_text_cache_draw_ex(), DRW_transform_none(), ED_region_pixelspace(), ED_view3d_draw_offscreen(), gizmo_ruler_draw(), gpencil_render_offscreen(), GPU_viewport_stereo_composite(), node_draw_space(), playanim_toscreen(), pygpu_matrix_load_identity(), screen_preview_draw(), sequencer_draw_display_buffer(), UI_block_draw(), UI_view2d_view_restore(), wmPartialViewport(), wmViewport(), and wmWindowViewport().
| void GPU_matrix_look_at | ( | float | eyeX, |
| float | eyeY, | ||
| float | eyeZ, | ||
| float | centerX, | ||
| float | centerY, | ||
| float | centerZ, | ||
| float | upX, | ||
| float | upY, | ||
| float | upZ | ||
| ) |
Definition at line 453 of file gpu_matrix.cc.
References GPU_matrix_mul(), GPU_matrix_translate_3f(), and mat4_look_from_origin().
Definition at line 587 of file gpu_matrix.cc.
References copy_m4_m4(), and ModelView.
Referenced by GPU_matrix_bind(), and GPU_matrix_normal_get().
Definition at line 607 of file gpu_matrix.cc.
References ModelView, mul_m4_m4m4(), and Projection.
Referenced by GPU_matrix_bind().
| void GPU_matrix_mul | ( | const float | m[4][4] | ) |
Definition at line 262 of file gpu_matrix.cc.
References CHECKMAT, gpu_matrix_state_active_set_dirty(), ModelView, and mul_m4_m4_post().
Referenced by GPU_matrix_look_at(), GPU_matrix_rotate_3fv(), GPU_matrix_scale_1f(), GPU_matrix_scale_2f(), GPU_matrix_scale_3f(), GPU_matrix_translate_2f(), and GPU_matrix_translate_3f().
Definition at line 618 of file gpu_matrix.cc.
References copy_m3_m4(), GPU_matrix_model_view_get(), invert_m3(), and transpose_m3().
Referenced by GPU_matrix_bind(), and GPU_matrix_normal_inverse_get().
Definition at line 633 of file gpu_matrix.cc.
References GPU_matrix_normal_get(), and invert_m3().
Definition at line 430 of file gpu_matrix.cc.
References bottom, CHECKMAT, gpu_matrix_state_active_set_dirty(), left, mat4_ortho_set(), right, and top.
| void GPU_matrix_ortho_set | ( | float | left, |
| float | right, | ||
| float | bottom, | ||
| float | top, | ||
| float | near, | ||
| float | far | ||
| ) |
Definition at line 415 of file gpu_matrix.cc.
References bottom, CHECKMAT, gpu_matrix_state_active_set_dirty(), left, mat4_ortho_set(), Projection, right, and top.
Referenced by playanim_gl_matrix(), view3d_winmatrix_set(), and wmOrtho2().
Definition at line 422 of file gpu_matrix.cc.
References CHECKMAT, gpu_matrix_state_active_set_dirty(), and Projection.
Referenced by gizmo_axis_draw(), and ui_draw_but_UNITVEC().
Definition at line 446 of file gpu_matrix.cc.
References GPU_matrix_frustum_set(), M_PI, and tanf.
| void GPU_matrix_pop | ( | void | ) |
Definition at line 142 of file gpu_matrix.cc.
References BLI_assert, gpu_matrix_state_active_set_dirty(), and ModelViewStack.
Referenced by arrow_draw_geom(), arrow_draw_intern(), blf_batch_draw_begin(), blf_draw_gl__end(), button2d_draw_intern(), clip_draw_grease_pencil(), clip_main_region_draw(), cursor_plane_draw(), curve_draw_stroke_3d(), dial_ghostarc_draw_helpline(), draw_distortion(), draw_fcurve(), draw_fcurve_curve_bezts(), draw_fcurve_curve_samples(), draw_fcurve_sample_control(), draw_marker_areas(), draw_marker_outline(), draw_marker_slide_zones(), draw_nodespace_back_pix(), draw_plane_marker_image(), draw_render_info(), draw_stabilization_border(), draw_tracking_tracks(), drawEdgeSlide(), drawLine(), drawPropCircle(), drawVertSlide(), DRW_draw_cursor(), DRW_draw_cursor_2d(), drw_text_cache_draw_ex(), dyntopo_detail_size_edit_draw(), ED_gizmo_draw_preset_facemap(), ed_gizmo_draw_preset_geometry(), ED_gizmotypes_dial_3d_draw_util(), ED_markers_draw(), ED_mask_draw_region(), ED_region_image_metadata_draw(), ED_view3d_draw_offscreen(), EDBM_preselect_edgering_draw(), EDBM_preselect_elem_draw(), external_draw_scene_do(), gizmo_axis_draw(), gizmo_cage2d_draw_intern(), gizmo_cage3d_draw_intern(), gizmo_primitive_draw_intern(), gizmo_ruler_draw(), gpencil_render_offscreen(), GPU_viewport_stereo_composite(), knifetool_draw(), move3d_draw_intern(), node_draw_space(), paint_cursor_cursor_draw_3d_view_brush_cursor_active(), paint_cursor_draw_3d_view_brush_cursor_inactive(), paint_draw_alpha_overlay(), paint_draw_cursor_overlay(), paint_draw_curve_cursor(), paint_draw_tex_overlay(), panel_draw_aligned_widgets(), playanim_toscreen(), pygpu_matrix_pop(), pygpu_matrix_stack_context_exit(), radial_control_paint_cursor(), radial_control_paint_tex(), region_draw_azones(), screen_preview_draw(), SCULPT_cloth_simulation_limits_draw(), SCULPT_layer_brush_height_preview_draw(), sequencer_draw_display_buffer(), timeline_cache_draw_single(), tracking_segment_knot_cb(), transform_draw_cursor_draw(), UI_block_draw(), ui_draw_but_UNITVEC(), ui_draw_pie_center(), and voxel_size_edit_draw().
| void GPU_matrix_pop_projection | ( | void | ) |
Definition at line 156 of file gpu_matrix.cc.
References BLI_assert, gpu_matrix_state_active_set_dirty(), and ProjectionStack.
Referenced by cursor_plane_draw(), draw_horizontal_scale_indicators(), draw_nodespace_back_pix(), draw_vertical_scale_indicators(), DRW_draw_render_loop_2d_ex(), ED_time_scrub_channel_search_draw(), ED_time_scrub_draw(), ED_time_scrub_draw_current_frame(), ED_view3d_draw_offscreen(), external_draw_scene_do(), gizmo_axis_draw(), gizmo_ruler_draw(), gpencil_render_offscreen(), GPU_viewport_stereo_composite(), knifetool_draw(), paint_cursor_cursor_draw_3d_view_brush_cursor_active(), paint_cursor_draw_3d_view_brush_cursor_inactive(), playanim_toscreen(), pygpu_matrix_pop_projection(), pygpu_matrix_stack_context_exit(), sequencer_draw_display_buffer(), UI_block_draw(), ui_draw_but_UNITVEC(), and view2d_draw_lines_internal().
| void GPU_matrix_project | ( | const float | world[3], |
| const float | model[4][4], | ||
| const float | proj[4][4], | ||
| const int | view[4], | ||
| float | win[3] | ||
| ) |
Definition at line 477 of file gpu_matrix.cc.
References mul_m4_v4(), mul_v3_fl(), mul_v4_m4v3(), v, view, and world.
Referenced by ED_view3d_project().
Definition at line 597 of file gpu_matrix.cc.
References copy_m4_m4(), and Projection.
Referenced by GPU_matrix_bind(), and GPU_polygon_offset().
| void GPU_matrix_projection_set | ( | const float | m[4][4] | ) |
Definition at line 177 of file gpu_matrix.cc.
References CHECKMAT, copy_m4_m4(), gpu_matrix_state_active_set_dirty(), and Projection.
Referenced by GPU_polygon_offset().
| void GPU_matrix_push | ( | void | ) |
Definition at line 135 of file gpu_matrix.cc.
References BLI_assert, copy_m4_m4(), MATRIX_STACK_DEPTH, ModelView, and ModelViewStack.
Referenced by arrow_draw_geom(), arrow_draw_intern(), blf_batch_draw_begin(), blf_draw_gl__start(), button2d_draw_intern(), clip_draw_grease_pencil(), clip_main_region_draw(), cursor_plane_draw(), curve_draw_stroke_3d(), dial_ghostarc_draw_helpline(), draw_distortion(), draw_fcurve(), draw_fcurve_curve_bezts(), draw_fcurve_curve_samples(), draw_fcurve_sample_control(), draw_marker_areas(), draw_marker_outline(), draw_marker_slide_zones(), draw_nodespace_back_pix(), draw_plane_marker_image(), draw_render_info(), draw_stabilization_border(), draw_tracking_tracks(), drawEdgeSlide(), drawLine(), drawPropCircle(), drawVertSlide(), DRW_draw_cursor(), DRW_draw_cursor_2d(), drw_text_cache_draw_ex(), dyntopo_detail_size_edit_draw(), ED_gizmo_draw_preset_facemap(), ed_gizmo_draw_preset_geometry(), ED_gizmotypes_dial_3d_draw_util(), ED_markers_draw(), ED_mask_draw_region(), ED_region_image_metadata_draw(), ED_view3d_draw_offscreen(), EDBM_preselect_edgering_draw(), EDBM_preselect_elem_draw(), external_draw_scene_do(), gizmo_axis_draw(), gizmo_cage2d_draw_intern(), gizmo_cage3d_draw_intern(), gizmo_primitive_draw_intern(), gizmo_ruler_draw(), gpencil_render_offscreen(), GPU_viewport_stereo_composite(), knifetool_draw(), move3d_draw_intern(), node_draw_space(), paint_cursor_cursor_draw_3d_view_brush_cursor_active(), paint_cursor_draw_3d_view_brush_cursor_inactive(), paint_draw_alpha_overlay(), paint_draw_cursor_overlay(), paint_draw_curve_cursor(), paint_draw_tex_overlay(), panel_draw_aligned_widgets(), playanim_toscreen(), pygpu_matrix_push(), pygpu_matrix_stack_context_enter(), radial_control_paint_cursor(), radial_control_paint_tex(), region_draw_azones(), screen_preview_draw(), SCULPT_cloth_simulation_limits_draw(), SCULPT_layer_brush_height_preview_draw(), sequencer_draw_display_buffer(), timeline_cache_draw_single(), tracking_segment_knot_cb(), transform_draw_cursor_draw(), UI_block_draw(), ui_draw_but_UNITVEC(), ui_draw_pie_center(), and voxel_size_edit_draw().
| void GPU_matrix_push_projection | ( | void | ) |
Definition at line 149 of file gpu_matrix.cc.
References BLI_assert, copy_m4_m4(), MATRIX_STACK_DEPTH, Projection, and ProjectionStack.
Referenced by cursor_plane_draw(), draw_horizontal_scale_indicators(), draw_nodespace_back_pix(), draw_vertical_scale_indicators(), DRW_draw_render_loop_2d_ex(), ED_time_scrub_channel_search_draw(), ED_time_scrub_draw(), ED_time_scrub_draw_current_frame(), ED_view3d_draw_offscreen(), external_draw_scene_do(), gizmo_axis_draw(), gizmo_ruler_draw(), gpencil_render_offscreen(), GPU_viewport_stereo_composite(), knifetool_draw(), paint_cursor_cursor_draw_3d_view_brush_cursor_active(), paint_cursor_draw_3d_view_brush_cursor_inactive(), playanim_toscreen(), pygpu_matrix_push_projection(), pygpu_matrix_stack_context_enter(), sequencer_draw_display_buffer(), UI_block_draw(), ui_draw_but_UNITVEC(), and view2d_draw_lines_internal().
| void GPU_matrix_reset | ( | void | ) |
Definition at line 102 of file gpu_matrix.cc.
References blender::gpu::Context::get(), gpu_matrix_state_active_set_dirty(), blender::gpu::Context::matrix_state, ModelView, Projection, state, and unit_m4().
Referenced by pygpu_matrix_reset(), and screen_opengl_render_doit().
| void GPU_matrix_rotate_2d | ( | float | deg | ) |
Definition at line 269 of file gpu_matrix.cc.
References DEG2RADF, ModelView, and rotate_m4().
Referenced by blf_draw_gl__start(), paint_draw_tex_overlay(), and radial_control_paint_tex().
Definition at line 277 of file gpu_matrix.cc.
References GPU_matrix_rotate_3fv(), x, y, and z.
Referenced by dial_ghostarc_draw_helpline(), and radial_control_paint_cursor().
Definition at line 283 of file gpu_matrix.cc.
References axis_angle_to_mat4(), DEG2RADF, and GPU_matrix_mul().
Referenced by GPU_matrix_rotate_3f().
| void GPU_matrix_rotate_axis | ( | float | deg, |
| char | axis | ||
| ) |
Definition at line 290 of file gpu_matrix.cc.
References CHECKMAT, DEG2RADF, gpu_matrix_state_active_set_dirty(), ModelView, and rotate_m4().
Referenced by transform_draw_cursor_draw().
| void GPU_matrix_scale_1f | ( | float | factor | ) |
Definition at line 225 of file gpu_matrix.cc.
References GPU_matrix_mul(), and scale_m4_fl().
Referenced by curve_draw_stroke_3d(), gizmo_axis_draw(), paint_draw_cursor_overlay(), pygpu_matrix_scale_uniform(), and ui_draw_but_UNITVEC().
Definition at line 232 of file gpu_matrix.cc.
References GPU_matrix_mul(), x, and y.
Referenced by button2d_draw_intern(), clip_main_region_draw(), draw_distortion(), draw_fcurve(), draw_fcurve_curve_bezts(), draw_fcurve_curve_samples(), draw_fcurve_sample_control(), draw_render_info(), draw_stabilization_border(), draw_tracking_tracks(), drawPropCircle(), DRW_draw_cursor(), DRW_draw_cursor_2d(), ED_markers_draw(), ED_mask_draw_region(), ED_region_image_metadata_draw(), GPU_matrix_scale_2fv(), paint_draw_tex_overlay(), timeline_cache_draw_single(), and tracking_segment_knot_cb().
| void GPU_matrix_scale_2fv | ( | const float | vec[2] | ) |
Definition at line 242 of file gpu_matrix.cc.
References GPU_matrix_scale_2f().
Referenced by pygpu_matrix_scale(), and radial_control_paint_cursor().
Definition at line 247 of file gpu_matrix.cc.
References GPU_matrix_mul(), x, y, and z.
Referenced by arrow_draw_geom(), and GPU_matrix_scale_3fv().
| void GPU_matrix_scale_3fv | ( | const float | vec[3] | ) |
Definition at line 257 of file gpu_matrix.cc.
References GPU_matrix_scale_3f().
Referenced by blf_draw_gl__start(), and pygpu_matrix_scale().
| void GPU_matrix_set | ( | const float | m[4][4] | ) |
Definition at line 163 of file gpu_matrix.cc.
References CHECKMAT, copy_m4_m4(), gpu_matrix_state_active_set_dirty(), and ModelView.
| int GPU_matrix_stack_level_get_model_view | ( | void | ) |
Definition at line 703 of file gpu_matrix.cc.
References blender::gpu::Context::get(), blender::gpu::Context::matrix_state, and state.
Referenced by pygpu_matrix_stack_context_enter(), pygpu_matrix_stack_context_exit(), pygpu_stack_is_pop_model_view_ok_or_error(), and pygpu_stack_is_push_model_view_ok_or_error().
| int GPU_matrix_stack_level_get_projection | ( | void | ) |
Definition at line 709 of file gpu_matrix.cc.
References blender::gpu::Context::get(), blender::gpu::Context::matrix_state, and state.
Referenced by pygpu_matrix_stack_context_enter(), pygpu_matrix_stack_context_exit(), pygpu_stack_is_pop_projection_ok_or_error(), and pygpu_stack_is_push_projection_ok_or_error().
|
static |
Definition at line 96 of file gpu_matrix.cc.
References blender::gpu::Context::get(), blender::gpu::Context::matrix_state, and state.
Referenced by GPU_matrix_bind(), GPU_matrix_frustum_set(), GPU_matrix_identity_projection_set(), GPU_matrix_identity_set(), GPU_matrix_mul(), GPU_matrix_ortho_2d_set(), GPU_matrix_ortho_set(), GPU_matrix_ortho_set_z(), GPU_matrix_pop(), GPU_matrix_pop_projection(), GPU_matrix_projection_set(), GPU_matrix_reset(), GPU_matrix_rotate_axis(), GPU_matrix_set(), GPU_matrix_translate_3f(), mat4_frustum_set(), mat4_look_from_origin(), and mat4_ortho_set().
| GPUMatrixState* GPU_matrix_state_create | ( | void | ) |
Definition at line 70 of file gpu_matrix.cc.
References MATRIX_4X4_IDENTITY, MEM_mallocN, and state.
Referenced by blender::gpu::Context::Context().
| void GPU_matrix_state_discard | ( | GPUMatrixState * | state | ) |
Definition at line 91 of file gpu_matrix.cc.
References MEM_freeN, and state.
Referenced by blender::gpu::Context::~Context().
Definition at line 190 of file gpu_matrix.cc.
References GPU_matrix_mul(), unit_m4(), x, and y.
Referenced by button2d_draw_intern(), clip_main_region_draw(), draw_distortion(), draw_fcurve(), draw_fcurve_curve_bezts(), draw_fcurve_curve_samples(), draw_fcurve_sample_control(), draw_render_info(), draw_stabilization_border(), draw_tracking_tracks(), DRW_draw_cursor(), DRW_draw_cursor_2d(), ED_image_draw_cursor(), ED_mask_draw_region(), ED_region_image_metadata_draw(), GPU_matrix_translate_2fv(), paint_draw_alpha_overlay(), paint_draw_cursor_overlay(), paint_draw_curve_cursor(), paint_draw_tex_overlay(), panel_draw_aligned_widgets(), radial_control_paint_cursor(), region_draw_azones(), screen_opengl_render_doit(), screen_preview_draw(), timeline_cache_draw_single(), tracking_segment_knot_cb(), ui_draw_but_UNITVEC(), and ui_draw_pie_center().
| void GPU_matrix_translate_2fv | ( | const float | vec[2] | ) |
Definition at line 199 of file gpu_matrix.cc.
References GPU_matrix_translate_2f().
Referenced by clip_draw_grease_pencil(), draw_marker_areas(), draw_marker_outline(), draw_marker_slide_zones(), ED_image_draw_cursor(), paint_draw_cursor_overlay(), paint_draw_tex_overlay(), and pygpu_matrix_translate().
Definition at line 204 of file gpu_matrix.cc.
References CHECKMAT, GPU_matrix_mul(), gpu_matrix_state_active_set_dirty(), ModelView, translate_m4(), unit_m4(), x, y, and z.
Referenced by arrow_draw_geom(), curve_draw_stroke_3d(), GPU_matrix_look_at(), GPU_matrix_translate_3fv(), and transform_draw_cursor_draw().
| void GPU_matrix_translate_3fv | ( | const float | vec[3] | ) |
Definition at line 220 of file gpu_matrix.cc.
References GPU_matrix_translate_3f().
Referenced by blf_draw_gl__start(), gizmo_axis_draw(), pygpu_matrix_translate(), and transform_draw_cursor_draw().
| bool GPU_matrix_unproject | ( | const float | win[3], |
| const float | model[4][4], | ||
| const float | proj[4][4], | ||
| const int | view[4], | ||
| float | r_world[3] | ||
| ) |
Definition at line 572 of file gpu_matrix.cc.
References GPU_matrix_unproject_precalc(), GPU_matrix_unproject_with_precalc(), view, and zero_v3().
Referenced by ED_view3d_unproject().
| bool GPU_matrix_unproject_precalc | ( | struct GPUMatrixUnproject_Precalc * | precalc, |
| const float | model[4][4], | ||
| const float | proj[4][4], | ||
| const int | view[4] | ||
| ) |
Definition at line 531 of file gpu_matrix.cc.
References GPUMatrixUnproject_Precalc::dims, float(), invert_m4_m4(), GPUMatrixUnproject_Precalc::is_persp, GPUMatrixUnproject_Precalc::model_inverted, projmat_dimensions_db(), unit_m4(), view, GPUMatrixUnproject_Precalc::view, GPUMatrixUnproject_Precalc::xmax, GPUMatrixUnproject_Precalc::xmin, GPUMatrixUnproject_Precalc::ymax, GPUMatrixUnproject_Precalc::ymin, GPUMatrixUnproject_Precalc::zmax, and GPUMatrixUnproject_Precalc::zmin.
Referenced by gizmo_find_intersected_3d_intern(), and GPU_matrix_unproject().
| void GPU_matrix_unproject_with_precalc | ( | const struct GPUMatrixUnproject_Precalc * | precalc, |
| const float | win[3], | ||
| float | r_world[3] | ||
| ) |
Definition at line 559 of file gpu_matrix.cc.
References gpu_mul_invert_projmat_m4_unmapped_v3_with_precalc(), GPUMatrixUnproject_Precalc::model_inverted, mul_v3_m4v3(), and GPUMatrixUnproject_Precalc::view.
Referenced by gizmo_find_intersected_3d_intern(), and GPU_matrix_unproject().
|
static |
The same result could be obtained as follows:
But that solution loses much precision. Therefore, get the same result without inverting the matrix.
Definition at line 512 of file gpu_matrix.cc.
References GPUMatrixUnproject_Precalc::dims, GPUMatrixUnproject_Precalc::is_persp, GPUMatrixUnproject_Precalc::xmax, GPUMatrixUnproject_Precalc::xmin, GPUMatrixUnproject_Precalc::ymax, GPUMatrixUnproject_Precalc::ymin, GPUMatrixUnproject_Precalc::zmax, and GPUMatrixUnproject_Precalc::zmin.
Referenced by GPU_matrix_unproject_with_precalc().
Definition at line 758 of file gpu_matrix.cc.
References GPU_matrix_projection_get(), GPU_matrix_projection_set(), and GPU_polygon_offset_calc().
Referenced by annotation_draw_strokes(), ED_view3d_polygon_offset(), gpencil_draw_strokes(), and knifetool_draw().
Definition at line 724 of file gpu_matrix.cc.
References float(), and UNUSED_VARS.
Referenced by DRW_view_create_with_zoffset(), and GPU_polygon_offset().
|
static |
Definition at line 324 of file gpu_matrix.cc.
References bottom, gpu_matrix_state_active_set_dirty(), left, right, and top.
Referenced by GPU_matrix_frustum_set().
Definition at line 350 of file gpu_matrix.cc.
References cross_v3_v3v3(), gpu_matrix_state_active_set_dirty(), and normalize_v3().
Referenced by GPU_matrix_look_at().
|
static |
Definition at line 298 of file gpu_matrix.cc.
References bottom, gpu_matrix_state_active_set_dirty(), left, right, and top.
Referenced by GPU_matrix_ortho_2d_set(), and GPU_matrix_ortho_set().