Blender V2.61 - r43446
Classes | Defines | Typedefs | Enumerations | Functions

view3d_fly.c File Reference

#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.

Classes

struct  FlyInfo

Defines

#define FLY_RUNNING   0
#define FLY_CANCEL   1
#define FLY_CONFIRM   2
#define FLY_ROTATE_FAC   2.5f
#define FLY_ZUP_CORRECT_FAC   0.1f
#define FLY_ZUP_CORRECT_ACCEL   0.05f

Typedefs

typedef struct FlyInfo FlyInfo

Enumerations

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
}

Functions

void fly_modal_keymap (wmKeyConfig *keyconf)
static void drawFlyPixel (const struct bContext *UNUSED(C), struct ARegion *UNUSED(ar), void *arg)
static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *event)
static int flyEnd (bContext *C, FlyInfo *fly)
static void flyEvent (FlyInfo *fly, wmEvent *event)
static void move_camera (bContext *C, RegionView3D *rv3d, FlyInfo *fly, int orientationChanged, int positionChanged)
static int flyApply (bContext *C, FlyInfo *fly)
static int flyApply_ndof (bContext *C, FlyInfo *fly)
static int fly_invoke (bContext *C, wmOperator *op, wmEvent *event)
static int fly_cancel (bContext *C, wmOperator *op)
static int fly_modal (bContext *C, wmOperator *op, wmEvent *event)
void VIEW3D_OT_fly (wmOperatorType *ot)

Detailed Description

Definition in file view3d_fly.c.


Define Documentation

#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().


Typedef Documentation

typedef struct FlyInfo FlyInfo

Enumeration Type Documentation

anonymous enum
Enumerator:
FLY_MODAL_CANCEL 
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 

Definition at line 64 of file view3d_fly.c.


Function Documentation

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]
static int fly_modal ( bContext C,
wmOperator op,
wmEvent event 
) [static]
void fly_modal_keymap ( wmKeyConfig keyconf)
static int flyApply ( bContext C,
FlyInfo fly 
) [static]
static int flyApply_ndof ( bContext C,
FlyInfo fly 
) [static]
static int flyEnd ( bContext C,
FlyInfo fly 
) [static]
static void flyEvent ( FlyInfo fly,
wmEvent event 
) [static]
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]
void VIEW3D_OT_fly ( wmOperatorType ot)