camera.h
Go to the documentation of this file.
1 /*
2  * Copyright 2014 Google Inc. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef TANGO_GL_CAMERA_H_
18 #define TANGO_GL_CAMERA_H_
19 
20 #include "tango-gl/transform.h"
21 
22 namespace tango_gl {
23 class Camera : public Transform {
24  public:
25  Camera();
26  Camera(const Camera& other) = delete;
27  Camera& operator=(const Camera&) = delete;
28  ~Camera();
29 
30  void SetWindowSize(const float width, const float height);
31  void SetFieldOfView(const float fov);
32  void SetOrthoMode(bool enabled) {ortho_ = enabled;}
34  void SetOrthoCropFactor(float value) {orthoCropFactor_ = value;}
35  void SetNearFarClipPlanes(const float near, const float far);
36 
39  float getNearClipPlane() const {return near_clip_plane_;}
40  float getFarClipPlane() const {return far_clip_plane_;}
41 
54  static glm::mat4 ProjectionMatrixForCameraIntrinsics(float width, float height,
55  float fx, float fy,
56  float cx, float cy,
57  float near, float far);
58  protected:
61  float width_;
62  float height_;
64  bool ortho_;
65  float orthoScale_;
67 };
68 } // namespace tango_gl
69 #endif // TANGO_GL_CAMERA_H_
float height_
Definition: camera.h:62
void SetNearFarClipPlanes(const float near, const float far)
Definition: camera.cpp:56
float field_of_view_
Definition: camera.h:59
void SetWindowSize(const float width, const float height)
Definition: camera.cpp:46
GLM_FUNC_DECL detail::tmat4x4< T, P > scale(detail::tmat4x4< T, P > const &m, detail::tvec3< T, P > const &v)
static glm::mat4 ProjectionMatrixForCameraIntrinsics(float width, float height, float fx, float fy, float cx, float cy, float near, float far)
Definition: camera.cpp:65
float getFarClipPlane() const
Definition: camera.h:40
void SetFieldOfView(const float fov)
Definition: camera.cpp:52
void SetOrthoMode(bool enabled)
Definition: camera.h:32
float orthoCropFactor_
Definition: camera.h:66
Camera & operator=(const Camera &)=delete
float near_clip_plane_
Definition: camera.h:63
void SetOrthoCropFactor(float value)
Definition: camera.h:34
float getNearClipPlane() const
Definition: camera.h:39
float aspect_ratio_
Definition: camera.h:60
float far_clip_plane_
Definition: camera.h:63
glm::mat4 GetProjectionMatrix()
Definition: camera.cpp:38
float width_
Definition: camera.h:61
void SetOrthoScale(float scale)
Definition: camera.h:33
glm::mat4 GetViewMatrix()
Definition: camera.cpp:34
float orthoScale_
Definition: camera.h:65


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:34:58