OpenMW
Classes | Public Member Functions | Private Member Functions | Private Attributes
MWRender::Camera Class Reference

Camera control. More...

#include <camera.hpp>

List of all members.

Classes

struct  CamData

Public Member Functions

 Camera (Ogre::Camera *camera)
 ~Camera ()
void reset ()
 Reset to defaults.
void rotateCamera (const Ogre::Vector3 &rot, bool adjust)
float getYaw ()
void setYaw (float angle)
float getPitch ()
void setPitch (float angle)
const std::string & getHandle () const
void attachTo (const MWWorld::Ptr &)
 Attach camera to object.
void toggleViewMode ()
bool toggleVanityMode (bool enable)
void allowVanityMode (bool allow)
void togglePreviewMode (bool enable)
void setSneakOffset ()
 Lowers the camera for sneak. As animation is tied to the camera, this needs to be set each frame after the animation is applied.
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.
float getCameraDistance () const
void setAnimation (NpcAnimation *anim)
void getPosition (Ogre::Vector3 &focal, Ogre::Vector3 &camera)
 Stores focal and camera world positions in passed arguments.
void togglePlayerLooking (bool enable)
bool isVanityOrPreviewModeEnabled ()
bool isNearest ()
bool isFurthest ()

Private Member Functions

void updateListener ()
 Updates sound manager listener data.

Private Attributes

MWWorld::Ptr mTrackingPtr
Ogre::Camera * mCamera
Ogre::SceneNode * mCameraNode
NpcAnimationmAnimation
bool mFirstPersonView
bool mPreviewMode
bool mFreeLook
float mNearest
float mFurthest
bool mIsNearest
bool mIsFurthest
struct {
   bool   enabled
   bool   allowed
mVanity
float mHeight
float mCameraDistance
CamData mMainCam
CamData mPreviewCam
bool mDistanceAdjusted
bool mVanityToggleQueued
bool mViewModeToggleQueued

Detailed Description

Camera control.


Constructor & Destructor Documentation

MWRender::Camera::Camera ( Ogre::Camera *  camera)

Member Function Documentation

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

Attach camera to object.

const std::string & MWRender::Camera::getHandle ( ) const
void MWRender::Camera::getPosition ( Ogre::Vector3 &  focal,
Ogre::Vector3 &  camera 
)

Stores focal and camera world positions in passed arguments.

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

Reset to defaults.

void MWRender::Camera::rotateCamera ( const Ogre::Vector3 &  rot,
bool  adjust 
)

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

Parameters:
rotRotation angles in radians
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().

Restore default camera distance for current mode.

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

Lowers the camera for sneak. As animation is tied to the camera, this needs to be set each frame after the animation is applied.

void MWRender::Camera::setYaw ( float  angle)
void MWRender::Camera::togglePreviewMode ( bool  enable)
Note:
this may be ignored if an important animation is currently playing
bool MWRender::Camera::toggleVanityMode ( bool  enable)
void MWRender::Camera::update ( float  duration,
bool  paused = false 
)

Updates sound manager listener data.


Member Data Documentation

Ogre::Camera* MWRender::Camera::mCamera [private]
Ogre::SceneNode* MWRender::Camera::mCameraNode [private]
float MWRender::Camera::mFurthest [private]
float MWRender::Camera::mHeight [private]
float MWRender::Camera::mNearest [private]
struct { ... } MWRender::Camera::mVanity [private]

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