Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
HPS::FlyOperator Class Reference

#include <sprk_ops.h>

Inheritance diagram for HPS::FlyOperator:
HPS::Operator HPS::Sprocket HPS::Object HPS::WalkOperator HPS::SimpleWalkOperator

Public Member Functions

 FlyOperator (MouseButtons in_mouse_trigger=MouseButtons::ButtonRight(), ModifierKeys in_modifier_trigger=ModifierKeys())
 
virtual HPS::UTF8 GetName () const
 
virtual bool OnKeyDown (KeyboardState const &in_state)
 
virtual bool OnKeyUp (KeyboardState const &in_state)
 
virtual bool OnMouseDown (MouseState const &in_state)
 
virtual bool OnMouseUp (MouseState const &in_state)
 
virtual bool OnMouseMove (MouseState const &in_state)
 
virtual bool OnMouseWheel (MouseState const &in_state)
 
virtual bool OnTouchDown (TouchState const &in_state)
 
virtual bool OnTouchUp (TouchState const &in_state)
 
virtual bool OnTouchMove (TouchState const &in_state)
 
virtual bool OnTimerTick (HPS::TimerTickEvent const &in_event)
 
virtual void OnModelAttached ()
 
virtual void OnViewAttached ()
 
virtual void OnViewDetached ()
 
void InvertXAxis ()
 
void InvertYAxis ()
 
bool IsXAxisInverted ()
 
bool IsYAxisInverted ()
 
float GetKeyboardSensitivity ()
 
void SetKeyboardSensitivity (float in_keyboard_sensitivity)
 
float GetMouseSensitivity ()
 
void SetMouseSensitivity (float in_mouse_sensitivity)
 
float GetLeftJoystickSensitivity ()
 
void SetLeftJoystickSensitivity (float in_left_joystick_sensitivity)
 
float GetRightJoystickSensitivity ()
 
void SetRightJoystickSensitivity (float right_joystick_sensitivity)
 
float GetJoystickDeadZone ()
 
void SetJoystickDeadZone (float in_dead_zone)
 
- Public Member Functions inherited from HPS::Operator
 Operator (MouseButtons in_mouse_trigger=MouseButtons::ButtonLeft(), ModifierKeys in_modifier_trigger=ModifierKeys())
 
 Operator (Operator const &in_that)
 
HPS::Type ObjectType () const
 
virtual Operatoroperator= (Operator const &in_that)
 
virtual void Assign (Operator const &in_that)
 
virtual bool Equals (Operator const &in_that) const
 
virtual bool operator!= (Operator const &in_that) const
 
virtual bool operator== (Operator const &in_that) const
 
void DetachView ()
 
View GetAttachedView () const
 
virtual bool OnMouseEnter (MouseState const &in_state)
 
virtual bool OnMouseLeave (MouseState const &in_state)
 
virtual void OnModelDetached ()
 
void SetMouseTrigger (MouseButtons in_buttons)
 
MouseButtons GetMouseTrigger () const
 
void SetModifierTrigger (ModifierKeys in_modifiers)
 
ModifierKeys GetModifierTrigger () const
 
virtual bool IsMouseTriggered (MouseState const &in_state)
 
- Public Member Functions inherited from HPS::Sprocket
 Sprocket (Sprocket &&in_that)
 
- Public Member Functions inherited from HPS::Object
Objectoperator= (Object const &other_object)
 
 Object (Object &&in_that)
 
Objectoperator= (Object &&in_that)
 
HPS::Type Type () const
 
virtual bool Empty () const
 
virtual void Reset ()
 
bool HasType (HPS::Type in_mask) const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 

Protected Types

enum  MovementFlags {
  no_movement = 0x0000, moving_forward = 0x0001, moving_back = 0x0002, moving_left = 0x0004,
  moving_right = 0x0008, moving_up = 0x0010, moving_down = 0x0020, roll_left = 0x0040,
  roll_right = 0x0080, rotating = 0x0100, move_with_touch = 0x0200, rotate_with_touch = 0x0400
}
 

Protected Member Functions

void MoveLeft (HPS::Point &position, HPS::Point &target, HPS::Vector &up)
 
void MoveRight (HPS::Point &position, HPS::Point &target, HPS::Vector &up)
 
void MoveUp (HPS::Point &position, HPS::Point &target, HPS::Vector &up)
 
void MoveDown (HPS::Point &position, HPS::Point &target, HPS::Vector &up)
 
void MoveForward (HPS::Point &position, HPS::Point &target, HPS::Vector const &direction)
 
void MoveBack (HPS::Point &position, HPS::Point &target, HPS::Vector const &direction)
 
void MoveWithTouch (HPS::Point &position, HPS::Point &target, HPS::Vector &up, HPS::Vector const &walking_direction)
 
void RotateScene (HPS::Point &position, HPS::Point &target)
 
void RotateWithTouch (HPS::Point &position, HPS::Point &target)
 
void RotateCommon (HPS::Point const &delta, HPS::Point &position, HPS::Point &target)
 

Protected Attributes

unsigned int movement_flags
 
- Protected Attributes inherited from HPS::Operator
HPS::MouseButtons mouse_trigger
 
HPS::ModifierKeys modifier_trigger
 

Additional Inherited Members

- Public Types inherited from HPS::Operator
enum  Priority { Low, Normal, High }
 
- Public Types inherited from HPS::Sprocket
enum  UpdateType { Synchronous, Asynchronous }
 
- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 

Detailed Description

The FlyOperator class defines an operator which allows the user to accurately move the camera around the scene. This Operator works for both mouse- and touch-driven devices. Mouse-Driven Devices: W: Move camera position and target forward A: Pan camera left S: Move camera position and target forward D: Pan camera right C: Pan camera down Space: Pan camera up Q: Roll camera left E: Roll camera right Right-button down and move: Rotate camera in place Shift: Walk at double the speed while pressed Ctrl: Walk at half the speed while pressed Mouse Wheel: Increase / Decrease step length Shift + Mouse Wheel: Increase / Decrease field of view Touch-Driven Devices: touch -left side of screen: Pans camera in left or right, moves camera forward or back touch -right side of screen: Rotates camera in place Two-finger touch -right side of screen: Pans camera up or down, rolls camera left or right The movement speed increases as the user drags his fingers away from the initial touch position

Member Function Documentation

virtual HPS::UTF8 HPS::FlyOperator::GetName ( ) const
inlinevirtual

Returns the name of the operator.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator, and HPS::WalkOperator.

virtual bool HPS::FlyOperator::OnKeyDown ( KeyboardState const &  in_state)
virtual

This function is called whenever HPS receives a KeyboardState event that signals a button was pressed. This function instructs the operator on which direction to move towards.

Parameters
in_stateA KeyboardState object describing the current keyboard state. W: Move camera position and target forward A: Pan camera left S: Move camera position and target forward D: Pan camera right C: Pan camera down Space: Pan camera up Q: Roll camera left E: Roll camera right Shift: Walk at double the speed while pressed Ctrl: Walk at half the speed while pressed
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator.

virtual bool HPS::FlyOperator::OnKeyUp ( KeyboardState const &  in_state)
virtual

This function is called whenever HPS receives a KeyboardState event that signals a button was released.

Parameters
in_stateA KeyboardState object describing the current keyboard state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator.

virtual void HPS::FlyOperator::OnModelAttached ( )
virtual

This function is called whenever a model is attached to the view that is attached to this operator. If no view is attached to this operator, this function will not be called.

Reimplemented from HPS::Operator.

virtual bool HPS::FlyOperator::OnMouseDown ( MouseState const &  in_state)
virtual

This function is called whenever HPS receives a MouseEvent that signals a mouse button was pressed. This function starts the operator and computes the position of the starting point.

Parameters
in_stateA MouseState object describing the current mouse state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator.

virtual bool HPS::FlyOperator::OnMouseMove ( MouseState const &  in_state)
virtual

This function is called whenever HPS receives a MouseEvent that signals the mouse moved This function rotates the camera in place if the right mouse button is down.

Parameters
in_stateA MouseState object describing the current mouse state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator.

virtual bool HPS::FlyOperator::OnMouseUp ( MouseState const &  in_state)
virtual

This function is called whenever HPS receives a MouseEvent that signals a mouse button was released.

Parameters
in_stateA MouseState object describing the current mouse state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator.

virtual bool HPS::FlyOperator::OnMouseWheel ( MouseState const &  in_state)
virtual

This function is called whenever HPS receives a MouseEvent that signals the mouse wheel moved If shift is not pressed this function increases or decreases the step length. If shift is pressed this function increases or decreases the camera field of view.

Parameters
in_stateA MouseState object describing the current mouse state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator.

virtual bool HPS::FlyOperator::OnTimerTick ( HPS::TimerTickEvent const &  in_event)
virtual

This function is called whenever HPS receives a TimerTickEvent This function moves the camera

Parameters
in_stateA TimerTickEvent object describing the current timer tick.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator, and HPS::WalkOperator.

virtual bool HPS::FlyOperator::OnTouchDown ( TouchState const &  in_state)
virtual

This function is called whenever HPS receives a TouchEvent that signals the device was touched. This function starts the operator and computes the position of the starting point.

Parameters
in_stateA TouchState object describing the current touch state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator.

virtual bool HPS::FlyOperator::OnTouchMove ( TouchState const &  in_state)
virtual

This function is called whenever HPS receives a TouchEvent that signals a point of contact has moved. This function rotates the camera in place.

Parameters
in_stateA TouchState object describing the current touch state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator.

virtual bool HPS::FlyOperator::OnTouchUp ( TouchState const &  in_state)
virtual

This function is called whenever HPS receives a TouchEvent that signals a point of contact has been released.

Parameters
in_stateA TouchState object describing the current touch state.
Returns
true if the input event was handled, false otherwise.

Reimplemented from HPS::Operator.

Reimplemented in HPS::SimpleWalkOperator.

virtual void HPS::FlyOperator::OnViewAttached ( )
virtual

This function is called whenever a view is attached to this operator.

Reimplemented from HPS::Operator.

Reimplemented in HPS::WalkOperator.

virtual void HPS::FlyOperator::OnViewDetached ( )
virtual

This function is called whenever a view is detached from this operator.

Reimplemented from HPS::Operator.


The documentation for this class was generated from the following file: