CS::Utility::iCameraManager Struct Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
CS::Utility::iCameraManager Struct Reference

A generic tool to control the motion of the camera through the keyboard and/or the mouse. More...

`#include <ivaria/cameramanager.h>`

Inheritance diagram for CS::Utility::iCameraManager:

List of all members.

## Public Member Functions
virtual void | ClearStartPosition ()=0
| Clear the starting position of the camera.
virtual iCamera * | GetCamera ()=0
| Get the camera controlled by this manager, or nullptr if there are none.
virtual float | GetCameraMinimumDistance ()=0
| Get the closest distance there can be between the camera and its target.
virtual CameraMode | GetCameraMode ()=0
| Return the current camera mode.
virtual csVector3 | GetCameraTarget ()=0
| Get the target of the camera, ie what it is looking at.
virtual float | GetMotionSpeed ()=0
| Get the speed of the camera's motion, in unit per second.
virtual bool | GetMouseMoveEnabled ()=0
| Return whether the camera can be moved or not through the mouse.
virtual float | GetRotationSpeed ()=0
| Get the speed of the camera's motion, in radian per second.
virtual csVector3 | GetStartPosition ()=0
| Get the starting position of the camera.
virtual bool | HasStartPosition ()=0
| Return whether or not a starting position has been defined by SetStartPosition().
virtual void | ResetCamera ()=0
| Reset the camera position to its initial position.
virtual void | SetCamera (iCamera *camera)=0
| Set the camera to be controlled by this manager. This can be nullptr.
virtual void | SetCameraMinimumDistance (float distance)=0
| Set the closest distance there can be between the camera and its target.
virtual void | SetCameraMode (CameraMode cameraMode)=0
| Set the camera mode to be used. The default value is CS::Utility::CAMERA_MOVE_NORMAL.
virtual void | SetCameraTarget (csVector3 position)=0
| Set the target of the camera, ie what it is looking at.
virtual void | SetMotionSpeed (float speed)=0
| Set the speed of the camera's motion, in unit per second.
virtual void | SetMouseMoveEnabled (bool enabled)=0
| Set whether the camera can be moved or not through the mouse.
virtual void | SetRotationSpeed (float speed)=0
| Set the rotation speed of the camera, in radian per second.
virtual void | SetStartPosition (csVector3 position)=0
| Set the starting position of the camera.
virtual void | SwitchCameraPosition ()=0
| Switch to the next engine camera position (see iEngine::GetCameraPositions()).

## Detailed Description

A generic tool to control the motion of the camera through the keyboard and/or the mouse.

To use it, you need to load a CS::Utility::iCameraManager plugin, specify the camera to be controlled with SetCamera(), and configure the behavior of the manager eg by defining the camera mode through SetCameraMode(). After that, the camera manager will remain active until it is destroyed.

Definition at line 61 of file cameramanager.h.

## Member Function Documentation

virtual void CS::Utility::iCameraManager::ClearStartPosition | ( |  | ) | `[pure virtual]`

Clear the starting position of the camera.

The next calls to ResetCamera() will now use the current camera position set by SwitchCameraPosition().

virtual iCamera* CS::Utility::iCameraManager::GetCamera | ( |  | ) | `[pure virtual]`

Get the camera controlled by this manager, or nullptr if there are none.

virtual float CS::Utility::iCameraManager::GetCameraMinimumDistance | ( |  | ) | `[pure virtual]`

Get the closest distance there can be between the camera and its target.

This is relevant only for the CS::Utility::CAMERA_MOVE_LOOKAT and CS::Utility::CAMERA_ROTATE camera modes.

virtual CameraMode CS::Utility::iCameraManager::GetCameraMode | ( |  | ) | `[pure virtual]`

Return the current camera mode.

virtual csVector3 CS::Utility::iCameraManager::GetCameraTarget | ( |  | ) | `[pure virtual]`

Get the target of the camera, ie what it is looking at.

This is relevant only for the CS::Utility::CAMERA_MOVE_LOOKAT and CS::Utility::CAMERA_ROTATE camera modes.

virtual float CS::Utility::iCameraManager::GetMotionSpeed | ( |  | ) | `[pure virtual]`

Get the speed of the camera's motion, in unit per second.

virtual bool CS::Utility::iCameraManager::GetMouseMoveEnabled | ( |  | ) | `[pure virtual]`

Return whether the camera can be moved or not through the mouse.

virtual float CS::Utility::iCameraManager::GetRotationSpeed | ( |  | ) | `[pure virtual]`

Get the speed of the camera's motion, in radian per second.

virtual csVector3 CS::Utility::iCameraManager::GetStartPosition | ( |  | ) | `[pure virtual]`

Get the starting position of the camera.

This position is used when ResetCamera() is called.

virtual bool CS::Utility::iCameraManager::HasStartPosition | ( |  | ) | `[pure virtual]`

Return whether or not a starting position has been defined by SetStartPosition().

virtual void CS::Utility::iCameraManager::ResetCamera | ( |  | ) | `[pure virtual]`

Reset the camera position to its initial position.

This position is either the one defined by SetStartPosition() or the current engine camera position defined by SwitchCameraPosition(). If no starting position has been defined at all, then this method will simply don't do anything.

virtual void CS::Utility::iCameraManager::SetCamera | ( | iCamera * | camera | ) | `[pure virtual]`

Set the camera to be controlled by this manager. This can be nullptr.

virtual void CS::Utility::iCameraManager::SetCameraMinimumDistance | ( | float | distance | ) | `[pure virtual]`

Set the closest distance there can be between the camera and its target.

This is relevant only for the CS::Utility::CAMERA_MOVE_LOOKAT and CS::Utility::CAMERA_ROTATE camera modes. The default value is 0.1f.

virtual void CS::Utility::iCameraManager::SetCameraMode | ( | CameraMode | cameraMode | ) | `[pure virtual]`

Set the camera mode to be used. The default value is CS::Utility::CAMERA_MOVE_NORMAL.

virtual void CS::Utility::iCameraManager::SetCameraTarget | ( | csVector3 | position | ) | `[pure virtual]`

Set the target of the camera, ie what it is looking at.

This is relevant only for the CS::Utility::CAMERA_MOVE_LOOKAT and CS::Utility::CAMERA_ROTATE camera modes. The default value is 'csVector3 (0.0f, 0.0f, 0.0f)'.

virtual void CS::Utility::iCameraManager::SetMotionSpeed | ( | float | speed | ) | `[pure virtual]`

Set the speed of the camera's motion, in unit per second.

The default value is 5. Note that the camera moves ten times faster when the CTRL key is pressed.

virtual void CS::Utility::iCameraManager::SetMouseMoveEnabled | ( | bool | enabled | ) | `[pure virtual]`

Set whether the camera can be moved or not through the mouse.

The default value is true. If enabled, then the camera will be moved when the user drags the mouse while holding one of the following button:

- left button: the camera is moved sideways
- right button: the camera is rotated around the target returned by CameraManager::GetCameraTarget().
- middle button: the camera is moved forward and backward. The camera cannot get closer than CameraManager::GetCameraMinimumDistance().

virtual void CS::Utility::iCameraManager::SetRotationSpeed | ( | float | speed | ) | `[pure virtual]`

Set the rotation speed of the camera, in radian per second.

The default value is 2. Note that the camera rotates five times faster when the CTRL key is pressed.

virtual void CS::Utility::iCameraManager::SetStartPosition | ( | csVector3 | position | ) | `[pure virtual]`

Set the starting position of the camera.

This position is used when ResetCamera() is called.

See also:
  ClearStartPosition()

virtual void CS::Utility::iCameraManager::SwitchCameraPosition | ( |  | ) | `[pure virtual]`

Switch to the next engine camera position (see iEngine::GetCameraPositions()).

This position will be used for each subsequent call to ResetCamera() (unless another position has been set by SetStartPosition()).

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

- ivaria/cameramanager.h