Blender V2.61 - r43446
|
#include "DNA_camera_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "DNA_lamp_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_rect.h"
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "BKE_anim.h"
#include "BKE_action.h"
#include "BKE_camera.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_object.h"
#include "BKE_global.h"
#include "BKE_main.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
#include "BIF_gl.h"
#include "BIF_glutil.h"
#include "GPU_draw.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_screen.h"
#include "ED_armature.h"
#include "view3d_intern.h"
Go to the source code of this file.
Classes | |
struct | SmoothViewStore |
Defines | |
#define | QUATSET(a, b, c, d, e) a[0]=b; a[1]=c; a[2]=d; a[3]=e; |
Functions | |
void | view3d_operator_needs_opengl (const bContext *C) |
void | view3d_region_operator_needs_opengl (wmWindow *win, ARegion *ar) |
float * | give_cursor (Scene *scene, View3D *v3d) |
void | smooth_view (bContext *C, View3D *v3d, ARegion *ar, Object *oldcamera, Object *camera, float *ofs, float *quat, float *dist, float *lens) |
static int | view3d_smoothview_invoke (bContext *C, wmOperator *UNUSED(op), wmEvent *event) |
void | VIEW3D_OT_smoothview (wmOperatorType *ot) |
static int | view3d_camera_to_view_exec (bContext *C, wmOperator *UNUSED(op)) |
static int | view3d_camera_to_view_poll (bContext *C) |
void | VIEW3D_OT_camera_to_view (wmOperatorType *ot) |
static int | view3d_camera_to_view_selected_exec (bContext *C, wmOperator *UNUSED(op)) |
static int | view3d_camera_to_view_selected_poll (bContext *C) |
void | VIEW3D_OT_camera_to_view_selected (wmOperatorType *ot) |
static int | view3d_setobjectascamera_exec (bContext *C, wmOperator *UNUSED(op)) |
int | ED_operator_rv3d_user_region_poll (bContext *C) |
void | VIEW3D_OT_object_as_camera (wmOperatorType *ot) |
void | ED_view3d_calc_clipping (BoundBox *bb, float planes[4][4], bglMats *mats, const rcti *rect) |
void | ED_view3d_win_to_segment_clip (ARegion *ar, View3D *v3d, const float mval[2], float ray_start[3], float ray_end[3]) |
void | ED_view3d_win_to_ray (ARegion *ar, View3D *v3d, const float mval[2], float ray_start[3], float ray_normal[3]) |
void | ED_view3d_global_to_vector (RegionView3D *rv3d, const float coord[3], float vec[3]) |
int | initgrabz (RegionView3D *rv3d, float x, float y, float z) |
void | ED_view3d_win_to_3d (ARegion *ar, const float depth_pt[3], const float mval[2], float out[3]) |
void | ED_view3d_win_to_delta (ARegion *ar, const float mval[2], float out[3]) |
void | ED_view3d_win_to_vector (ARegion *ar, const float mval[2], float out[3]) |
float | ED_view3d_depth_read_cached (ViewContext *vc, int x, int y) |
void | ED_view3d_depth_tag_update (RegionView3D *rv3d) |
void | ED_view3d_ob_project_mat_get (RegionView3D *rv3d, Object *ob, float pmat[4][4]) |
void | ED_view3d_project_float (const ARegion *ar, const float vec[3], float adr[2], float mat[4][4]) |
void | ED_view3d_project_float_v3 (ARegion *ar, float *vec, float *adr, float mat[4][4]) |
int | ED_view3d_boundbox_clip (RegionView3D *rv3d, float obmat[][4], BoundBox *bb) |
void | project_short (ARegion *ar, const float vec[3], short adr[2]) |
void | project_int (ARegion *ar, const float vec[3], int adr[2]) |
void | project_int_noclip (ARegion *ar, const float vec[3], int adr[2]) |
void | project_short_noclip (ARegion *ar, const float vec[3], short adr[2]) |
void | project_float (ARegion *ar, const float vec[3], float adr[2]) |
void | project_float_noclip (ARegion *ar, const float vec[3], float adr[2]) |
int | ED_view3d_clip_range_get (View3D *v3d, RegionView3D *rv3d, float *clipsta, float *clipend) |
int | ED_view3d_viewplane_get (View3D *v3d, RegionView3D *rv3d, int winx, int winy, rctf *viewplane, float *clipsta, float *clipend) |
void | setwinmatrixview3d (ARegion *ar, View3D *v3d, rctf *rect) |
static void | obmat_to_viewmat (View3D *v3d, RegionView3D *rv3d, Object *ob, short smooth) |
int | ED_view3d_lock (RegionView3D *rv3d) |
void | setviewmatrixview3d (Scene *scene, View3D *v3d, RegionView3D *rv3d) |
short | view3d_opengl_select (ViewContext *vc, unsigned int *buffer, unsigned int bufsize, rcti *input) |
static unsigned int | free_localbit (Main *bmain) |
int | ED_view3d_scene_layer_set (int lay, const int *values, int *active) |
static void | initlocalview (Main *bmain, Scene *scene, ScrArea *sa) |
static void | restore_localviewdata (ScrArea *sa, int free) |
static void | endlocalview (Main *bmain, Scene *scene, ScrArea *sa) |
static int | localview_exec (bContext *C, wmOperator *UNUSED(unused)) |
void | VIEW3D_OT_localview (wmOperatorType *ot) |
static int | game_engine_poll (bContext *C) |
int | ED_view3d_context_activate (bContext *C) |
static int | game_engine_exec (bContext *C, wmOperator *op) |
void | VIEW3D_OT_game_start (wmOperatorType *ot) |
void | view3d_align_axis_to_vector (View3D *v3d, RegionView3D *rv3d, int axisidx, float vec[3]) |
float | ED_view3d_pixel_size (struct RegionView3D *rv3d, const float co[3]) |
Definition in file view3d_view.c.
#define QUATSET | ( | a, | |
b, | |||
c, | |||
d, | |||
e | |||
) | a[0]=b; a[1]=c; a[2]=d; a[3]=e; |
Definition at line 1098 of file view3d_view.c.
Referenced by ED_view3d_lock().
int ED_operator_rv3d_user_region_poll | ( | bContext * | C | ) |
Definition at line 497 of file view3d_view.c.
References ED_view3d_context_user_region().
Referenced by VIEW3D_OT_object_as_camera(), VIEW3D_OT_view_orbit(), VIEW3D_OT_view_persportho(), and VIEW3D_OT_viewnumpad().
int ED_view3d_boundbox_clip | ( | RegionView3D * | rv3d, |
float | obmat[][4], | ||
BoundBox * | bb | ||
) |
Definition at line 809 of file view3d_view.c.
References copy_v3_v3(), BoundBox::flag, max, min, mul_m4_v4(), mult_m4_m4m4(), NULL, OB_BB_DISABLED, RegionView3D::persmat, and BoundBox::vec.
Referenced by draw_dupli_objects_color(), draw_mesh_object(), draw_object(), drawObjectSelect(), and drawWireExtra().
void ED_view3d_calc_clipping | ( | BoundBox * | bb, |
float | planes[4][4], | ||
bglMats * | mats, | ||
const rcti * | rect | ||
) |
Definition at line 523 of file view3d_view.c.
References credits_svn_gen::e, fabs(), is_negative_m4(), bglMats::modelview, negate_v3(), normal_tri_v3(), p, bglMats::projection, simple_enum_gen::val, BoundBox::vec, VECCOPY, bglMats::viewport, rcti::xmax, rcti::xmin, rcti::ymax, and rcti::ymin.
int ED_view3d_clip_range_get | ( | View3D * | v3d, |
RegionView3D * | rv3d, | ||
float * | clipsta, | ||
float * | clipend | ||
) |
Definition at line 987 of file view3d_view.c.
References camera_params_from_view3d(), camera_params_init(), CameraParams::clipend, CameraParams::clipsta, and CameraParams::is_ortho.
Referenced by project_paint_view_clip().
int ED_view3d_context_activate | ( | bContext * | C | ) |
Definition at line 1681 of file view3d_view.c.
References bScreen::areabase, CTX_wm_area(), CTX_wm_area_set(), CTX_wm_region_set(), CTX_wm_screen(), ListBase::first, ARegion::next, ScrArea::next, NULL, ScrArea::regionbase, ARegion::regiontype, RGN_TYPE_WINDOW, SPACE_VIEW3D, and ScrArea::spacetype.
Referenced by game_engine_exec(), and screen_opengl_render_init().
float ED_view3d_depth_read_cached | ( | ViewContext * | vc, |
int | x, | ||
int | y | ||
) |
Definition at line 728 of file view3d_view.c.
References ViewContext::ar, ViewDepths::depths, RegionView3D::depths, ViewContext::rv3d, ViewDepths::w, simple_enum_gen::w, ARegion::winrct, rcti::xmin, and rcti::ymin.
void ED_view3d_depth_tag_update | ( | RegionView3D * | rv3d | ) |
Definition at line 741 of file view3d_view.c.
References ViewDepths::damaged, and RegionView3D::depths.
Referenced by viewdolly_exec(), viewdolly_invoke(), viewdolly_modal(), viewmove_invoke(), viewmove_modal(), viewrotate_invoke(), viewrotate_modal(), viewzoom_exec(), viewzoom_invoke(), and viewzoom_modal().
void ED_view3d_global_to_vector | ( | struct RegionView3D * | rv3d, |
const float | coord[3], | ||
float | vec[3] | ||
) |
Calculate a normalized 3d direction vector from the viewpoint towards a global location. In orthographic view the resulting vector will match the view vector.
rv3d | The region (used for the window width and height). |
coord | The world-space location. |
vec | The resulting normalized vector. |
Definition at line 617 of file view3d_view.c.
References copy_v3_v3(), RegionView3D::is_persp, mul_m4_v4(), mul_v3_fl(), normalize_v3(), sub_v3_v3v3(), RegionView3D::viewinv, and RegionView3D::viewmat.
Referenced by calc_sculpt_normal(), calc_sculpt_plane(), project_brush_radius(), sculpt_update_cache_invariants(), and test_manipulator_axis().
int ED_view3d_lock | ( | RegionView3D * | rv3d | ) |
Definition at line 1100 of file view3d_view.c.
References cos(), FALSE, M_PI, QUATSET, RV3D_VIEW_BACK, RV3D_VIEW_BOTTOM, RV3D_VIEW_FRONT, RV3D_VIEW_LEFT, RV3D_VIEW_RIGHT, RV3D_VIEW_TOP, sin(), TRUE, RegionView3D::view, and RegionView3D::viewquat.
Referenced by region_quadview_exec(), and setviewmatrixview3d().
void ED_view3d_ob_project_mat_get | ( | RegionView3D * | rv3d, |
Object * | ob, | ||
float | pmat[4][4] | ||
) |
Definition at line 747 of file view3d_view.c.
References mult_m4_m4m4(), Object::obmat, RegionView3D::viewmat, and RegionView3D::winmat.
Referenced by createSlideVerts(), mesh_rip_invoke(), paint_convert_bb_to_rect(), project_paint_begin(), and sculpt_update_cache_invariants().
float ED_view3d_pixel_size | ( | struct RegionView3D * | rv3d, |
const float | co[3] | ||
) |
Definition at line 1842 of file view3d_view.c.
References RegionView3D::persmat, and RegionView3D::pixsize.
Referenced by BIF_draw_manipulator(), draw_new_particle_system(), drawcentercircle(), drawlamp(), and drawSnapping().
void ED_view3d_project_float | ( | const ARegion * | ar, |
const float | vec[3], | ||
float | adr[2], | ||
float | mat[4][4] | ||
) |
Definition at line 771 of file view3d_view.c.
References copy_v3_v3(), IS_CLIPPED, mul_m4_v4(), ARegion::winx, and ARegion::winy.
void ED_view3d_project_float_v3 | ( | ARegion * | ar, |
float * | vec, | ||
float * | adr, | ||
float | mat[4][4] | ||
) |
Definition at line 790 of file view3d_view.c.
References copy_v3_v3(), IS_CLIPPED, mul_m4_v4(), ARegion::winx, and ARegion::winy.
int ED_view3d_scene_layer_set | ( | int | lay, |
const int * | values, | ||
int * | active | ||
) |
Definition at line 1337 of file view3d_view.c.
References i.
int ED_view3d_viewplane_get | ( | View3D * | v3d, |
RegionView3D * | rv3d, | ||
int | winx, | ||
int | winy, | ||
rctf * | viewplane, | ||
float * | clipsta, | ||
float * | clipend | ||
) |
Definition at line 1001 of file view3d_view.c.
References camera_params_compute_viewplane(), camera_params_from_view3d(), camera_params_init(), CameraParams::clipend, CameraParams::clipsta, CameraParams::is_ortho, and CameraParams::viewplane.
Referenced by screen_opengl_render_apply(), and setwinmatrixview3d().
void ED_view3d_win_to_3d | ( | struct ARegion * | ar, |
const float | depth_pt[3], | ||
const float | mval[2], | ||
float | out[3] | ||
) |
Calculate a 3d location from 2d window coordinates.
ar | The region (used for the window width and height). |
depth_pt | The reference location used to calculate the Z depth. |
mval | The area relative location (such as event->mval converted to floats). |
out | The resulting world-space location. |
Definition at line 663 of file view3d_view.c.
References add_v3_v3v3(), closest_to_line_v3(), copy_v3_v3(), ED_view3d_win_to_vector(), RegionView3D::is_persp, isect_line_plane_v3(), RegionView3D::persinv, ARegion::regiondata, TRUE, RegionView3D::viewinv, ARegion::winx, ARegion::winy, and zero_v3().
Referenced by armature_click_extrude_invoke(), and gp_strokepoint_convertcoords().
void ED_view3d_win_to_delta | ( | struct ARegion * | ar, |
const float | mval[2], | ||
float | out[3] | ||
) |
Calculate a 3d difference vector from 2d window offset. note that initgrabz() must be called first to determine the depth used to calculate the delta.
ar | The region (used for the window width and height). |
mval | The area relative 2d difference (such as event->mval[0] - other_x). |
out | The resulting world-space delta. |
Definition at line 695 of file view3d_view.c.
References RegionView3D::persinv, ARegion::regiondata, ARegion::winx, ARegion::winy, and RegionView3D::zfac.
Referenced by brush_edit_apply(), convertViewVec(), draw_bgpic(), gp_stroke_convertcoords(), paint_calc_object_space_radius(), sculpt_update_brush_delta(), set_3dcursor_invoke(), sk_projectDrawPoint(), view3d_get_view_aligned_coordinate(), view3d_zoom_border_exec(), view_zoom_mouseloc(), viewmove_apply(), and viewpan_exec().
void ED_view3d_win_to_ray | ( | struct ARegion * | ar, |
struct View3D * | v3d, | ||
const float | mval[2], | ||
float | ray_start[3], | ||
float | ray_normal[3] | ||
) |
Calculate a 3d viewpoint and direction vector from 2d window coordinates. This ray_start is located at the viewpoint, ray_normal is the direction towards mval. ray_start is clipped by the view near limit so points in front of it are always in view. In orthographic view the resulting ray_normal will match the view vector.
ar | The region (used for the window width and height). |
v3d | The 3d viewport (used for near clipping value). |
mval | The area relative 2d location (such as event->mval, converted into float[2]). |
ray_start | The world-space starting point of the segment. |
ray_normal | The normalized world-space direction of towards mval. |
Definition at line 608 of file view3d_view.c.
References ED_view3d_win_to_segment_clip(), normalize_v3(), and sub_v3_v3v3().
Referenced by peelObjects(), sk_interpolateDepth(), and snapObjects().
void ED_view3d_win_to_segment_clip | ( | struct ARegion * | ar, |
struct View3D * | v3d, | ||
const float | mval[2], | ||
float | ray_start[3], | ||
float | ray_end[3] | ||
) |
Calculate a 3d segment from 2d window coordinates. This ray_start is located at the viewpoint, ray_end is a far point. ray_start and ray_end are clipped by the view near and far limits so points along this line are always in view. In orthographic view all resulting segments will be parallel.
ar | The region (used for the window width and height). |
v3d | The 3d viewport (used for near and far clipping range). |
mval | The area relative 2d location (such as event->mval, converted into float[2]). |
ray_start | The world-space starting point of the segment. |
ray_end | The world-space end point of the segment. |
Definition at line 573 of file view3d_view.c.
References RegionView3D::clip, clip_line_plane(), copy_v3_v3(), ED_view3d_win_to_vector(), View3D::far, RegionView3D::is_persp, madd_v3_v3v3fl(), mul_m4_v4(), View3D::near, RegionView3D::persinv, ARegion::regiondata, RegionView3D::rflag, RV3D_CLIPPING, RegionView3D::viewinv, ARegion::winx, and ARegion::winy.
Referenced by brush_add(), ED_view3d_win_to_ray(), sculpt_stroke_get_location(), and sk_getIntersections().
void ED_view3d_win_to_vector | ( | struct ARegion * | ar, |
const float | mval[2], | ||
float | out[3] | ||
) |
Calculate a 3d direction vector from 2d window coordinates. This direction vector starts and the view in the direction of the 2d window coordinates. In orthographic view all window coordinates yield the same vector.
ar | The region (used for the window width and height). |
mval | The area relative 2d location (such as event->mval converted to floats). |
out | The resulting normalized world-space direction vector. |
Definition at line 711 of file view3d_view.c.
References copy_v3_v3(), RegionView3D::is_persp, mul_project_m4_v3(), normalize_v3(), RegionView3D::persinv, ARegion::regiondata, sub_v3_v3(), RegionView3D::viewinv, ARegion::winx, and ARegion::winy.
Referenced by ED_view3d_win_to_3d(), ED_view3d_win_to_segment_clip(), and viewops_data_create().
Definition at line 1514 of file view3d_view.c.
References DAG_on_visible_update(), FALSE, ListBase::first, FIRSTBASE, Object::flag, Base::flag, Object::lay, Base::lay, Scene::lay, View3D::lay, View3D::layact, View3D::localvd, Base::next, Scene::obedit, Base::object, restore_localviewdata(), View3D::scenelock, SELECT, and ScrArea::spacedata.
Referenced by localview_exec().
static unsigned int free_localbit | ( | Main * | bmain | ) | [static] |
Definition at line 1303 of file view3d_view.c.
References bScreen::areabase, ListBase::first, bScreen::id, View3D::lay, SpaceLink::next, ScrArea::next, ID::next, Main::screen, SPACE_VIEW3D, ScrArea::spacedata, and SpaceLink::spacetype.
Referenced by initlocalview().
static int game_engine_exec | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 1710 of file view3d_view.c.
References BKE_report(), BLI_findindex(), BLI_isect_rcti(), CTX_data_main(), CTX_data_scene(), CTX_wm_area(), CTX_wm_area_set(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_region_set(), CTX_wm_region_view3d(), CTX_wm_view3d(), CTX_wm_window(), CTX_wm_window_set(), ED_area_tag_redraw(), ED_view3d_calc_camera_border(), ED_view3d_context_activate(), FALSE, GameData::framing, Scene::gm, NULL, OPERATOR_CANCELLED, OPERATOR_FINISHED, RegionView3D::persp, wmOperator::reports, RPT_ERROR, RV3D_CAMOB, SCE_GAMEFRAMING_BARS, set_scene_bg(), StartKetsjiShell(), STEREO_DOME, GameData::stereoflag, GameFraming::type, view3d_operator_needs_opengl(), ARegion::winrct, WM_redraw_windows(), rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, rctf::ymax, rcti::ymax, rctf::ymin, and rcti::ymin.
Referenced by VIEW3D_OT_game_start().
static int game_engine_poll | ( | bContext * | C | ) | [static] |
Definition at line 1664 of file view3d_view.c.
References CTX_data_mode_enum(), CTX_MODE_OBJECT, CTX_wm_area(), CTX_wm_screen(), CTX_wm_window(), and NULL.
Referenced by VIEW3D_OT_game_start().
Definition at line 100 of file view3d_view.c.
References Scene::cursor, View3D::cursor, and View3D::localvd.
Referenced by add_primitive_bone(), add_vertex_invoke(), armature_bone_primitive_add_exec(), armature_calc_roll_exec(), armature_click_extrude_exec(), armature_click_extrude_invoke(), armature_fill_bones_exec(), BIF_draw_manipulator(), calculateCenterCursor(), drawcursor(), dupli_extrude_cursor(), ED_object_location_from_view(), em_snap_to_cursor(), gp_get_3d_reference(), gp_strokepoint_convertcoords(), object_origin_set_exec(), project_paint_begin_clone(), screw_mesh_invoke(), set_3dcursor_invoke(), set_clone_cursor_exec(), setviewmatrixview3d(), snap_curs_to_active(), snap_curs_to_center(), snap_curs_to_grid(), snap_curs_to_sel(), snap_sel_to_curs(), spin_invoke(), spin_mesh_invoke(), uv_map_transform_center(), view3d_all_exec(), viewcenter_cursor_exec(), and Warp().
int initgrabz | ( | RegionView3D * | rv3d, |
float | x, | ||
float | y, | ||
float | z | ||
) |
Definition at line 640 of file view3d_view.c.
References FALSE, NULL, RegionView3D::persmat, TRUE, and RegionView3D::zfac.
Referenced by brush_edit_init(), calculateCenter(), draw_bgpic(), gp_paint_initstroke(), paint_calc_object_space_radius(), sculpt_update_brush_delta(), set_3dcursor_invoke(), sk_projectDrawPoint(), view3d_get_view_aligned_coordinate(), view3d_zoom_border_exec(), view_zoom_mouseloc(), viewops_data_create(), and viewpan_exec().
Definition at line 1375 of file view3d_view.c.
References BASACT, View3D::cursor, RegionView3D::dist, ListBase::first, FIRSTBASE, Base::flag, free_localbit(), INIT_MINMAX, View3D::lay, Base::lay, Object::lay, View3D::layact, RegionView3D::localvd, View3D::localvd, max, MAX3(), MEM_mallocN(), min, minmax_object(), ARegion::next, Base::next, Scene::obedit, Base::object, RegionView3D::ofs, RegionView3D::persp, ScrArea::regionbase, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, RV3D_CAMOB, RV3D_ORTHO, RV3D_PERSP, SELECT, size(), ScrArea::spacedata, TESTBASE, ARegion::winx, and ARegion::winy.
Referenced by localview_exec().
static int localview_exec | ( | bContext * | C, |
wmOperator * | UNUSEDunused | ||
) | [static] |
Definition at line 1545 of file view3d_view.c.
References CTX_data_main(), CTX_data_scene(), CTX_wm_area(), CTX_wm_view3d(), ED_area_tag_redraw(), endlocalview(), initlocalview(), View3D::localvd, and OPERATOR_FINISHED.
Referenced by VIEW3D_OT_localview().
static void obmat_to_viewmat | ( | View3D * | v3d, |
RegionView3D * | rv3d, | ||
Object * | ob, | ||
short | smooth | ||
) | [static] |
Definition at line 1055 of file view3d_view.c.
References View3D::camera, copy_m3_m4(), copy_m4_m4(), copy_v3_v3(), RegionView3D::dist, ED_view3d_from_object(), invert_m4_m4(), View3D::lens, mat3_to_quat(), SmoothViewStore::new_quat, normalize_m4(), NULL, Object::obmat, RegionView3D::ofs, SmoothViewStore::orig_dist, SmoothViewStore::orig_lens, SmoothViewStore::orig_ofs, RegionView3D::persp, RV3D_CAMOB, RV3D_PERSP, RV3D_VIEW_USER, smooth_view(), RegionView3D::view, RegionView3D::viewmat, and RegionView3D::viewquat.
Referenced by setviewmatrixview3d().
void project_float | ( | ARegion * | ar, |
const float | vec[3], | ||
float | adr[2] | ||
) |
Definition at line 949 of file view3d_view.c.
References BL_NEAR_CLIP, copy_v3_v3(), IS_CLIPPED, mul_m4_v4(), RegionView3D::persmat, ARegion::regiondata, ARegion::winx, and ARegion::winy.
Referenced by applyProject(), knife_cut_exec(), sk_getIntersections(), sk_getSelfIntersections(), and sk_interpolateDepth().
void project_float_noclip | ( | ARegion * | ar, |
const float | vec[3], | ||
float | adr[2] | ||
) |
Definition at line 966 of file view3d_view.c.
References BL_NEAR_CLIP, copy_v3_v3(), fabs(), mul_m4_v4(), RegionView3D::persmat, ARegion::regiondata, ARegion::winx, and ARegion::winy.
Referenced by calc_vp_strength_dl(), dupli_extrude_cursor(), EM_project_snap_verts(), projectFloatView(), and weight_sample_invoke().
void project_int | ( | ARegion * | ar, |
const float | vec[3], | ||
int | adr[2] | ||
) |
Definition at line 875 of file view3d_view.c.
References BL_NEAR_CLIP, copy_v3_v3(), mul_m4_v4(), RegionView3D::persmat, ARegion::regiondata, ARegion::winx, and ARegion::winy.
Referenced by do_lasso_select_pose(), drawcursor(), gp_stroke_eraser_dostroke(), key_inside_circle(), key_inside_rect(), PE_lasso_select(), snapEdge(), snapVertex(), and updateSelectedSnapPoint().
void project_int_noclip | ( | ARegion * | ar, |
const float | vec[3], | ||
int | adr[2] | ||
) |
Definition at line 900 of file view3d_view.c.
References BL_NEAR_CLIP, copy_v3_v3(), fabs(), mul_m4_v4(), RegionView3D::persmat, ARegion::regiondata, ARegion::winx, and ARegion::winy.
Referenced by brush_cut(), gp_stroke_convertcoords(), projectIntView(), set_3dcursor_invoke(), and view3d_get_view_aligned_coordinate().
void project_short | ( | ARegion * | ar, |
const float | vec[3], | ||
short | adr[2] | ||
) |
Definition at line 844 of file view3d_view.c.
References BL_NEAR_CLIP, copy_v3_v3(), ED_view3d_test_clipping(), IS_CLIPPED, mul_m4_v4(), RegionView3D::persmat, ARegion::regiondata, RegionView3D::rflag, RV3D_CLIPPING, ARegion::winx, and ARegion::winy.
Referenced by armature_circle_select(), do_lasso_select_armature(), do_lasso_select_meta(), do_lasso_select_objects(), draw_object(), key_test_depth(), mouse_select(), object_mouse_select_menu(), pose_circle_select(), and view3d_circle_select_exec().
void project_short_noclip | ( | ARegion * | ar, |
const float | vec[3], | ||
short | adr[2] | ||
) |
Definition at line 923 of file view3d_view.c.
References BL_NEAR_CLIP, copy_v3_v3(), IS_CLIPPED, mul_m4_v4(), RegionView3D::persmat, ARegion::regiondata, ARegion::winx, and ARegion::winy.
Referenced by sk_detectMergeGesture(), sk_projectDrawPoint(), and sk_snapPointStroke().
static void restore_localviewdata | ( | ScrArea * | sa, |
int | free | ||
) | [static] |
Definition at line 1474 of file view3d_view.c.
References View3D::camera, RegionView3D::camzoom, copy_qt_qt(), copy_v3_v3(), RegionView3D::dist, View3D::drawtype, View3D::far, ListBase::first, View3D::lay, View3D::layact, RegionView3D::localvd, View3D::localvd, MEM_freeN(), View3D::near, ARegion::next, NULL, RegionView3D::ofs, RegionView3D::persp, ScrArea::regionbase, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, ScrArea::spacedata, RegionView3D::view, and RegionView3D::viewquat.
Referenced by endlocalview().
void setviewmatrixview3d | ( | Scene * | scene, |
View3D * | v3d, | ||
RegionView3D * | rv3d | ||
) |
Definition at line 1134 of file view3d_view.c.
References View3D::camera, copy_v3_v3(), RegionView3D::dist, ED_view3d_lock(), get_pose_channel(), give_cursor(), mul_m4_v3(), OB_ARMATURE, View3D::ob_centre, View3D::ob_centre_bone, View3D::ob_centre_cursor, Object::obmat, obmat_to_viewmat(), RegionView3D::ofs, RegionView3D::persp, Object::pose, bPoseChannel::pose_mat, quat_to_mat4(), RV3D_CAMOB, RV3D_PERSP, translate_m4(), Object::type, RegionView3D::viewlock, RegionView3D::viewmat, RegionView3D::viewquat, and where_is_object().
Referenced by draw_depth(), draw_depth_gpencil(), and view3d_main_area_setup_view().
Definition at line 1016 of file view3d_view.c.
References ED_view3d_viewplane_get(), RegionView3D::is_persp, orth(), ARegion::regiondata, RegionView3D::winmat, ARegion::winx, ARegion::winy, wmFrustum(), wmOrtho(), rctf::xmax, rctf::xmin, rctf::ymax, and rctf::ymin.
Referenced by draw_depth(), draw_depth_gpencil(), manipulator_selectbuf(), view3d_main_area_setup_view(), and view3d_opengl_select().
void smooth_view | ( | bContext * | C, |
View3D * | v3d, | ||
ARegion * | ar, | ||
Object * | oldcamera, | ||
Object * | camera, | ||
float * | ofs, | ||
float * | quat, | ||
float * | dist, | ||
float * | lens | ||
) |
Definition at line 123 of file view3d_view.c.
References angle_v3v3(), copy_qt_qt(), copy_v3_v3(), CTX_wm_area(), CTX_wm_manager(), CTX_wm_window(), RegionView3D::dist, ED_region_tag_redraw(), ED_view3d_camera_lock_init(), ED_view3d_from_object(), equals_v3v3(), equals_v4v4(), FALSE, if(), invert_qt_qt(), View3D::lens, M_PI, MEM_mallocN(), mul_qt_v3(), SmoothViewStore::new_dist, SmoothViewStore::new_lens, SmoothViewStore::new_ofs, SmoothViewStore::new_quat, NULL, RegionView3D::ofs, SmoothViewStore::orig_dist, SmoothViewStore::orig_lens, SmoothViewStore::orig_ofs, SmoothViewStore::orig_quat, SmoothViewStore::orig_view, RegionView3D::persp, ARegion::regiondata, RegionView3D::rflag, RV3D_BOXVIEW, RV3D_LOCKED, RV3D_NAVIGATING, RV3D_PERSP, RV3D_VIEW_USER, RegionView3D::smooth_timer, UserDef::smooth_viewtx, RegionView3D::sms, SmoothViewStore::time_allowed, TIMER1, SmoothViewStore::to_camera, TRUE, U, RegionView3D::view, view3d_boxview_copy(), RegionView3D::viewlock, RegionView3D::viewquat, WM_event_add_timer(), and WM_event_remove_timer().
Referenced by axis_set_view(), obmat_to_viewmat(), view3d_align_axis_to_vector(), view3d_all_exec(), view3d_setobjectascamera_exec(), view3d_zoom_border_exec(), viewcenter_cursor_exec(), viewnumpad_exec(), vieworbit_exec(), and viewselected_exec().
void view3d_align_axis_to_vector | ( | View3D * | v3d, |
RegionView3D * | rv3d, | ||
int | axisidx, | ||
float | vec[3] | ||
) |
Definition at line 1809 of file view3d_view.c.
References acos(), angle(), axis_angle_to_quat(), View3D::camera, copy_v3_v3(), cross_v3_v3v3(), RegionView3D::dist, dot_v3v3(), ED_view3d_from_object(), View3D::lens, norm(), normalize_v3_v3(), NULL, RegionView3D::ofs, RegionView3D::persp, RV3D_CAMOB, RV3D_PERSP, RV3D_VIEW_USER, smooth_view(), and RegionView3D::view.
static int view3d_camera_to_view_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 345 of file view3d_view.c.
References View3D::camera, copy_qt_qt(), CTX_wm_region_view3d(), CTX_wm_view3d(), DAG_id_tag_update(), RegionView3D::dist, ED_view3d_to_object(), Object::id, RegionView3D::lpersp, RegionView3D::lview, RegionView3D::lviewquat, NC_OBJECT, ND_TRANSFORM, OB_RECALC_OB, object_tfm_protected_backup(), object_tfm_protected_restore(), RegionView3D::ofs, OPERATOR_FINISHED, RegionView3D::persp, Object::protectflag, RV3D_CAMOB, RegionView3D::view, RegionView3D::viewquat, and WM_event_add_notifier().
Referenced by VIEW3D_OT_camera_to_view().
static int view3d_camera_to_view_poll | ( | bContext * | C | ) | [static] |
Definition at line 372 of file view3d_view.c.
References View3D::camera, CTX_wm_region_view3d(), CTX_wm_view3d(), Object::id, ID::lib, NULL, and RegionView3D::viewlock.
Referenced by VIEW3D_OT_camera_to_view().
static int view3d_camera_to_view_selected_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 402 of file view3d_view.c.
References View3D::camera, camera_view_frame_fit_to_scene(), copy_m4_m4(), copy_v3_v3(), CTX_data_scene(), CTX_wm_view3d(), DAG_id_tag_update(), Object::id, NC_OBJECT, ND_TRANSFORM, OB_LOCK_ROT4D, OB_LOCK_SCALE, OB_RECALC_OB, object_apply_mat4(), object_tfm_protected_backup(), object_tfm_protected_restore(), Object::obmat, OPERATOR_CANCELLED, OPERATOR_FINISHED, TRUE, and WM_event_add_notifier().
Referenced by VIEW3D_OT_camera_to_view_selected().
static int view3d_camera_to_view_selected_poll | ( | bContext * | C | ) | [static] |
Definition at line 434 of file view3d_view.c.
References View3D::camera, CTX_wm_operator_poll_msg_set(), CTX_wm_region_view3d(), CTX_wm_view3d(), FALSE, Object::id, RegionView3D::is_persp, ID::lib, NULL, and RegionView3D::viewlock.
Referenced by VIEW3D_OT_camera_to_view_selected().
short view3d_opengl_select | ( | ViewContext * | vc, |
unsigned int * | buffer, | ||
unsigned int | bufsize, | ||
rcti * | input | ||
) |
Definition at line 1181 of file view3d_view.c.
References ViewContext::ar, BASACT, Scene::base, BDR_drawSketchNames(), copy_m4_m4(), DRAW_CONSTCOLOR, draw_object(), DRAW_PICKING, View3D::drawtype, Object::dt, Object::dtx, Object::dup_group, FALSE, ListBase::first, Base::flag, free_object_duplilist(), G, G_PICKSEL, View3D::lay, Base::lay, DupliObject::mat, MIN2, mult_m4_m4m4(), DupliObject::next, Base::next, NULL, DupliObject::ob, OB_ARMATURE, OB_DUPLI, OB_FROMDUPLI, OB_MBALL, OB_RESTRICT_SELECT, OB_WIRE, ViewContext::obedit, Base::object, object_duplilist(), Object::obmat, DupliObject::omat, RegionView3D::persmat, Object::restrictflag, RegionView3D::rflag, ViewContext::rv3d, RV3D_CLIPPING, ViewContext::scene, Base::selcol, setwinmatrixview3d(), Object::transflag, TRUE, Object::type, ViewContext::v3d, view3d_clr_clipping(), view3d_set_clipping(), RegionView3D::viewmat, RegionView3D::winmat, rctf::xmax, rcti::xmax, rctf::xmin, rcti::xmin, View3D::xray, rcti::ymax, rctf::ymax, rcti::ymin, rctf::ymin, and View3D::zbuf.
Referenced by do_armature_box_select(), do_meta_box_select(), do_object_pose_box_select(), get_nearest_bone(), get_nearest_editbonepoint(), mixed_bones_object_selectbuffer(), mouse_mball(), and sk_selectStroke().
void view3d_operator_needs_opengl | ( | const bContext * | C | ) |
Definition at line 76 of file view3d_view.c.
References CTX_wm_region(), CTX_wm_window(), and view3d_region_operator_needs_opengl().
void VIEW3D_OT_camera_to_view | ( | wmOperatorType * | ot | ) |
Definition at line 385 of file view3d_view.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, view3d_camera_to_view_exec(), and view3d_camera_to_view_poll().
Referenced by view3d_operatortypes().
void VIEW3D_OT_camera_to_view_selected | ( | wmOperatorType * | ot | ) |
Definition at line 452 of file view3d_view.c.
References wmOperatorType::description, wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, view3d_camera_to_view_selected_exec(), and view3d_camera_to_view_selected_poll().
Referenced by view3d_operatortypes().
void VIEW3D_OT_game_start | ( | wmOperatorType * | ot | ) |
Definition at line 1793 of file view3d_view.c.
References wmOperatorType::description, wmOperatorType::exec, game_engine_exec(), game_engine_poll(), wmOperatorType::idname, wmOperatorType::name, and wmOperatorType::poll.
Referenced by view3d_operatortypes().
void VIEW3D_OT_localview | ( | wmOperatorType * | ot | ) |
Definition at line 1559 of file view3d_view.c.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, localview_exec(), wmOperatorType::name, OPTYPE_UNDO, and wmOperatorType::poll.
Referenced by view3d_operatortypes().
void VIEW3D_OT_object_as_camera | ( | wmOperatorType * | ot | ) |
Definition at line 505 of file view3d_view.c.
References wmOperatorType::description, ED_operator_rv3d_user_region_poll(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, wmOperatorType::poll, and view3d_setobjectascamera_exec().
Referenced by view3d_operatortypes().
void VIEW3D_OT_smoothview | ( | wmOperatorType * | ot | ) |
Definition at line 329 of file view3d_view.c.
References wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, wmOperatorType::poll, and view3d_smoothview_invoke().
Referenced by view3d_operatortypes().
Definition at line 84 of file view3d_view.c.
References glLoadMatrixf, NULL, ARegion::regiondata, ARegion::regiontype, RGN_TYPE_WINDOW, ARegion::swinid, RegionView3D::viewmat, RegionView3D::winmat, and wmSubWindowSet().
Referenced by gp_paint_strokeend(), gp_stroke_addpoint(), and view3d_operator_needs_opengl().
static int view3d_setobjectascamera_exec | ( | bContext * | C, |
wmOperator * | UNUSEDop | ||
) | [static] |
Definition at line 468 of file view3d_view.c.
References Scene::camera, View3D::camera, CTX_data_active_object(), CTX_data_scene(), RegionView3D::dist, ED_view3d_context_user_region(), View3D::lens, NC_OBJECT, NC_SCENE, ND_DRAW, ND_RENDER_OPTIONS, NULL, RegionView3D::ofs, OPERATOR_FINISHED, RegionView3D::persp, ARegion::regiondata, RV3D_CAMOB, View3D::scenelock, smooth_view(), V3D_CAMERA_SCENE, RegionView3D::viewquat, and WM_event_add_notifier().
Referenced by VIEW3D_OT_object_as_camera().
static int view3d_smoothview_invoke | ( | bContext * | C, |
wmOperator * | UNUSEDop, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 254 of file view3d_view.c.
References copy_qt_qt(), copy_v3_v3(), CTX_wm_area(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_view3d(), CTX_wm_window(), wmEvent::customdata, RegionView3D::dist, wmTimer::duration, ED_view3d_camera_lock_sync(), i, interp_qt_qtqt(), View3D::lens, MEM_freeN(), NC_SPACE, ND_SPACE_VIEW3D, SmoothViewStore::new_dist, SmoothViewStore::new_lens, SmoothViewStore::new_ofs, SmoothViewStore::new_quat, NULL, RegionView3D::ofs, OPERATOR_FINISHED, OPERATOR_PASS_THROUGH, SmoothViewStore::orig_dist, SmoothViewStore::orig_lens, SmoothViewStore::orig_ofs, SmoothViewStore::orig_quat, SmoothViewStore::orig_view, RegionView3D::persp, pow(), powf, RegionView3D::rflag, RV3D_BOXVIEW, RV3D_CAMOB, RV3D_LOCKED, RV3D_NAVIGATING, RegionView3D::smooth_timer, RegionView3D::sms, step(), SmoothViewStore::time_allowed, SmoothViewStore::to_camera, RegionView3D::view, view3d_boxview_copy(), RegionView3D::viewlock, RegionView3D::viewquat, WM_event_add_notifier(), and WM_event_remove_timer().
Referenced by VIEW3D_OT_smoothview().