Blender V2.61 - r43446
|
#include "DNA_anim_types.h"
#include "DNA_scene_types.h"
#include "DNA_object_types.h"
#include "DNA_camera_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BLI_blenlib.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_depsgraph.h"
#include "BIF_gl.h"
#include "WM_api.h"
#include "WM_types.h"
#include "ED_keyframing.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "PIL_time.h"
#include "view3d_intern.h"
Go to the source code of this file.
Definition in file view3d_fly.c.
#define FLY_CANCEL 1 |
Definition at line 266 of file view3d_fly.c.
Referenced by fly_cancel(), flyEnd(), and flyEvent().
#define FLY_CONFIRM 2 |
Definition at line 267 of file view3d_fly.c.
Referenced by flyEnd(), and flyEvent().
#define FLY_ROTATE_FAC 2.5f |
Referenced by flyApply().
#define FLY_RUNNING 0 |
Definition at line 265 of file view3d_fly.c.
Referenced by flyEnd(), and initFlyInfo().
#define FLY_ZUP_CORRECT_ACCEL 0.05f |
Referenced by flyApply().
#define FLY_ZUP_CORRECT_FAC 0.1f |
Referenced by flyApply().
anonymous enum |
Definition at line 64 of file view3d_fly.c.
static void drawFlyPixel | ( | const struct bContext * | UNUSEDC, |
struct ARegion * | UNUSEDar, | ||
void * | arg | ||
) | [static] |
Definition at line 218 of file view3d_fly.c.
References FlyInfo::ar, cpack, ARegion::winx, and ARegion::winy.
Referenced by initFlyInfo().
static int fly_cancel | ( | bContext * | C, |
wmOperator * | op | ||
) | [static] |
Definition at line 1131 of file view3d_fly.c.
References wmOperator::customdata, FLY_CANCEL, flyEnd(), NULL, OPERATOR_CANCELLED, and FlyInfo::state.
Referenced by VIEW3D_OT_fly().
static int fly_invoke | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 1107 of file view3d_fly.c.
References CTX_wm_region_view3d(), wmOperator::customdata, FALSE, flyEvent(), initFlyInfo(), MEM_callocN(), MEM_freeN(), OPERATOR_CANCELLED, OPERATOR_RUNNING_MODAL, RegionView3D::viewlock, and WM_event_add_modal_handler().
Referenced by VIEW3D_OT_fly().
static int fly_modal | ( | bContext * | C, |
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 1142 of file view3d_fly.c.
References View3D::camera, CTX_wm_region(), wmEvent::customdata, wmOperator::customdata, ED_region_tag_redraw(), FALSE, flyApply(), flyApply_ndof(), flyEnd(), flyEvent(), NC_OBJECT, ND_TRANSFORM, FlyInfo::ndof, NDOF_MOTION, OPERATOR_RUNNING_MODAL, RegionView3D::persp, FlyInfo::redraw, FlyInfo::root_parent, FlyInfo::rv3d, RV3D_CAMOB, FlyInfo::timer, TIMER, TRUE, wmEvent::type, FlyInfo::v3d, and WM_event_add_notifier().
Referenced by VIEW3D_OT_fly().
void fly_modal_keymap | ( | wmKeyConfig * | keyconf | ) |
Definition at line 87 of file view3d_fly.c.
References AKEY, DKEY, ESCKEY, FKEY, 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, KM_ANY, KM_PRESS, KM_RELEASE, LEFTCTRLKEY, LEFTMOUSE, LEFTSHIFTKEY, MIDDLEMOUSE, NULL, PADENTER, PADMINUS, PADPLUSKEY, RETKEY, RIGHTMOUSE, RKEY, SKEY, SPACEKEY, WHEELDOWNMOUSE, WHEELUPMOUSE, WKEY, WM_modalkeymap_add(), WM_modalkeymap_add_item(), WM_modalkeymap_assign(), WM_modalkeymap_get(), XKEY, and ZKEY.
Referenced by view3d_keymap().
Definition at line 713 of file view3d_fly.c.
References add_v3_v3(), FlyInfo::ar, FlyInfo::axis, axis_angle_to_quat(), View3D::camera, copy_m3_m4(), copy_v3_v3(), FlyInfo::dvec_prev, ED_area_headerprint(), fabsf, FLY_ROTATE_FAC, FLY_ZUP_CORRECT_ACCEL, FLY_ZUP_CORRECT_FAC, FlyInfo::grid, interp_v3_v3v3(), MIN2, move_camera(), mul_m3_v3(), mul_qt_qtqt(), mul_v3_fl(), FlyInfo::mval, negate_v3(), normalize_v3_v3(), OB_LOCK_LOCX, OB_LOCK_LOCY, OB_LOCK_LOCZ, RegionView3D::ofs, OPERATOR_FINISHED, FlyInfo::pan_view, RegionView3D::persp, PIL_check_seconds_timer(), Object::protectflag, FlyInfo::redraw, FlyInfo::root_parent, FlyInfo::rv3d, RV3D_CAMOB, FlyInfo::speed, FlyInfo::time_lastdraw, TRUE, FlyInfo::use_freelook, FlyInfo::use_precision, FlyInfo::v3d, RegionView3D::viewinv, RegionView3D::viewquat, ARegion::winx, ARegion::winy, FlyInfo::xlock, FlyInfo::xlock_momentum, FlyInfo::zlock, and FlyInfo::zlock_momentum.
Referenced by fly_modal().
Definition at line 979 of file view3d_fly.c.
References angle(), asinf, axis_angle_to_quat(), View3D::camera, wmNDOFMotionData::dt, fabsf, FALSE, invert_qt_qt(), is_zero_v3(), move_camera(), mul_qt_qtqt(), mul_qt_v3(), mul_v3_fl(), FlyInfo::ndof, UserDef::ndof_flag, NDOF_FLY_HELICOPTER, NDOF_LOCK_HORIZON, ndof_to_axis_angle(), OB_LOCK_LOCX, OB_LOCK_LOCY, OB_LOCK_LOCZ, RegionView3D::ofs, OPERATOR_FINISHED, FlyInfo::pan_view, RegionView3D::persp, Object::protectflag, RAD2DEG, FlyInfo::redraw, FlyInfo::root_parent, RegionView3D::rot_angle, FlyInfo::rv3d, RV3D_CAMOB, RV3D_VIEW_USER, sub_v3_v3(), TRUE, wmNDOFMotionData::tvec, U, FlyInfo::use_precision, FlyInfo::v3d, RegionView3D::view, and RegionView3D::viewquat.
Referenced by fly_modal().
Definition at line 397 of file view3d_fly.c.
References add_v3_v3(), FlyInfo::ar, CAM_ORTHO, View3D::camera, copy_m3_m4(), copy_qt_qt(), copy_v3_v3(), CTX_wm_manager(), CTX_wm_window(), DAG_id_tag_update(), Object::data, RegionView3D::dist, FlyInfo::dist_backup, FlyInfo::draw_handle_pixel, ED_region_draw_cb_exit(), FLY_CANCEL, FLY_CONFIRM, FLY_RUNNING, Object::id, FlyInfo::is_ortho_cam, MEM_freeN(), mul_m3_v3(), FlyInfo::ndof, OB_RECALC_OB, object_tfm_restore(), FlyInfo::obtfm, RegionView3D::ofs, FlyInfo::ofs_backup, OPERATOR_CANCELLED, OPERATOR_FINISHED, OPERATOR_RUNNING_MODAL, RegionView3D::persp, FlyInfo::persp_backup, RegionView3D::rflag, FlyInfo::root_parent, FlyInfo::rot_backup, FlyInfo::rv3d, RV3D_CAMOB, RV3D_NAVIGATING, FlyInfo::state, FlyInfo::timer, ARegion::type, FlyInfo::v3d, RegionView3D::viewinv, RegionView3D::viewquat, and WM_event_remove_timer().
Referenced by fly_cancel(), and fly_modal().
Definition at line 472 of file view3d_fly.c.
References FlyInfo::axis, copy_v2_v2_int(), wmEvent::customdata, EVT_MODAL_MAP, FALSE, 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, FlyInfo::grid, MEM_dupallocN(), MEM_freeN(), MIN2, MOUSEMOVE, wmEvent::mval, FlyInfo::mval, FlyInfo::ndof, NDOF_MOTION, NULL, P_FINISHING, P_IN_PROGRESS, P_STARTING, FlyInfo::pan_view, PIL_check_seconds_timer(), wmNDOFMotionData::progress, FlyInfo::redraw, FlyInfo::speed, FlyInfo::state, FlyInfo::time_lastdraw, FlyInfo::time_lastwheel, FlyInfo::timer, TIMER, TRUE, wmEvent::type, FlyInfo::use_freelook, FlyInfo::use_precision, wmEvent::val, FlyInfo::xlock, FlyInfo::xlock_momentum, FlyInfo::zlock, and FlyInfo::zlock_momentum.
Referenced by fly_invoke(), and fly_modal().
static int initFlyInfo | ( | bContext * | C, |
FlyInfo * | fly, | ||
wmOperator * | op, | ||
wmEvent * | event | ||
) | [static] |
Definition at line 269 of file view3d_fly.c.
References FlyInfo::ar, FlyInfo::axis, BKE_report(), CAM_PERSP, View3D::camera, Object::constraints, copy_m3_m4(), copy_qt_qt(), copy_v2_v2_int(), copy_v3_v3(), CTX_data_scene(), CTX_wm_manager(), CTX_wm_region(), CTX_wm_region_view3d(), CTX_wm_view3d(), CTX_wm_window(), Object::data, RegionView3D::dist, FlyInfo::dist_backup, FlyInfo::draw_handle_pixel, drawFlyPixel(), FlyInfo::dvec_prev, ED_region_draw_cb_activate(), fabs(), FALSE, ListBase::first, FLY_RUNNING, FlyInfo::grid, Object::id, FlyInfo::is_ortho_cam, RegionView3D::is_persp, ID::lib, mul_m3_v3(), wmEvent::mval, FlyInfo::mval, FlyInfo::ndof, negate_v3_v3(), NULL, View3D::ob_centre, object_tfm_backup(), Object::obmat, FlyInfo::obtfm, RegionView3D::ofs, FlyInfo::ofs_backup, FlyInfo::pan_view, Object::parent, RegionView3D::persp, FlyInfo::persp_backup, PIL_check_seconds_timer(), FlyInfo::redraw, REGION_DRAW_POST_PIXEL, wmOperator::reports, RegionView3D::rflag, FlyInfo::root_parent, FlyInfo::rot_backup, RPT_ERROR, FlyInfo::rv3d, RV3D_CAMOB, RV3D_NAVIGATING, RV3D_ORTHO, RV3D_PERSP, FlyInfo::scene, FlyInfo::speed, FlyInfo::state, sub_v3_v3(), FlyInfo::time_lastdraw, FlyInfo::time_lastwheel, TIMER, FlyInfo::timer, TRUE, ARegion::type, U, UserDef::uiflag, FlyInfo::use_freelook, FlyInfo::use_precision, USER_CAM_LOCK_NO_PARENT, FlyInfo::v3d, RegionView3D::viewinv, RegionView3D::viewquat, where_is_object(), ARegion::winrct, ARegion::winx, ARegion::winy, WM_cursor_warp(), WM_event_add_timer(), FlyInfo::xlock, FlyInfo::xlock_momentum, rcti::xmin, rcti::ymin, FlyInfo::zlock, and FlyInfo::zlock_momentum.
Referenced by fly_invoke().
static void move_camera | ( | bContext * | C, |
RegionView3D * | rv3d, | ||
FlyInfo * | fly, | ||
int | orientationChanged, | ||
int | positionChanged | ||
) | [static] |
Definition at line 645 of file view3d_fly.c.
References ANIM_apply_keyingset(), ANIM_builtin_keyingset_get_named(), ANIM_KS_LOCATION_ID, ANIM_KS_ROTATION_ID, ANIM_relative_keyingset_add_source(), autokeyframe_cfra_can_key(), BLI_freelistN(), View3D::camera, CFRA, DAG_id_tag_update(), RegionView3D::dist, ED_view3d_to_m4(), FALSE, Object::id, invert_m4_m4(), MODIFYKEY_MODE_INSERT, mult_m4_m4m4(), NULL, OB_RECALC_OB, object_apply_mat4(), Object::obmat, RegionView3D::ofs, Object::parent, FlyInfo::root_parent, FlyInfo::rv3d, FlyInfo::scene, TRUE, FlyInfo::v3d, and RegionView3D::viewquat.
Referenced by flyApply(), and flyApply_ndof().
void VIEW3D_OT_fly | ( | wmOperatorType * | ot | ) |
Definition at line 1182 of file view3d_fly.c.
References wmOperatorType::cancel, wmOperatorType::description, ED_operator_view3d_active(), wmOperatorType::flag, fly_cancel(), fly_invoke(), fly_modal(), wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::modal, wmOperatorType::name, OPTYPE_BLOCKING, and wmOperatorType::poll.
Referenced by view3d_operatortypes().