Blender V5.0
NodeCamera.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
11
12#include "Node.h"
13
14#include "../geometry/Geom.h"
15
17
18namespace Freestyle {
19
20using namespace Geometry;
21
23
25
26class NodeCamera : public Node {
27 public:
33
35 NodeCamera(CameraType camera_type = GENERIC);
36#if 0 /* UNUSED, gives warning in gcc */
37 NodeCamera(const NodeCamera &iBrother);
38#endif
39
40 virtual ~NodeCamera() {}
41
43 virtual void accept(SceneVisitor &v);
44
46 void setModelViewMatrix(const double modelview_matrix[16]);
47
49 void setProjectionMatrix(const double projection_matrix[16]);
50
52 {
53 return modelview_matrix_;
54 }
55
57 {
58 return projection_matrix_;
59 }
60
61 protected:
62 // row major right handed matrix
64 // row major right handed matrix
66
68
69 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:NodeCamera")
70};
71
73 public:
75
91 double left, double right, double bottom, double top, double zNear, double zFar);
92
93 double left() const
94 {
95 return left_;
96 }
97
98 double right() const
99 {
100 return right_;
101 }
102
103 double bottom() const
104 {
105 return bottom_;
106 }
107
108 double top() const
109 {
110 return top_;
111 }
112
113 double zNear() const
114 {
115 return zNear_;
116 }
117
118 double zFar() const
119 {
120 return zFar_;
121 }
122
124
125 private:
126 double left_;
127 double right_;
128 double bottom_;
129 double top_;
130 double zNear_;
131 double zFar_;
132
133 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:NodeOrthographicCamera")
134};
135
137 public:
139
160 NodePerspectiveCamera(double fovy, double aspect, double zNear, double zFar);
161
193 double left, double right, double bottom, double top, double zNear, double zFar);
194
195 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:NodePerspectiveCamera")
196};
197
198} /* namespace Freestyle */
Configuration definitions.
Vectors and Matrices (useful type definitions).
Abstract class for scene graph nodes. Inherits from BaseObject which defines the addRef release mecha...
ATTR_WARN_UNUSED_RESULT const BMVert * v
CameraType camera_type_
Definition NodeCamera.h:67
double projection_matrix_[16]
Definition NodeCamera.h:65
void setModelViewMatrix(const double modelview_matrix[16])
virtual void accept(SceneVisitor &v)
double modelview_matrix_[16]
Definition NodeCamera.h:63
NodeCamera(CameraType camera_type=GENERIC)
double * modelViewMatrix()
Definition NodeCamera.h:51
double * projectionMatrix()
Definition NodeCamera.h:56
void setProjectionMatrix(const double projection_matrix[16])
NodeOrthographicCamera(const NodeOrthographicCamera &iBrother)=default
uint top
CameraType
static int left
inherits from class Rep
Definition AppCanvas.cpp:20