#include <CameraShake.h>
Classes | |
class | CameraData |
Camera data for the effect. More... | |
Public Member Functions | |
META_Node (PVLE, CameraShake) | |
CameraShake () | |
CameraShake (const CameraShakeParams ¶ms) | |
CameraShake (const CameraShake &v, const osg::CopyOp ©op) | |
void | addCamera (osg::Camera *pCamera) |
Adds a camera to be affected by the effect. | |
bool | ended () const |
Says if the effect has ened. | |
bool | autoDelete () const |
Protected Member Functions | |
virtual | ~CameraShake () |
void | updateCameras (const osg::Vec3f &pos) |
void | setCamera (CameraData &cameraData, const osg::Vec3f &newOffset) |
float | timedAmplitude () |
Returns the amplitude, taking into account curTime, timeFullAmplitude and totalTime. | |
Protected Attributes | |
CameraShakeParams | params |
float | curTime |
Current time of the effect. | |
unsigned int | curNumHalfOscillation |
Current half oscillation number. | |
std::vector< CameraData > | vCameras |
List of camera data. | |
Friends | |
class | CameraShakeUpdateCallback |
CameraShakes affect the view matrix of cameras and are cumulative. The effect is a node that can be placed anywhere in the world; its coordinates are used to compute the effect on cameras (see CameraShakeParams::distanceModel).
Definition at line 82 of file CameraShake.h.
CameraShake::CameraShake | ( | ) |
Definition at line 73 of file CameraShake.cpp.
CameraShake::CameraShake | ( | const CameraShakeParams & | params | ) |
Definition at line 77 of file CameraShake.cpp.
CameraShake::CameraShake | ( | const CameraShake & | v, | |
const osg::CopyOp & | copyop | |||
) |
Definition at line 81 of file CameraShake.cpp.
CameraShake::~CameraShake | ( | ) | [protected, virtual] |
Definition at line 85 of file CameraShake.cpp.
References CameraShake::CameraData::pCamera, setCamera(), and vCameras.
void CameraShake::addCamera | ( | osg::Camera * | pCamera | ) | [inline] |
Adds a camera to be affected by the effect.
Cameras are kept in observer_ptr<> so you have not to worry about their deletion's side effects.
Definition at line 92 of file CameraShake.h.
bool CameraShake::autoDelete | ( | ) | const [inline] |
Definition at line 96 of file CameraShake.h.
bool CameraShake::ended | ( | ) | const [inline] |
Says if the effect has ened.
Definition at line 95 of file CameraShake.h.
References CameraShakeParams::totalTime.
CameraShake::META_Node | ( | PVLE | , | |
CameraShake | ||||
) |
void CameraShake::setCamera | ( | CameraData & | cameraData, | |
const osg::Vec3f & | newOffset | |||
) | [protected] |
Definition at line 124 of file CameraShake.cpp.
References ASSERT, CameraShake::CameraData::curOffset, and CameraShake::CameraData::pCamera.
Referenced by updateCameras(), and ~CameraShake().
float CameraShake::timedAmplitude | ( | ) | [inline, protected] |
Returns the amplitude, taking into account curTime, timeFullAmplitude and totalTime.
Definition at line 119 of file CameraShake.h.
References CameraShakeParams::amplitude, CameraShakeParams::timeFullAmplitude, and CameraShakeParams::totalTime.
Referenced by updateCameras().
void CameraShake::updateCameras | ( | const osg::Vec3f & | pos | ) | [protected] |
Definition at line 93 of file CameraShake.cpp.
References CameraShakeParams::anglePhi, CameraShakeParams::angleTheta, curNumHalfOscillation, curTime, CameraShakeParams::dispersionPhi, CameraShakeParams::dispersionTheta, CameraShakeParams::DIST_LINEAR, CameraShakeParams::DIST_NONE, CameraShakeParams::distanceModel, CameraShakeParams::frequency, math_fmodf(), params, CameraShake::CameraData::pCamera, rand(), setCamera(), timedAmplitude(), and vCameras.
Referenced by CameraShakeUpdateCallback::operator()().
friend class CameraShakeUpdateCallback [friend] |
Definition at line 99 of file CameraShake.h.
unsigned int CameraShake::curNumHalfOscillation [protected] |
Current half oscillation number.
Definition at line 104 of file CameraShake.h.
Referenced by updateCameras().
float CameraShake::curTime [protected] |
Current time of the effect.
Definition at line 103 of file CameraShake.h.
Referenced by CameraShakeUpdateCallback::operator()(), and updateCameras().
CameraShakeParams CameraShake::params [protected] |
std::vector<CameraData> CameraShake::vCameras [protected] |
List of camera data.
Definition at line 113 of file CameraShake.h.
Referenced by updateCameras(), and ~CameraShake().