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
00026 class CameraComponent : public SceneComponent
00027 {
00028 public:
00029
00030
00034 CameraComponent(Entity *parent, const vector3df &lookat = vector3df(0, 0, 100));
00036 ~CameraComponent();
00037
00038
00041 static CameraComponent* refFactory(Entity *parent);
00044 static CameraComponent* refFactory(Entity *parent, const vector3df &lookat);
00045
00046
00049 ICameraSceneNode* getCameraSceneNode();
00050
00053 void bindTargetAndRotation(bool bound);
00055 bool getTargetAndRotationBinding() const;
00056
00058 f32 getAspectRatio() const;
00060 f32 getFarValue() const;
00062 f32 getFOV() const;
00064 f32 getNearValue() const;
00066 const matrix4& getProjectionMatrix() const;
00068 const vector3df& getTarget() const;
00070 const vector3df& getUpVector() const;
00072 const matrix4& getViewMatrix() const;
00074 bool getIsOrthogonal() const;
00075
00077 void setAsMainCamera();
00080 void setAspectRatio(f32 aspect);
00083 void setFarValue(f32 value);
00086 void setFOV(f32 value);
00089 void setNearValue(f32 value);
00093 void setProjectionMatrix(const matrix4 &projection, bool isOrthogonal = false);
00096 void setRotation(const vector3df &rotation);
00099 void setTarget(const vector3df &position);
00102 void setUpVector(const vector3df &position);
00103
00105 void setNormalMode();
00112 void setFPSMode(f32 rotateSpeed = 100.0f, f32 moveSpeed = 0.5f, bool verticalMovement = false,
00113 f32 jumpSpeed = 0.0f);
00119 void setMayaMode(f32 rotateSpeed = -1500.0f, f32 zoomSpeed = 200.0f,
00120 f32 translationSpeed = 1500.0f);
00121
00122 private:
00123
00124
00125 ICameraSceneNode *mCameraSN;
00126 ISceneNodeAnimator *mCameraAnimator;
00127 };
00128
00129
00130
00132 extern void bindCameraComponent(asIScriptEngine *engine);
00133
00134 #endif
00135