Tango: Added Ortho mode (#193)

This commit is contained in:
matlabbe
2017-06-12 15:36:33 -04:00
parent bbaac8b2b1
commit c00119989e
12 changed files with 213 additions and 69 deletions

View File

@@ -27,8 +27,11 @@ class Camera : public Transform {
Camera& operator=(const Camera&) = delete;
~Camera();
void SetAspectRatio(const float aspect_ratio);
void SetWindowSize(const float width, const float height);
void SetFieldOfView(const float fov);
void SetOrthoMode(bool enabled) {ortho_ = enabled;}
void SetOrthoScale(float scale) {orthoScale_ = scale;}
void SetOrthoCropFactor(float value) {orthoCropFactor_ = value;}
void SetNearFarClipPlanes(const float near, const float far);
glm::mat4 GetViewMatrix();
@@ -55,7 +58,12 @@ class Camera : public Transform {
protected:
float field_of_view_;
float aspect_ratio_;
float width_;
float height_;
float near_clip_plane_, far_clip_plane_;
bool ortho_;
float orthoScale_;
float orthoCropFactor_;
};
} // namespace tango_gl
#endif // TANGO_GL_CAMERA_H_

View File

@@ -29,7 +29,8 @@ class GestureCamera : public Camera {
kFirstPerson = 0,
kThirdPersonFollow = 1,
kTopDown = 2,
kThirdPerson = 3
kTopOrtho = 3,
kThirdPerson = 4
};
enum TouchEvent {