CameraShake Class Reference

Effect that shakes the camera, as for an explosion. More...

#include <CameraShake.h>

List of all members.

Classes

class  CameraData
 Camera data for the effect. More...

Public Member Functions

 META_Node (PVLE, CameraShake)
 CameraShake ()
 CameraShake (const CameraShakeParams &params)
 CameraShake (const CameraShake &v, const osg::CopyOp &copyop)
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< CameraDatavCameras
 List of camera data.

Friends

class CameraShakeUpdateCallback


Detailed Description

Effect that shakes the camera, as for an explosion.

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).

Author:
Sukender

Definition at line 82 of file CameraShake.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]

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]


Friends And Related Function Documentation

friend class CameraShakeUpdateCallback [friend]

Definition at line 99 of file CameraShake.h.


Member Data Documentation

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().

Definition at line 102 of file CameraShake.h.

Referenced by updateCameras().

std::vector<CameraData> CameraShake::vCameras [protected]

List of camera data.

Definition at line 113 of file CameraShake.h.

Referenced by updateCameras(), and ~CameraShake().


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

Generated on Sun Jan 17 11:39:26 2010 for PVLE (Pro-Vocation Light Engine) by  doxygen 1.5.9