00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef __CAMERACOMPONENT_H__
00017 #define __CAMERACOMPONENT_H__
00018
00019
00020 #include "../../dependencies.h"
00021 #include "SceneComponent.h"
00022
00023
00024
00033 class CameraComponent : public SceneComponent
00034 {
00035 public:
00036
00037
00041 CameraComponent(Entity *parent, const vector3df &lookat = vector3df(0, 0, 100));
00043 ~CameraComponent();
00044
00045
00048 ICameraSceneNode* getCameraSceneNode();
00049
00052 void bindTargetAndRotation(bool bound);
00054 bool getTargetAndRotationBinding() const;
00055
00057 f32 getAspectRatio() const;
00059 f32 getFarValue() const;
00061 f32 getFOV() const;
00063 f32 getNearValue() const;
00065 const matrix4& getProjectionMatrix() const;
00067 const vector3df& getTarget() const;
00069 const vector3df& getUpVector() const;
00071 const matrix4& getViewMatrix() const;
00073 bool getIsOrthogonal() const;
00074
00082 void setAsMainCamera();
00091 void setAspectRatio(f32 aspect);
00100 void setFarValue(f32 value);
00109 void setFOV(f32 value);
00118 void setNearValue(f32 value);
00122 void setProjectionMatrix(const matrix4 &projection, bool isOrthogonal = false);
00125 void setRotation(const vector3df &rotation);
00134 void setTarget(const vector3df &position);
00143 void setUpVector(const vector3df &position);
00144
00146 void setNormalMode();
00159 void setFPSMode(f32 rotateSpeed = 100.0f, f32 moveSpeed = 0.5f, bool verticalMovement = false,
00160 f32 jumpSpeed = 0.0f);
00172 void setMayaMode(f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f,
00173 f32 translationSpeed = 1500.0f);
00174
00175
00178 static bool parseXML(IXMLReader *file, Entity *entity);
00179
00180 private:
00181
00182
00183 ICameraSceneNode *mCameraSN;
00184 ISceneNodeAnimator *mCameraAnimator;
00185 };
00186
00187 #endif
00188