OpenMW
|
#include <camera.hpp>
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 |
NpcAnimation * | mAnimation |
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 |
Camera control.
MWRender::Camera::Camera | ( | Ogre::Camera * | camera | ) |
void MWRender::Camera::allowVanityMode | ( | bool | allow | ) |
void MWRender::Camera::attachTo | ( | const MWWorld::Ptr & | ptr | ) |
Attach camera to object.
float MWRender::Camera::getCameraDistance | ( | ) | const |
const std::string & MWRender::Camera::getHandle | ( | ) | const |
float MWRender::Camera::getPitch | ( | ) |
void MWRender::Camera::getPosition | ( | Ogre::Vector3 & | focal, |
Ogre::Vector3 & | camera | ||
) |
Stores focal and camera world positions in passed arguments.
float MWRender::Camera::getYaw | ( | ) |
bool MWRender::Camera::isFirstPerson | ( | ) | const [inline] |
bool MWRender::Camera::isFurthest | ( | ) |
bool MWRender::Camera::isNearest | ( | ) |
void MWRender::Camera::processViewChange | ( | ) |
void MWRender::Camera::reset | ( | ) |
Reset to defaults.
void MWRender::Camera::rotateCamera | ( | const Ogre::Vector3 & | rot, |
bool | adjust | ||
) |
Set where the camera is looking at. Uses Morrowind (euler) angles
rot | Rotation angles in radians |
void MWRender::Camera::setAnimation | ( | NpcAnimation * | anim | ) |
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.
adjust | Indicates should distance be adjusted or set. |
override | If true new distance will be used as default. If false, default distance can be restored with setCameraDistance(). |
void MWRender::Camera::setCameraDistance | ( | ) |
Restore default camera distance for current mode.
void MWRender::Camera::setPitch | ( | float | angle | ) |
void MWRender::Camera::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.
void MWRender::Camera::setYaw | ( | float | angle | ) |
void MWRender::Camera::togglePlayerLooking | ( | bool | enable | ) |
void MWRender::Camera::togglePreviewMode | ( | bool | enable | ) |
bool MWRender::Camera::toggleVanityMode | ( | bool | enable | ) |
void MWRender::Camera::toggleViewMode | ( | ) |
void MWRender::Camera::update | ( | float | duration, |
bool | paused = false |
||
) |
void MWRender::Camera::updateListener | ( | ) | [private] |
Updates sound manager listener data.
NpcAnimation* MWRender::Camera::mAnimation [private] |
Ogre::Camera* MWRender::Camera::mCamera [private] |
float MWRender::Camera::mCameraDistance [private] |
Ogre::SceneNode* MWRender::Camera::mCameraNode [private] |
bool MWRender::Camera::mDistanceAdjusted [private] |
bool MWRender::Camera::mFirstPersonView [private] |
bool MWRender::Camera::mFreeLook [private] |
float MWRender::Camera::mFurthest [private] |
float MWRender::Camera::mHeight [private] |
bool MWRender::Camera::mIsFurthest [private] |
bool MWRender::Camera::mIsNearest [private] |
CamData MWRender::Camera::mMainCam [private] |
float MWRender::Camera::mNearest [private] |
CamData MWRender::Camera::mPreviewCam [private] |
bool MWRender::Camera::mPreviewMode [private] |
MWWorld::Ptr MWRender::Camera::mTrackingPtr [private] |
struct { ... } MWRender::Camera::mVanity [private] |
bool MWRender::Camera::mVanityToggleQueued [private] |
bool MWRender::Camera::mViewModeToggleQueued [private] |