CameraBase.hh 1.54 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
48
49
50
51
    virtual glm::uvec2 getViewportSize() const = 0;
};

}
}