[1378] | 1 | #pragma once
|
---|
| 2 | #include "Node.h"
|
---|
| 3 | #include "Plane.h"
|
---|
| 4 | #include "Scene.h"
|
---|
| 5 |
|
---|
| 6 | class Camera : public Node
|
---|
| 7 | {
|
---|
| 8 | public:
|
---|
| 9 | friend class RenderPass;
|
---|
[1400] | 10 | Camera(const float ratio);
|
---|
[1378] | 11 | ~Camera(void);
|
---|
| 12 |
|
---|
| 13 | void setAngle(float _angle);
|
---|
| 14 | float getAngle(void);
|
---|
| 15 |
|
---|
| 16 | void setRatio(float _ratio);
|
---|
| 17 | float getRatio(void);
|
---|
| 18 |
|
---|
| 19 | void setNearClipping(float _nearClipping);
|
---|
| 20 | float getNearClipping(void);
|
---|
| 21 |
|
---|
| 22 | void setFarClipping(float _farClipping);
|
---|
| 23 | float getFarClipping(void);
|
---|
| 24 |
|
---|
| 25 | void setLookAtTarget(Vector &p);
|
---|
| 26 | void setLookAtTarget(float x, float y, float z);
|
---|
| 27 | Vector getLookAtTarget();
|
---|
| 28 | void setUpVector(Vector &uv);
|
---|
| 29 | void setUpVector(float x, float y, float z);
|
---|
| 30 |
|
---|
| 31 | void setupProjectionMatrix(); //Setzt auch gleich in directX die ProjectionsMatrix!!!
|
---|
| 32 | void setProjectionMatrix(D3DXMATRIX &_projMat);
|
---|
| 33 | D3DXMATRIX* getViewMatrix();
|
---|
| 34 | void setViewMatrix(D3DXMATRIX &_viewMat);
|
---|
| 35 | D3DXMATRIX* getProjectionMatrix();
|
---|
| 36 | virtual void calcWorldMatrix(D3DXMATRIX &pMatWorld);
|
---|
| 37 | virtual void getAbsoluteVector(Vector &pOut, Vector &pIn);
|
---|
| 38 | virtual void update(float dt);
|
---|
| 39 |
|
---|
| 40 | Plane getNearPlane();
|
---|
| 41 | Plane getFarPlane();
|
---|
| 42 | Plane getLeftPlane();
|
---|
| 43 | Plane getRightPlane();
|
---|
| 44 | Plane getTopPlane();
|
---|
| 45 | Plane getBottomPlane();
|
---|
| 46 |
|
---|
| 47 | //Defines if the projectionmatrix has to be updated
|
---|
| 48 | bool updateProjection;
|
---|
| 49 |
|
---|
| 50 | virtual Node* clone();
|
---|
| 51 |
|
---|
| 52 | protected:
|
---|
| 53 | float angle;
|
---|
| 54 | float nearClipping;
|
---|
| 55 | float farClipping;
|
---|
| 56 | float ratio;
|
---|
| 57 |
|
---|
| 58 | Plane pNear;
|
---|
| 59 | Plane pFar;
|
---|
| 60 | Plane pLeft;
|
---|
| 61 | Plane pRight;
|
---|
| 62 | Plane pTop;
|
---|
| 63 | Plane pBottom;
|
---|
| 64 |
|
---|
| 65 | void updateClippingPlanes();
|
---|
| 66 | Plane transformPlane(Plane &plane);
|
---|
| 67 |
|
---|
| 68 | Vector lookAtTarget;
|
---|
| 69 | D3DXVECTOR3 upVector;
|
---|
| 70 | D3DXMATRIX myViewMatrix;
|
---|
| 71 | D3DXMATRIXA16 matProj;
|
---|
| 72 |
|
---|
| 73 | Vector oldPos;
|
---|
| 74 | };
|
---|