#pragma once #include "Node.h" #include "Plane.h" #include "Scene.h" class Camera : public Node { public: friend class RenderPass; Camera(const float ratio); ~Camera(void); void setAngle(float _angle); float getAngle(void); void setRatio(float _ratio); float getRatio(void); void setNearClipping(float _nearClipping); float getNearClipping(void); void setFarClipping(float _farClipping); float getFarClipping(void); void setLookAtTarget(Vector &p); void setLookAtTarget(float x, float y, float z); Vector getLookAtTarget(); void setUpVector(Vector &uv); void setUpVector(float x, float y, float z); void setupProjectionMatrix(); //Setzt auch gleich in directX die ProjectionsMatrix!!! void setProjectionMatrix(D3DXMATRIX &_projMat); D3DXMATRIX* getViewMatrix(); void setViewMatrix(D3DXMATRIX &_viewMat); D3DXMATRIX* getProjectionMatrix(); virtual void calcWorldMatrix(D3DXMATRIX &pMatWorld); virtual void getAbsoluteVector(Vector &pOut, Vector &pIn); virtual void update(float dt); Plane getNearPlane(); Plane getFarPlane(); Plane getLeftPlane(); Plane getRightPlane(); Plane getTopPlane(); Plane getBottomPlane(); //Defines if the projectionmatrix has to be updated bool updateProjection; virtual Node* clone(); protected: float angle; float nearClipping; float farClipping; float ratio; Plane pNear; Plane pFar; Plane pLeft; Plane pRight; Plane pTop; Plane pBottom; void updateClippingPlanes(); Plane transformPlane(Plane &plane); Vector lookAtTarget; D3DXVECTOR3 upVector; D3DXMATRIX myViewMatrix; D3DXMATRIXA16 matProj; Vector oldPos; };