RigsofRods
Soft-body Physics Simulation
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
RoR::CameraManager Class Reference

#include <CameraManager.h>

+ Collaboration diagram for RoR::CameraManager:

Public Types

enum  CameraBehaviors {
  CAMERA_BEHAVIOR_CHARACTER =0, CAMERA_BEHAVIOR_STATIC, CAMERA_BEHAVIOR_VEHICLE, CAMERA_BEHAVIOR_VEHICLE_SPLINE,
  CAMERA_BEHAVIOR_VEHICLE_CINECAM, CAMERA_BEHAVIOR_END, CAMERA_BEHAVIOR_FREE, CAMERA_BEHAVIOR_FIXED,
  CAMERA_BEHAVIOR_ISOMETRIC, CAMERA_BEHAVIOR_INVALID = -1
}
 

Public Member Functions

 CameraManager ()
 
 ~CameraManager ()
 
void UpdateInputEvents (float dt)
 
bool hasActiveBehavior ()
 
CameraBehaviors GetCurrentBehavior () const
 
Ogre::SceneNode * GetCameraNode ()
 
Ogre::Camera * GetCamera ()
 
void NotifyContextChange ()
 
void NotifyVehicleChanged (ActorPtr new_vehicle)
 
void CameraBehaviorOrbitReset ()
 
bool CameraBehaviorOrbitMouseMoved (const OIS::MouseEvent &_arg)
 
void CameraBehaviorOrbitUpdate ()
 
bool mouseMoved (const OIS::MouseEvent &_arg)
 
bool mousePressed (const OIS::MouseEvent &_arg, OIS::MouseButtonID _id)
 
void ResetAllBehaviors ()
 
void ReCreateCameraNode ()
 Needed since we call Ogre::SceneManager::ClearScene() after end of sim. session. More...
 
void switchToNextBehavior ()
 
bool EvaluateSwitchBehavior ()
 

Protected Member Functions

void switchBehavior (CameraBehaviors new_behavior)
 
void SwitchBehaviorOnVehicleChange (CameraBehaviors new_behavior, ActorPtr new_vehicle)
 
void ToggleCameraBehavior (CameraBehaviors new_behavior)
 Only accepts FREE and FREEFIX modes. More...
 
void ActivateNewBehavior (CameraBehaviors new_behavior, bool reset)
 
void UpdateCurrentBehavior ()
 
void ResetCurrentBehavior ()
 
void DeactivateCurrentBehavior ()
 
void UpdateCameraBehaviorStatic ()
 
bool CameraBehaviorStaticMouseMoved (const OIS::MouseEvent &_arg)
 
void UpdateCameraBehaviorFree ()
 
void UpdateCameraBehaviorFixed ()
 
void UpdateCameraBehaviorVehicle ()
 
void CameraBehaviorVehicleReset ()
 
bool CameraBehaviorVehicleMousePressed (const OIS::MouseEvent &_arg, OIS::MouseButtonID _id)
 
void CameraBehaviorVehicleSplineUpdate ()
 
bool CameraBehaviorVehicleSplineMouseMoved (const OIS::MouseEvent &_arg)
 
void CameraBehaviorVehicleSplineReset ()
 
void CameraBehaviorVehicleSplineCreateSpline ()
 
void CameraBehaviorVehicleSplineUpdateSpline ()
 
void CameraBehaviorVehicleSplineUpdateSplineDisplay ()
 
void CreateCameraNode ()
 

Protected Attributes

Ogre::Camera * m_camera
 
Ogre::SceneNode * m_camera_node
 
CameraBehaviors m_current_behavior
 
CameraBehaviors m_cam_before_toggled
 Toggled modes (FREE, FREEFIX) remember original state. More...
 
CameraBehaviors m_prev_toggled_cam
 Switching toggled modes (FREE, FREEFIX) keeps 1-slot history. More...
 
ActorPtr m_cct_player_actor
 
Ogre::Degree m_cct_rot_scale
 
Ogre::Real m_cct_dt
 
Ogre::Real m_cct_trans_scale
 
float m_cct_sim_speed
 
Ogre::Radian m_cam_rot_x
 
Ogre::Radian m_cam_rot_y
 
Ogre::Radian m_cam_target_direction
 
Ogre::Radian m_cam_target_pitch
 
float m_cam_dist
 
float m_cam_dist_min
 
float m_cam_dist_max
 
float m_cam_ratio
 
Ogre::Vector3 m_cam_look_at
 
bool m_cam_limit_movement
 
Ogre::Vector3 m_cam_look_at_last
 
Ogre::Vector3 m_cam_look_at_smooth
 
Ogre::Vector3 m_cam_look_at_smooth_last
 
bool m_staticcam_force_update
 
float m_staticcam_fov_exponent
 
Ogre::Radian m_staticcam_previous_fov
 
Ogre::Vector3 m_staticcam_look_at
 
Ogre::Vector3 m_staticcam_position
 
Ogre::Timer m_staticcam_update_timer
 
bool m_charactercam_is_3rdperson
 
Ogre::ManualObject * m_splinecam_mo
 
Ogre::SimpleSpline * m_splinecam_spline
 
Ogre::Real m_splinecam_spline_len
 
Ogre::Real m_splinecam_spline_pos
 
bool m_splinecam_spline_closed
 
bool m_splinecam_auto_tracking
 
std::deque< node_t * > m_splinecam_spline_nodes
 
unsigned int m_splinecam_num_linked_beams
 

Detailed Description

Definition at line 37 of file CameraManager.h.

Member Enumeration Documentation

◆ CameraBehaviors

Enumerator
CAMERA_BEHAVIOR_CHARACTER 
CAMERA_BEHAVIOR_STATIC 
CAMERA_BEHAVIOR_VEHICLE 
CAMERA_BEHAVIOR_VEHICLE_SPLINE 
CAMERA_BEHAVIOR_VEHICLE_CINECAM 
CAMERA_BEHAVIOR_END 
CAMERA_BEHAVIOR_FREE 
CAMERA_BEHAVIOR_FIXED 
CAMERA_BEHAVIOR_ISOMETRIC 
CAMERA_BEHAVIOR_INVALID 

Definition at line 44 of file CameraManager.h.

Constructor & Destructor Documentation

◆ CameraManager()

CameraManager::CameraManager ( )

Definition at line 83 of file CameraManager.cpp.

+ Here is the call graph for this function:

◆ ~CameraManager()

CameraManager::~CameraManager ( )

Definition at line 126 of file CameraManager.cpp.

Member Function Documentation

◆ ActivateNewBehavior()

void CameraManager::ActivateNewBehavior ( CameraBehaviors  new_behavior,
bool  reset 
)
protected

Definition at line 375 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorOrbitMouseMoved()

bool CameraManager::CameraBehaviorOrbitMouseMoved ( const OIS::MouseEvent &  _arg)

Definition at line 941 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorOrbitReset()

void CameraManager::CameraBehaviorOrbitReset ( )

Definition at line 966 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorOrbitUpdate()

void CameraManager::CameraBehaviorOrbitUpdate ( )

Definition at line 816 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorStaticMouseMoved()

bool CameraManager::CameraBehaviorStaticMouseMoved ( const OIS::MouseEvent &  _arg)
protected

Definition at line 800 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorVehicleMousePressed()

bool CameraManager::CameraBehaviorVehicleMousePressed ( const OIS::MouseEvent &  _arg,
OIS::MouseButtonID  _id 
)
protected

Definition at line 1088 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorVehicleReset()

void CameraManager::CameraBehaviorVehicleReset ( )
protected

Definition at line 1080 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorVehicleSplineCreateSpline()

void CameraManager::CameraBehaviorVehicleSplineCreateSpline ( )
protected

Definition at line 1249 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorVehicleSplineMouseMoved()

bool CameraManager::CameraBehaviorVehicleSplineMouseMoved ( const OIS::MouseEvent &  _arg)
protected

Definition at line 1184 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorVehicleSplineReset()

void CameraManager::CameraBehaviorVehicleSplineReset ( )
protected

Definition at line 1240 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorVehicleSplineUpdate()

void CameraManager::CameraBehaviorVehicleSplineUpdate ( )
protected

Definition at line 1127 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ CameraBehaviorVehicleSplineUpdateSpline()

void CameraManager::CameraBehaviorVehicleSplineUpdateSpline ( )
protected

Definition at line 1346 of file CameraManager.cpp.

+ Here is the caller graph for this function:

◆ CameraBehaviorVehicleSplineUpdateSplineDisplay()

void CameraManager::CameraBehaviorVehicleSplineUpdateSplineDisplay ( )
protected

Definition at line 1354 of file CameraManager.cpp.

+ Here is the caller graph for this function:

◆ CreateCameraNode()

void CameraManager::CreateCameraNode ( )
protected

Definition at line 134 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DeactivateCurrentBehavior()

void CameraManager::DeactivateCurrentBehavior ( )
protected

Definition at line 468 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EvaluateSwitchBehavior()

bool CameraManager::EvaluateSwitchBehavior ( )

Definition at line 148 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetCamera()

Ogre::Camera* RoR::CameraManager::GetCamera ( )
inline

Definition at line 64 of file CameraManager.h.

+ Here is the caller graph for this function:

◆ GetCameraNode()

Ogre::SceneNode* RoR::CameraManager::GetCameraNode ( )
inline

Definition at line 63 of file CameraManager.h.

+ Here is the caller graph for this function:

◆ GetCurrentBehavior()

CameraBehaviors RoR::CameraManager::GetCurrentBehavior ( ) const
inline

Definition at line 62 of file CameraManager.h.

+ Here is the caller graph for this function:

◆ hasActiveBehavior()

bool CameraManager::hasActiveBehavior ( )

Definition at line 524 of file CameraManager.cpp.

◆ mouseMoved()

bool CameraManager::mouseMoved ( const OIS::MouseEvent &  _arg)

Definition at line 534 of file CameraManager.cpp.

+ Here is the call graph for this function:

◆ mousePressed()

bool CameraManager::mousePressed ( const OIS::MouseEvent &  _arg,
OIS::MouseButtonID  _id 
)

Definition at line 589 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ NotifyContextChange()

void CameraManager::NotifyContextChange ( )

Definition at line 613 of file CameraManager.cpp.

+ Here is the caller graph for this function:

◆ NotifyVehicleChanged()

void CameraManager::NotifyVehicleChanged ( ActorPtr  new_vehicle)

Definition at line 629 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ReCreateCameraNode()

void CameraManager::ReCreateCameraNode ( )

Needed since we call Ogre::SceneManager::ClearScene() after end of sim. session.

Definition at line 142 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResetAllBehaviors()

void CameraManager::ResetAllBehaviors ( )

Definition at line 529 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ResetCurrentBehavior()

void CameraManager::ResetCurrentBehavior ( )
protected

Definition at line 326 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ switchBehavior()

void CameraManager::switchBehavior ( CameraBehaviors  new_behavior)
protected

Definition at line 485 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SwitchBehaviorOnVehicleChange()

void CameraManager::SwitchBehaviorOnVehicleChange ( CameraBehaviors  new_behavior,
ActorPtr  new_vehicle 
)
protected

Definition at line 510 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ switchToNextBehavior()

void CameraManager::switchToNextBehavior ( )

Definition at line 320 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ToggleCameraBehavior()

void CameraManager::ToggleCameraBehavior ( CameraBehaviors  new_behavior)
protected

Only accepts FREE and FREEFIX modes.

Definition at line 668 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateCameraBehaviorFixed()

void CameraManager::UpdateCameraBehaviorFixed ( )
protected

Definition at line 1050 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateCameraBehaviorFree()

void CameraManager::UpdateCameraBehaviorFree ( )
protected

Definition at line 976 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateCameraBehaviorStatic()

void CameraManager::UpdateCameraBehaviorStatic ( )
protected

Definition at line 699 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateCameraBehaviorVehicle()

void CameraManager::UpdateCameraBehaviorVehicle ( )
protected

Definition at line 1059 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateCurrentBehavior()

void CameraManager::UpdateCurrentBehavior ( )
protected

Definition at line 186 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ UpdateInputEvents()

void CameraManager::UpdateInputEvents ( float  dt)

Definition at line 242 of file CameraManager.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ m_cam_before_toggled

CameraBehaviors RoR::CameraManager::m_cam_before_toggled
protected

Toggled modes (FREE, FREEFIX) remember original state.

Definition at line 110 of file CameraManager.h.

◆ m_cam_dist

float RoR::CameraManager::m_cam_dist
protected

Definition at line 123 of file CameraManager.h.

◆ m_cam_dist_max

float RoR::CameraManager::m_cam_dist_max
protected

Definition at line 125 of file CameraManager.h.

◆ m_cam_dist_min

float RoR::CameraManager::m_cam_dist_min
protected

Definition at line 124 of file CameraManager.h.

◆ m_cam_limit_movement

bool RoR::CameraManager::m_cam_limit_movement
protected

Definition at line 128 of file CameraManager.h.

◆ m_cam_look_at

Ogre::Vector3 RoR::CameraManager::m_cam_look_at
protected

Definition at line 127 of file CameraManager.h.

◆ m_cam_look_at_last

Ogre::Vector3 RoR::CameraManager::m_cam_look_at_last
protected

Definition at line 129 of file CameraManager.h.

◆ m_cam_look_at_smooth

Ogre::Vector3 RoR::CameraManager::m_cam_look_at_smooth
protected

Definition at line 130 of file CameraManager.h.

◆ m_cam_look_at_smooth_last

Ogre::Vector3 RoR::CameraManager::m_cam_look_at_smooth_last
protected

Definition at line 131 of file CameraManager.h.

◆ m_cam_ratio

float RoR::CameraManager::m_cam_ratio
protected

Definition at line 126 of file CameraManager.h.

◆ m_cam_rot_x

Ogre::Radian RoR::CameraManager::m_cam_rot_x
protected

Definition at line 119 of file CameraManager.h.

◆ m_cam_rot_y

Ogre::Radian RoR::CameraManager::m_cam_rot_y
protected

Definition at line 120 of file CameraManager.h.

◆ m_cam_target_direction

Ogre::Radian RoR::CameraManager::m_cam_target_direction
protected

Definition at line 121 of file CameraManager.h.

◆ m_cam_target_pitch

Ogre::Radian RoR::CameraManager::m_cam_target_pitch
protected

Definition at line 122 of file CameraManager.h.

◆ m_camera

Ogre::Camera* RoR::CameraManager::m_camera
protected

Definition at line 106 of file CameraManager.h.

◆ m_camera_node

Ogre::SceneNode* RoR::CameraManager::m_camera_node
protected

Definition at line 107 of file CameraManager.h.

◆ m_cct_dt

Ogre::Real RoR::CameraManager::m_cct_dt
protected

Definition at line 115 of file CameraManager.h.

◆ m_cct_player_actor

ActorPtr RoR::CameraManager::m_cct_player_actor
protected

Definition at line 113 of file CameraManager.h.

◆ m_cct_rot_scale

Ogre::Degree RoR::CameraManager::m_cct_rot_scale
protected

Definition at line 114 of file CameraManager.h.

◆ m_cct_sim_speed

float RoR::CameraManager::m_cct_sim_speed
protected

Definition at line 117 of file CameraManager.h.

◆ m_cct_trans_scale

Ogre::Real RoR::CameraManager::m_cct_trans_scale
protected

Definition at line 116 of file CameraManager.h.

◆ m_charactercam_is_3rdperson

bool RoR::CameraManager::m_charactercam_is_3rdperson
protected

Definition at line 140 of file CameraManager.h.

◆ m_current_behavior

CameraBehaviors RoR::CameraManager::m_current_behavior
protected

Definition at line 109 of file CameraManager.h.

◆ m_prev_toggled_cam

CameraBehaviors RoR::CameraManager::m_prev_toggled_cam
protected

Switching toggled modes (FREE, FREEFIX) keeps 1-slot history.

Definition at line 111 of file CameraManager.h.

◆ m_splinecam_auto_tracking

bool RoR::CameraManager::m_splinecam_auto_tracking
protected

Definition at line 147 of file CameraManager.h.

◆ m_splinecam_mo

Ogre::ManualObject* RoR::CameraManager::m_splinecam_mo
protected

Definition at line 142 of file CameraManager.h.

◆ m_splinecam_num_linked_beams

unsigned int RoR::CameraManager::m_splinecam_num_linked_beams
protected

Definition at line 149 of file CameraManager.h.

◆ m_splinecam_spline

Ogre::SimpleSpline* RoR::CameraManager::m_splinecam_spline
protected

Definition at line 143 of file CameraManager.h.

◆ m_splinecam_spline_closed

bool RoR::CameraManager::m_splinecam_spline_closed
protected

Definition at line 146 of file CameraManager.h.

◆ m_splinecam_spline_len

Ogre::Real RoR::CameraManager::m_splinecam_spline_len
protected

Definition at line 144 of file CameraManager.h.

◆ m_splinecam_spline_nodes

std::deque<node_t*> RoR::CameraManager::m_splinecam_spline_nodes
protected

Definition at line 148 of file CameraManager.h.

◆ m_splinecam_spline_pos

Ogre::Real RoR::CameraManager::m_splinecam_spline_pos
protected

Definition at line 145 of file CameraManager.h.

◆ m_staticcam_force_update

bool RoR::CameraManager::m_staticcam_force_update
protected

Definition at line 133 of file CameraManager.h.

◆ m_staticcam_fov_exponent

float RoR::CameraManager::m_staticcam_fov_exponent
protected

Definition at line 134 of file CameraManager.h.

◆ m_staticcam_look_at

Ogre::Vector3 RoR::CameraManager::m_staticcam_look_at
protected

Definition at line 136 of file CameraManager.h.

◆ m_staticcam_position

Ogre::Vector3 RoR::CameraManager::m_staticcam_position
protected

Definition at line 137 of file CameraManager.h.

◆ m_staticcam_previous_fov

Ogre::Radian RoR::CameraManager::m_staticcam_previous_fov
protected

Definition at line 135 of file CameraManager.h.

◆ m_staticcam_update_timer

Ogre::Timer RoR::CameraManager::m_staticcam_update_timer
protected

Definition at line 138 of file CameraManager.h.


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