SGCT master (487fac4)
Simple Graphics Cluster Toolkit
Loading...
Searching...
No Matches
projection.h
Go to the documentation of this file.
1/*****************************************************************************************
2 * SGCT *
3 * Simple Graphics Cluster Toolkit *
4 * *
5 * Copyright (c) 2012-2026 *
6 * For conditions of distribution and use, see copyright notice in LICENSE.md *
7 ****************************************************************************************/
8
9#ifndef __SGCT__PROJECTION__H__
10#define __SGCT__PROJECTION__H__
11
12#include <sgct/sgctexports.h>
13
14#include <sgct/math.h>
15
16namespace sgct {
17
18class ProjectionPlane;
19
23class SGCT_EXPORT Projection {
24public:
25 void calculateProjection(vec3 base, const ProjectionPlane& proj, float nearClip,
26 float farClip, vec3 offset = vec3{ 0.f, 0.f, 0.f });
27
28 const mat4& viewProjectionMatrix() const;
29 const mat4& viewMatrix() const;
30 const mat4& projectionMatrix() const;
31
32private:
33 struct Frustum {
34 float left = -1.f;
35 float right = 1.f;
36 float bottom = -1.f;
37 float top = 1.f;
38 float nearPlane = 0.1f;
39 float farPlane = 100.f;
40 };
41
42 mat4 _viewMatrix = mat4(1.f);
43 mat4 _viewProjectionMatrix = mat4(1.f);
44 mat4 _projectionMatrix = mat4(1.f);
45
46 Frustum _frustum;
47};
48
49} // namespace sgct
50
51#endif // __SGCT__PROJECTION__H__
This class holds and manages 3D projections.
Definition projection.h:23
void calculateProjection(vec3 base, const ProjectionPlane &proj, float nearClip, float farClip, vec3 offset=vec3{ 0.f, 0.f, 0.f })
const mat4 & projectionMatrix() const
const mat4 & viewProjectionMatrix() const
const mat4 & viewMatrix() const
This class holds and manages the 3D projection plane.
Definition projectionplane.h:21
Definition actions.h:16
Definition math.h:89
Definition math.h:56