CameraBase.hh 2 KB
Newer Older
1
2
3
4
5
/***********************************************************************
 * Copyright 2011-2013 Computer Graphics Group RWTH Aachen University. *
 * All rights reserved.                                                *
 * Distributed under the terms of the MIT License (see LICENSE.TXT).   *
 **********************************************************************/
6
7
#pragma once

8
#include <ACGL/ACGL.hh>
9
10
11
12
13
14
15
#include <ACGL/Math/Math.hh>

namespace ACGL{
namespace Scene{

/**
 * @brief Common interface for cameras
Philip Trettner's avatar
Philip Trettner committed
16
17
 *
 * This interface only contains getter on purpose.
18
19
 * All logic that wants to modify a camera should know the actual structure of the camera and therefore use the
 * specific subclass.
20
21
22
23
24
25
26
27
 */
class CameraBase
{
protected:
    CameraBase();
public:
    virtual ~CameraBase();

Philip Trettner's avatar
Philip Trettner committed
28
29
30
31
    /**
     * @brief gets the Position of the camera
     * @return a 3-dimensional position in the global coordinate system
     */
32
    virtual glm::vec3 getPosition() const = 0;
Philip Trettner's avatar
Philip Trettner committed
33
34
35
36
    /**
     * @brief gets the ViewMatrix of the camera
     * @return a 4x4 matrix containing projection independent camera transforms
     */
37
    virtual glm::mat4 getViewMatrix() const = 0;
Philip Trettner's avatar
Philip Trettner committed
38
39
40
41
    /**
     * @brief gets the ProjectionMatrix of the camera
     * @return a 4x4 matrix containing the projection into normalized device coordinates
     */
42
    virtual glm::mat4 getProjectionMatrix() const = 0;
Philip Trettner's avatar
Philip Trettner committed
43
44
45
46
    /**
     * @brief gets the ViewportSize of the current viewport of this camera
     * @return the 2-dimensional size of the viewport
     */
47
    virtual glm::uvec2 getViewportSize() const = 0;
48
49
50
51
52
53
54
55
56
57
58
    /**
     * @brief Gets the near clipping plane as a distance from the camera.
     * @return the near clipping plane
     */
    virtual float getNearClippingPlane() const = 0;
    /**
     * @brief Gets the far clipping plane as a distance from the camera. Note that it could be inf!
     * Not all projection matrices have a real far plane but some are unlimited!
     * @return the near clipping plane
     */
    virtual float getFarClippingPlane() const = 0;
59
60
61
62
};

}
}