|
Blender V4.3
|
#include "DNA_object_types.h"#include "MEM_guardedalloc.h"#include "BLI_math_matrix.h"#include "BLI_math_rotation.h"#include "BLI_rect.h"#include "BLI_time.h"#include "BKE_context.hh"#include "BKE_lib_id.hh"#include "BKE_report.hh"#include "WM_api.hh"#include "WM_types.hh"#include "ED_screen.hh"#include "ED_space_api.hh"#include "ED_undo.hh"#include "UI_resources.hh"#include "GPU_immediate.hh"#include "view3d_intern.hh"#include "view3d_navigate.hh"#include "BLI_strict_flags.h"Go to the source code of this file.
Classes | |
| struct | FlyInfo |
Macros | |
| #define | FLY_ROTATE_FAC 10.0f /* More is faster. */ |
| #define | FLY_ZUP_CORRECT_FAC 0.1f /* Amount to correct per step. */ |
| #define | FLY_ZUP_CORRECT_ACCEL 0.05f /* Increase upright momentum each step. */ |
| #define | FLY_SMOOTH_FAC 20.0f /* Higher value less lag. */ |
Functions | |
Internal Fly Drawing | |
| static int | flyApply (bContext *C, FlyInfo *fly, bool is_confirm) |
| static void | drawFlyPixel (const bContext *, ARegion *, void *arg) |
Fly Operator | |
| static int | fly_invoke (bContext *C, wmOperator *op, const wmEvent *event) |
| static void | fly_cancel (bContext *C, wmOperator *op) |
| static int | fly_modal (bContext *C, wmOperator *op, const wmEvent *event) |
| void | VIEW3D_OT_fly (wmOperatorType *ot) |
Modal Key-map | |
| enum | { FLY_MODAL_CANCEL = 1 , FLY_MODAL_CONFIRM , FLY_MODAL_ACCELERATE , FLY_MODAL_DECELERATE , FLY_MODAL_PAN_ENABLE , FLY_MODAL_PAN_DISABLE , FLY_MODAL_DIR_FORWARD , FLY_MODAL_DIR_BACKWARD , FLY_MODAL_DIR_LEFT , FLY_MODAL_DIR_RIGHT , FLY_MODAL_DIR_UP , FLY_MODAL_DIR_DOWN , FLY_MODAL_AXIS_LOCK_X , FLY_MODAL_AXIS_LOCK_Z , FLY_MODAL_PRECISION_ENABLE , FLY_MODAL_PRECISION_DISABLE , FLY_MODAL_FREELOOK_ENABLE , FLY_MODAL_FREELOOK_DISABLE , FLY_MODAL_SPEED } |
| enum | eFlyPanState { FLY_AXISLOCK_STATE_OFF = 0 , FLY_AXISLOCK_STATE_IDLE = 1 , FLY_AXISLOCK_STATE_ACTIVE = 2 } |
| void | fly_modal_keymap (wmKeyConfig *keyconf) |
Internal Fly Logic | |
| enum | { FLY_RUNNING = 0 , FLY_CANCEL = 1 , FLY_CONFIRM = 2 } |
| static bool | initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, const wmEvent *event) |
| static int | flyEnd (bContext *C, FlyInfo *fly) |
| static void | flyEvent (FlyInfo *fly, const wmEvent *event) |
| static void | flyMoveCamera (bContext *C, FlyInfo *fly, const bool do_rotate, const bool do_translate, const bool is_confirm) |
Interactive fly navigation modal operator (flying around in space).
Defines VIEW3D_OT_fly modal operator.
view3d_navigate_walk.cc changes here may apply there too. Definition in file view3d_navigate_fly.cc.
| #define FLY_ROTATE_FAC 10.0f /* More is faster. */ |
Referenced by flyApply().
| #define FLY_SMOOTH_FAC 20.0f /* Higher value less lag. */ |
Referenced by flyApply().
| #define FLY_ZUP_CORRECT_ACCEL 0.05f /* Increase upright momentum each step. */ |
Referenced by flyApply().
| #define FLY_ZUP_CORRECT_FAC 0.1f /* Amount to correct per step. */ |
Referenced by flyApply().
| anonymous enum |
Definition at line 56 of file view3d_navigate_fly.cc.
| anonymous enum |
| Enumerator | |
|---|---|
| FLY_RUNNING | |
| FLY_CANCEL | |
| FLY_CONFIRM | |
Definition at line 294 of file view3d_navigate_fly.cc.
| enum eFlyPanState |
Relative view axis locking - xlock, zlock.
| Enumerator | |
|---|---|
| FLY_AXISLOCK_STATE_OFF | Disabled. |
| FLY_AXISLOCK_STATE_IDLE | Enabled but not checking because mouse hasn't moved outside the margin since locking was checked an not needed when the mouse moves, locking is set to 2 so checks are done. |
| FLY_AXISLOCK_STATE_ACTIVE | Mouse moved and checking needed, if no view altering is done its changed back to FLY_AXISLOCK_STATE_IDLE. |
Definition at line 79 of file view3d_navigate_fly.cc.
Definition at line 221 of file view3d_navigate_fly.cc.
References FlyInfo::depsgraph, ED_view3d_calc_camera_border(), ED_view3d_cameracontrol_object_get(), float, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_PRIM_LINES, GPU_SHADER_3D_UNIFORM_COLOR, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniformThemeColor3(), immVertex2f(), immVertexFormat(), int, pos, FlyInfo::region, FlyInfo::rv3d, FlyInfo::scene, TH_VIEW_OVERLAY, FlyInfo::v3d, FlyInfo::v3d_camera_control, FlyInfo::viewport_size, rctf::xmin, and rctf::ymin.
Referenced by initFlyInfo().
|
static |
Definition at line 1084 of file view3d_navigate_fly.cc.
References wmOperator::customdata, FLY_CANCEL, flyEnd(), and FlyInfo::state.
Referenced by VIEW3D_OT_fly().
|
static |
Definition at line 1060 of file view3d_navigate_fly.cc.
References CTX_wm_region_view3d(), wmOperator::customdata, flyEvent(), initFlyInfo(), MEM_freeN(), OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, RV3D_LOCK_ANY_TRANSFORM, RV3D_LOCK_FLAGS, and WM_event_add_modal_handler().
Referenced by VIEW3D_OT_fly().
|
static |
Definition at line 1093 of file view3d_navigate_fly.cc.
References CTX_wm_region(), wmEvent::customdata, wmOperator::customdata, ED_region_tag_redraw(), ED_undo_is_memfile_compatible(), ED_undo_push(), ED_view3d_camera_lock_undo_push(), ED_view3d_cameracontrol_object_get(), flyApply(), flyEnd(), flyEvent(), wmOperatorType::name, NC_OBJECT, ND_TRANSFORM, NDOF_MOTION, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, RegionView3D::persp, FlyInfo::redraw, FlyInfo::rv3d, RV3D_CAMOB, TIMER, FlyInfo::timer, wmEvent::type, wmOperator::type, FlyInfo::v3d, FlyInfo::v3d_camera_control, and WM_event_add_notifier().
Referenced by VIEW3D_OT_fly().
| void fly_modal_keymap | ( | wmKeyConfig * | keyconf | ) |
Definition at line 94 of file view3d_navigate_fly.cc.
References FLY_MODAL_ACCELERATE, FLY_MODAL_AXIS_LOCK_X, FLY_MODAL_AXIS_LOCK_Z, FLY_MODAL_CANCEL, FLY_MODAL_CONFIRM, FLY_MODAL_DECELERATE, FLY_MODAL_DIR_BACKWARD, FLY_MODAL_DIR_DOWN, FLY_MODAL_DIR_FORWARD, FLY_MODAL_DIR_LEFT, FLY_MODAL_DIR_RIGHT, FLY_MODAL_DIR_UP, FLY_MODAL_FREELOOK_DISABLE, FLY_MODAL_FREELOOK_ENABLE, FLY_MODAL_PAN_DISABLE, FLY_MODAL_PAN_ENABLE, FLY_MODAL_PRECISION_DISABLE, FLY_MODAL_PRECISION_ENABLE, wmKeyMap::modal_items, WM_modalkeymap_assign(), WM_modalkeymap_ensure(), and WM_modalkeymap_find().
Referenced by view3d_keymap().
Definition at line 761 of file view3d_navigate_fly.cc.
References add_v3_v3(), FlyInfo::axis, axis_angle_to_quat(), BLI_time_now_seconds(), FlyInfo::center_mval, copy_m3_m4(), copy_v3_fl3(), copy_v3_v3(), FlyInfo::dvec_prev, fabsf, float, FLY_AXISLOCK_STATE_ACTIVE, FLY_AXISLOCK_STATE_IDLE, FLY_AXISLOCK_STATE_OFF, FLY_ROTATE_FAC, FLY_SMOOTH_FAC, FLY_ZUP_CORRECT_ACCEL, FLY_ZUP_CORRECT_FAC, flyMoveCamera(), FlyInfo::grid, interp_v3_v3v3(), min_ff(), mul_m3_v3(), mul_qt_qtqt(), mul_v3_fl(), FlyInfo::mval, negate_v3(), normalize_v3_v3(), RegionView3D::ofs, OPERATOR_FINISHED, FlyInfo::pan_view, RegionView3D::persp, printf, FlyInfo::redraw, FlyInfo::rv3d, RV3D_CAMOB, FlyInfo::speed, FlyInfo::time_lastdraw, FlyInfo::use_freelook, FlyInfo::use_precision, RegionView3D::viewinv, FlyInfo::viewport_size, RegionView3D::viewquat, FlyInfo::xlock, FlyInfo::xlock_momentum, zero_v3(), FlyInfo::zlock, and FlyInfo::zlock_momentum.
Referenced by fly_modal(), and flyEnd().
Definition at line 415 of file view3d_navigate_fly.cc.
References CTX_wm_manager(), CTX_wm_window(), FlyInfo::draw_handle_pixel, ED_region_draw_cb_exit(), ED_view3d_cameracontrol_release(), FLY_CANCEL, FLY_CONFIRM, FLY_RUNNING, flyApply(), MEM_freeN(), OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, FlyInfo::region, RegionView3D::rflag, FlyInfo::rv3d, FlyInfo::state, FlyInfo::timer, ARegion::type, FlyInfo::v3d_camera_control, and WM_event_timer_remove().
Referenced by fly_cancel(), and fly_modal().
Definition at line 466 of file view3d_navigate_fly.cc.
References FlyInfo::axis, BLI_time_now_seconds(), copy_v2_v2_int(), wmEvent::customdata, EVT_MODAL_MAP, fabsf, float, FLY_AXISLOCK_STATE_ACTIVE, FLY_AXISLOCK_STATE_OFF, FLY_CANCEL, FLY_CONFIRM, FLY_MODAL_ACCELERATE, FLY_MODAL_AXIS_LOCK_X, FLY_MODAL_AXIS_LOCK_Z, FLY_MODAL_CANCEL, FLY_MODAL_CONFIRM, FLY_MODAL_DECELERATE, FLY_MODAL_DIR_BACKWARD, FLY_MODAL_DIR_DOWN, FLY_MODAL_DIR_FORWARD, FLY_MODAL_DIR_LEFT, FLY_MODAL_DIR_RIGHT, FLY_MODAL_DIR_UP, FLY_MODAL_FREELOOK_DISABLE, FLY_MODAL_FREELOOK_ENABLE, FLY_MODAL_PAN_DISABLE, FLY_MODAL_PAN_ENABLE, FLY_MODAL_PRECISION_DISABLE, FLY_MODAL_PRECISION_ENABLE, FLY_MODAL_SPEED, FlyInfo::grid, MEM_dupallocN, MEM_freeN(), min_ff(), MOUSEMOVE, FlyInfo::mval, wmEvent::mval, NDOF_MOTION, P_FINISHING, P_IN_PROGRESS, P_STARTING, FlyInfo::pan_view, wmEvent::prev_xy, FlyInfo::redraw, FlyInfo::speed, FlyInfo::state, FlyInfo::time_lastdraw, FlyInfo::time_lastwheel, TIMER, FlyInfo::timer, wmEvent::type, FlyInfo::use_freelook, FlyInfo::use_precision, wmEvent::val, FlyInfo::xlock, FlyInfo::xlock_momentum, wmEvent::xy, FlyInfo::zlock, and FlyInfo::zlock_momentum.
Referenced by fly_invoke(), and fly_modal().
|
static |
Definition at line 749 of file view3d_navigate_fly.cc.
References FlyInfo::anim_playing, ED_view3d_cameracontrol_update(), and FlyInfo::v3d_camera_control.
Referenced by flyApply().
|
static |
Definition at line 300 of file view3d_navigate_fly.cc.
References FlyInfo::anim_playing, FlyInfo::axis, BKE_id_is_editable(), BKE_report(), BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_time_now_seconds(), View3D::camera, FlyInfo::center_mval, Object::constraints, copy_m3_m4(), copy_v2_v2_int(), copy_v3_fl3(), CTX_data_expect_evaluated_depsgraph(), CTX_data_main(), CTX_data_scene(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_view3d(), CTX_wm_window(), FlyInfo::depsgraph, FlyInfo::draw_handle_pixel, drawFlyPixel(), FlyInfo::dvec_prev, ED_region_draw_cb_activate(), ED_screen_animation_playing(), ED_view3d_calc_camera_border(), ED_view3d_cameracontrol_acquire(), ED_view3d_cameracontrol_object_get(), ED_view3d_offset_lock_check(), fabsf, ListBase::first, FLY_AXISLOCK_STATE_IDLE, FLY_AXISLOCK_STATE_OFF, FLY_RUNNING, FlyInfo::grid, Object::id, int, mul_m3_v3(), FlyInfo::mval, wmEvent::mval, FlyInfo::pan_view, RegionView3D::persp, FlyInfo::redraw, FlyInfo::region, REGION_DRAW_POST_PIXEL, wmOperator::reports, RegionView3D::rflag, RPT_ERROR, FlyInfo::rv3d, RV3D_CAMOB, RV3D_NAVIGATING, RV3D_PERSP, FlyInfo::scene, FlyInfo::speed, FlyInfo::state, FlyInfo::time_lastdraw, FlyInfo::time_lastwheel, TIMER, FlyInfo::timer, ARegion::type, FlyInfo::use_freelook, FlyInfo::use_precision, FlyInfo::v3d, FlyInfo::v3d_camera_control, RegionView3D::viewinv, FlyInfo::viewport_size, ARegion::winrct, ARegion::winx, ARegion::winy, WM_cursor_warp(), WM_event_timer_add(), FlyInfo::xlock, FlyInfo::xlock_momentum, rctf::xmin, rcti::xmin, rctf::ymin, rcti::ymin, zero_v3(), FlyInfo::zlock, and FlyInfo::zlock_momentum.
Referenced by fly_invoke().
| void VIEW3D_OT_fly | ( | wmOperatorType * | ot | ) |
Definition at line 1146 of file view3d_navigate_fly.cc.
References wmOperatorType::cancel, wmOperatorType::description, ED_operator_region_view3d_active(), wmOperatorType::flag, fly_cancel(), fly_invoke(), fly_modal(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, ot, and wmOperatorType::poll.
Referenced by view3d_operatortypes().