12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- #ifndef CAMERA_H
- #define CAMERA_H
- #include "../math/Vector3D.h"
- #include "../math/Matrix3D.h"
- #include "../math/Matrix3DStack.h"
- class Shader
- {
- public:
- Shader();
- Shader(const Shader& orig);
- virtual ~Shader();
-
- void set3DMode(float lag);
- void set2DMode();
-
- void storeCamera();
- void setCamera(float x, float y, float z, float length, float width);
- const Vector3D& getFront() const;
- const Vector3D& getBack() const;
- const Vector3D& getRight() const;
- const Vector3D& getLeft() const;
- const Vector3D& getUp() const;
- const Vector3D& getDown() const;
-
- void setTextureEnabled(bool use);
- void setColorEnabled(bool use);
- void setMixColorEnabled(bool use);
- void setMixColor(float r, float g, float b, float a);
- void setTextMode();
- void setNormalsEnabled(bool use);
-
- void setUseBlending(bool use);
-
- // model matrix operations
-
- void pop();
- void push();
- void setToIdentity();
- void scale(float sx, float sy, float sz);
- void translate(float tx, float ty, float tz);
- void translateX(float tx);
- void translateY(float ty);
- void translateZ(float tz);
- void translateTo(float tx, float ty, float tz);
- void rotate(float xDegrees, float yDegrees, float zDegrees);
- void rotateX(float degrees);
- void rotateY(float degrees);
- void rotateZ(float degrees);
- void updateModelMatrix();
- private:
- Matrix3D proj;
- int unifProjMatrix = 0;
- Matrix3D view;
- int unifViewMatrix = 0;
- Matrix3DStack model;
- int unifModelMatrix = 0;
-
- Vector3D oldCamera;
- Vector3D camera;
- float oldLengthAngle;
- float lengthAngle;
- float oldWidthAngle;
- float widthAngle;
-
- Vector3D front;
- Vector3D back;
- Vector3D right;
- Vector3D left;
- Vector3D up;
- Vector3D down;
-
- float fovY = 60;
- float nearClip = 0.1f;
- float farClip = 1000.0f;
-
- int unifUseTexture = 0;
- int unifUseColor = 0;
- int unifUseMixColor = 0;
- int unifMixColorLoc = 0;
- int unifUseNormals = 0;
- };
- #endif
|