Skip to content

Instantly share code, notes, and snippets.

@terryjsmith
Created October 7, 2014 00:14
Show Gist options
  • Select an option

  • Save terryjsmith/2f4b58fc9df9d2ad08ec to your computer and use it in GitHub Desktop.

Select an option

Save terryjsmith/2f4b58fc9df9d2ad08ec to your computer and use it in GitHub Desktop.
Evolution Camera class
class Camera {
public:
Camera();
~Camera();
public:
// Change translation
void SetTranslation(float x, float y, float z);
void Move(float x, float y, float z);
// Rotate the camera around the current up/right axes (in degrees)
void SetLookAt(float x, float y, float z);
void Rotate(float degrees, glm::vec3 axis);
float* GetRotationMatrix();
public:
glm::vec3 translation;
glm::vec3 look;
glm::vec3 up;
glm::vec3 right;
glm::quat rotation;
float fnear, ffar;
float fov;
float aspect;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment