📄 oasiscamerasystem.h
字号:
/******************************************************************************
* This source file is part of Bad Camel Gaming
* Copyright (C) 2003 Zephie Greyvenstein
* See Readme.html for acknowledgements
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*****************************************************************************/
/******************************************************************************
* FILENAME : oasisCameraSystem.h
* DESCRIPTION : Camera system
* AUTHOR : Zephie Greyvenstein
*****************************************************************************/
/// Avoid double inclusion
#ifndef __CAMERASYSTEM_H__
#define __CAMERASYSTEM_H__
/// Include common stuff
#include "oasisCommon.h"
/// Include the rest of the needed oasis stuff
#include "oasisSystem.h"
#include "oasisMovable.h"
#include "oasisVector3.h"
#include "oasisSingleton.h"
/// Forwrd declare ogre stuff
namespace Ogre {
class Camera;
class SceneNode;
class Animation;
class AnimationState;
};
namespace Oasis {
/// Camera system
class _oasisExport cameraSystem : public system,
public movable,
public singleton< cameraSystem > {
public:
/// Constructor
cameraSystem( );
/// Destructor
virtual ~cameraSystem( );
/// Get singleton
static cameraSystem &get( void );
/// Get singleton pointer
static cameraSystem *getPtr( void );
/// Reset this system
void reset( void );
/// Update this system
void update( real time );
/// Enable/disable the camera as the sound listener
void setSoundListener( bool isListener );
/// Set the direction vector
void setDirection( real x, real y, real z );
/// Set the direction vector
void setDirection( const vector3 &newDirection );
/// Look at an object
void lookAt( const object *target );
/// Look at a point in space
void lookAt( real x, real y, real z );
/// Look at a point in space
void lookAt( const vector3 &target );
/// Roll the camera anticlockwise ( Z axis )
void roll( real degrees );
/// Yaw the camera anticlockwise ( Y axis )
void yaw( real degrees );
/// Pitch the camera anticlockwise ( X axis )
void pitch( real degrees );
/// Set the yaw axis to use, if any
void setFixedYawAxis( bool newState,
const vector3 &axis = vector3::UNITY );
private:
/// Handle to the camera
Ogre::Camera *camera;
/// Handle to the scenenode for the camera
Ogre::SceneNode *cameraNode;
/// Are we updating sound listener
bool listener;
/// Listener event for frame started
bool listenerStarted( real time );
/// Listener event for frame ended
bool listenerEnded( real time );
/// Update the sound listener values
void _updateSoundListener( void );
/// Update position
void _updatePosition( void );
/// Update orientation
void _updateOrientation( void );
};
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -