OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
MWRender::Camera Class Reference

Camera control. More...

#include <camera.hpp>

Collaboration diagram for MWRender::Camera:

Classes

struct  CamData
 

Public Member Functions

 Camera (osg::Camera *camera)
 
 ~Camera ()
 
MWWorld::Ptr getTrackingPtr () const
 
void updateCamera (osg::Camera *cam)
 Update the view matrix of cam. More...
 
void reset ()
 Reset to defaults. More...
 
void rotateCamera (float pitch, float yaw, bool adjust)
 
float getYaw ()
 
void setYaw (float angle)
 
float getPitch ()
 
void setPitch (float angle)
 
void attachTo (const MWWorld::Ptr &)
 Attach camera to object. More...
 
void toggleViewMode (bool force=false)
 
bool toggleVanityMode (bool enable)
 
void allowVanityMode (bool allow)
 
void togglePreviewMode (bool enable)
 
void setSneakOffset (float offset)
 Lowers the camera for sneak. More...
 
bool isFirstPerson () const
 
void processViewChange ()
 
void update (float duration, bool paused=false)
 
void setCameraDistance (float dist, bool adjust=false, bool override=true)
 
void setCameraDistance ()
 Restore default camera distance for current mode. More...
 
float getCameraDistance () const
 
void setAnimation (NpcAnimation *anim)
 
osg::Vec3d getFocalPoint ()
 
void getPosition (osg::Vec3f &focal, osg::Vec3f &camera)
 Stores focal and camera world positions in passed arguments. More...
 
void togglePlayerLooking (bool enable)
 
bool isVanityOrPreviewModeEnabled ()
 
bool isNearest ()
 

Private Attributes

MWWorld::Ptr mTrackingPtr
 
osg::ref_ptr< const osg::Node > mTrackingNode
 
float mHeightScale
 
osg::ref_ptr< osg::Camera > mCamera
 
NpcAnimationmAnimation
 
bool mFirstPersonView
 
bool mPreviewMode
 
bool mFreeLook
 
float mNearest
 
float mFurthest
 
bool mIsNearest
 
struct {
   bool   enabled
 
   bool   allowed
 
mVanity
 
float mHeight
 
float mMaxCameraDistance
 
CamData mMainCam
 
CamData mPreviewCam
 
bool mVanityToggleQueued
 
bool mVanityToggleQueuedValue
 
bool mViewModeToggleQueued
 
float mCameraDistance
 
osg::ref_ptr< osg::NodeCallback > mUpdateCallback
 

Detailed Description

Camera control.

Constructor & Destructor Documentation

MWRender::Camera::Camera ( osg::Camera *  camera)
MWRender::Camera::~Camera ( )

Member Function Documentation

void MWRender::Camera::allowVanityMode ( bool  allow)

Here is the call graph for this function:

void MWRender::Camera::attachTo ( const MWWorld::Ptr ptr)

Attach camera to object.

float MWRender::Camera::getCameraDistance ( ) const

Here is the call graph for this function:

osg::Vec3d MWRender::Camera::getFocalPoint ( )

Here is the call graph for this function:

Here is the caller graph for this function:

float MWRender::Camera::getPitch ( )

Here is the caller graph for this function:

void MWRender::Camera::getPosition ( osg::Vec3f &  focal,
osg::Vec3f &  camera 
)

Stores focal and camera world positions in passed arguments.

Here is the call graph for this function:

Here is the caller graph for this function:

MWWorld::Ptr MWRender::Camera::getTrackingPtr ( ) const
float MWRender::Camera::getYaw ( )

Here is the caller graph for this function:

bool MWRender::Camera::isFirstPerson ( ) const
inline

Here is the caller graph for this function:

bool MWRender::Camera::isNearest ( )
bool MWRender::Camera::isVanityOrPreviewModeEnabled ( )

Here is the caller graph for this function:

void MWRender::Camera::processViewChange ( )

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::Camera::reset ( )

Reset to defaults.

Here is the call graph for this function:

void MWRender::Camera::rotateCamera ( float  pitch,
float  yaw,
bool  adjust 
)

Set where the camera is looking at. Uses Morrowind (euler) angles

Parameters
rotRotation angles in radians

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::Camera::setAnimation ( NpcAnimation anim)

Here is the call graph for this function:

void MWRender::Camera::setCameraDistance ( float  dist,
bool  adjust = false,
bool  override = true 
)

Set camera distance for current mode. Don't work on 1st person view.

Parameters
adjustIndicates should distance be adjusted or set.
overrideIf true new distance will be used as default. If false, default distance can be restored with setCameraDistance().

Here is the caller graph for this function:

void MWRender::Camera::setCameraDistance ( )

Restore default camera distance for current mode.

void MWRender::Camera::setPitch ( float  angle)

Here is the caller graph for this function:

void MWRender::Camera::setSneakOffset ( float  offset)

Lowers the camera for sneak.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::Camera::setYaw ( float  angle)

Here is the caller graph for this function:

void MWRender::Camera::togglePlayerLooking ( bool  enable)

Here is the call graph for this function:

void MWRender::Camera::togglePreviewMode ( bool  enable)
Note
this may be ignored if an important animation is currently playing

Here is the call graph for this function:

Here is the caller graph for this function:

bool MWRender::Camera::toggleVanityMode ( bool  enable)

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::Camera::toggleViewMode ( bool  force = false)
Parameters
Forceview mode switch, even if currently not allowed by the animation.

Here is the call graph for this function:

Here is the caller graph for this function:

void MWRender::Camera::update ( float  duration,
bool  paused = false 
)

Here is the call graph for this function:

void MWRender::Camera::updateCamera ( osg::Camera *  cam)

Update the view matrix of cam.

Here is the call graph for this function:

Member Data Documentation

bool MWRender::Camera::allowed
bool MWRender::Camera::enabled
NpcAnimation* MWRender::Camera::mAnimation
private
osg::ref_ptr<osg::Camera> MWRender::Camera::mCamera
private
float MWRender::Camera::mCameraDistance
private
bool MWRender::Camera::mFirstPersonView
private
bool MWRender::Camera::mFreeLook
private
float MWRender::Camera::mFurthest
private
float MWRender::Camera::mHeight
private
float MWRender::Camera::mHeightScale
private
bool MWRender::Camera::mIsNearest
private
CamData MWRender::Camera::mMainCam
private
float MWRender::Camera::mMaxCameraDistance
private
float MWRender::Camera::mNearest
private
CamData MWRender::Camera::mPreviewCam
private
bool MWRender::Camera::mPreviewMode
private
osg::ref_ptr<const osg::Node> MWRender::Camera::mTrackingNode
private
MWWorld::Ptr MWRender::Camera::mTrackingPtr
private
osg::ref_ptr<osg::NodeCallback> MWRender::Camera::mUpdateCallback
private
struct { ... } MWRender::Camera::mVanity
bool MWRender::Camera::mVanityToggleQueued
private
bool MWRender::Camera::mVanityToggleQueuedValue
private
bool MWRender::Camera::mViewModeToggleQueued
private

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