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 ()
 
void CameraBehaviorOrbitUpdate ()
 
bool handleMouseMoved ()
 
bool handleMousePressed ()
 
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 ()
 
void UpdateCameraBehaviorFree ()
 
void UpdateCameraBehaviorFixed ()
 
void UpdateCameraBehaviorVehicle ()
 
void CameraBehaviorVehicleReset ()
 
bool CameraBehaviorVehicleMousePressed ()
 
void CameraBehaviorVehicleSplineUpdate ()
 
bool CameraBehaviorVehicleSplineMouseMoved ()
 
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 ( )

Definition at line 947 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 974 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 822 of file CameraManager.cpp.

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

◆ CameraBehaviorStaticMouseMoved()

bool CameraManager::CameraBehaviorStaticMouseMoved ( )
protected

Definition at line 804 of file CameraManager.cpp.

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

◆ CameraBehaviorVehicleMousePressed()

bool CameraManager::CameraBehaviorVehicleMousePressed ( )
protected

Definition at line 1096 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 1088 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 1261 of file CameraManager.cpp.

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

◆ CameraBehaviorVehicleSplineMouseMoved()

bool CameraManager::CameraBehaviorVehicleSplineMouseMoved ( )
protected

Definition at line 1194 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 1252 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 1137 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 1358 of file CameraManager.cpp.

+ Here is the caller graph for this function:

◆ CameraBehaviorVehicleSplineUpdateSplineDisplay()

void CameraManager::CameraBehaviorVehicleSplineUpdateSplineDisplay ( )
protected

Definition at line 1366 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:

◆ handleMouseMoved()

bool CameraManager::handleMouseMoved ( )

Definition at line 534 of file CameraManager.cpp.

+ Here is the call graph for this function:

◆ handleMousePressed()

bool CameraManager::handleMousePressed ( )

Definition at line 591 of file CameraManager.cpp.

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

◆ hasActiveBehavior()

bool CameraManager::hasActiveBehavior ( )

Definition at line 524 of file CameraManager.cpp.

◆ NotifyContextChange()

void CameraManager::NotifyContextChange ( )

Definition at line 617 of file CameraManager.cpp.

+ Here is the caller graph for this function:

◆ NotifyVehicleChanged()

void CameraManager::NotifyVehicleChanged ( ActorPtr  new_vehicle)

Definition at line 633 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 672 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 1058 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 984 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 703 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 1067 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: