xoreos
0.0.5
|
#include <camera.h>
Public Member Functions | |
CameraManager () | |
const float * | getPosition () const |
Get the current camera position cache. More... | |
const float * | getOrientation () const |
Get the current camera orientation cache. More... | |
void | reset () |
Reset the current position and orientation. More... | |
void | limit (float minX=-FLT_MAX, float minY=-FLT_MAX, float minZ=-FLT_MAX, float maxX=FLT_MAX, float maxY=FLT_MAX, float maxZ=FLT_MAX) |
Set limits on the camera position. More... | |
void | setPosition (float x, float y, float z) |
Set the camera position. More... | |
void | setOrientation (float x, float y, float z) |
Set the camera orientation. More... | |
void | turn (float x, float y, float z) |
Turn along axes. More... | |
void | move (float x, float y, float z) |
Move along axes. More... | |
void | moveRelative (float x, float y, float z) |
Move relative to the current view axis. More... | |
uint32 | lastChanged () const |
The timestamp the camera was changed last. More... | |
void | update () |
Update the caches with the current position and orientation. More... | |
Private Attributes | |
uint32 | _lastChanged |
float | _minPosition [3] |
float | _maxPosition [3] |
float | _position [3] |
Current position. More... | |
float | _orientation [3] |
Current orientation. More... | |
float | _positionCache [3] |
Current position, cached. More... | |
float | _orientationCache [3] |
Current orientation, cached. More... | |
bool | _needUpdate |
Additional Inherited Members | |
Static Public Member Functions inherited from Common::Singleton< CameraManager > | |
static CameraManager & | instance () |
static void | destroy () |
Protected Types inherited from Common::Singleton< CameraManager > | |
typedef CameraManager | SingletonBaseType |
Protected Member Functions inherited from Common::Singleton< CameraManager > | |
Singleton () | |
virtual | ~Singleton () |
Graphics::CameraManager::CameraManager | ( | ) |
Definition at line 45 of file camera.cpp.
References _maxPosition, _minPosition, _orientation, _orientationCache, _position, _positionCache, and FLT_MAX.
const float * Graphics::CameraManager::getOrientation | ( | ) | const |
Get the current camera orientation cache.
Definition at line 91 of file camera.cpp.
References _orientationCache.
const float * Graphics::CameraManager::getPosition | ( | ) | const |
Get the current camera position cache.
Definition at line 87 of file camera.cpp.
References _positionCache.
uint32 Graphics::CameraManager::lastChanged | ( | ) | const |
The timestamp the camera was changed last.
Definition at line 164 of file camera.cpp.
References _lastChanged.
void Graphics::CameraManager::limit | ( | float | minX = -FLT_MAX , |
float | minY = -FLT_MAX , |
||
float | minZ = -FLT_MAX , |
||
float | maxX = FLT_MAX , |
||
float | maxY = FLT_MAX , |
||
float | maxZ = FLT_MAX |
||
) |
Set limits on the camera position.
Definition at line 115 of file camera.cpp.
References _maxPosition, and _minPosition.
void Graphics::CameraManager::move | ( | float | x, |
float | y, | ||
float | z | ||
) |
Move along axes.
Definition at line 148 of file camera.cpp.
References _position, and setPosition().
Referenced by moveRelative().
void Graphics::CameraManager::moveRelative | ( | float | x, |
float | y, | ||
float | z | ||
) |
Move relative to the current view axis.
Definition at line 152 of file camera.cpp.
References _orientation, Common::deg2rad(), and move().
void Graphics::CameraManager::reset | ( | ) |
Reset the current position and orientation.
Definition at line 95 of file camera.cpp.
References _lastChanged, _maxPosition, _minPosition, _needUpdate, _orientation, _position, EventMan, and FLT_MAX.
void Graphics::CameraManager::setOrientation | ( | float | x, |
float | y, | ||
float | z | ||
) |
Set the camera orientation.
Definition at line 134 of file camera.cpp.
References _lastChanged, _needUpdate, _orientation, and EventMan.
Referenced by turn().
void Graphics::CameraManager::setPosition | ( | float | x, |
float | y, | ||
float | z | ||
) |
Set the camera position.
Definition at line 124 of file camera.cpp.
References _lastChanged, _maxPosition, _minPosition, _needUpdate, _position, CLIP(), and EventMan.
Referenced by move().
void Graphics::CameraManager::turn | ( | float | x, |
float | y, | ||
float | z | ||
) |
Turn along axes.
Definition at line 144 of file camera.cpp.
References _orientation, and setOrientation().
void Graphics::CameraManager::update | ( | ) |
Update the caches with the current position and orientation.
All changes to the camera are delayed until this method is called. This stops camera lagging due to too frequent changes.
Definition at line 68 of file camera.cpp.
References _needUpdate, _orientation, _orientationCache, _position, _positionCache, GfxMan, and NotificationMan.
|
private |
Definition at line 66 of file camera.h.
Referenced by lastChanged(), reset(), setOrientation(), and setPosition().
|
private |
Definition at line 69 of file camera.h.
Referenced by CameraManager(), limit(), reset(), and setPosition().
|
private |
Definition at line 68 of file camera.h.
Referenced by CameraManager(), limit(), reset(), and setPosition().
|
private |
Definition at line 77 of file camera.h.
Referenced by reset(), setOrientation(), setPosition(), and update().
|
private |
Current orientation.
Definition at line 72 of file camera.h.
Referenced by CameraManager(), moveRelative(), reset(), setOrientation(), turn(), and update().
|
private |
Current orientation, cached.
Definition at line 75 of file camera.h.
Referenced by CameraManager(), getOrientation(), and update().
|
private |
Current position.
Definition at line 71 of file camera.h.
Referenced by CameraManager(), move(), reset(), setPosition(), and update().
|
private |
Current position, cached.
Definition at line 74 of file camera.h.
Referenced by CameraManager(), getPosition(), and update().