Ocean
Loading...
Searching...
No Matches
GLESPerspectiveView.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#ifndef META_OCEAN_RENDERING_GLES_PERSPECTIVE_VIEW_H
9#define META_OCEAN_RENDERING_GLES_PERSPECTIVE_VIEW_H
10
13
15
16#include "ocean/math/Numeric.h"
17
18namespace Ocean
19{
20
21namespace Rendering
22{
23
24namespace GLESceneGraph
25{
26
27/**
28 * This class implements a perspective view for GLESceneGraph.
29 * @ingroup renderinggles
30 */
31class OCEAN_RENDERING_GLES_EXPORT GLESPerspectiveView :
32 virtual public GLESView,
33 virtual public PerspectiveView
34{
35 friend class GLESFactory;
36
37 public:
38
39 /**
40 * Returns the horizontal field of view in radian.
41 * @see View::fovX().
42 */
43 Scalar fovX() const override;
44
45 /**
46 * Sets the horizontal field of view in radian.
47 * @see View::setFovX().
48 */
49 bool setFovX(const Scalar fovx) override;
50
51 /**
52 * Returns a viewing ray into the scene.
53 * @see View::viewingRay().
54 */
55 Line3 viewingRay(const Scalar x, const Scalar y, const unsigned int width, const unsigned int height) const override;
56
57 /**
58 * Sets the projection matrix explicitly.
59 * @see PerspectiveView::setProjectionMatrix().
60 */
61 void setProjectionMatrix(const SquareMatrix4& clip_T_view) override;
62
63 protected:
64
65 /**
66 * Creates a new perspective view.
67 */
69
70 /**
71 * Destructs a perspective view.
72 */
74
75 /**
76 * (Re-)calculates the view projection matrix.
77 * @see GLESView::calculateProjectionMatrix().
78 */
80
81 protected:
82
83 /// The view's horizontal field of view in radian, with range (0, PI)
85};
86
87}
88
89}
90
91}
92
93#endif // META_OCEAN_RENDERING_GLES_PERSPECTIVE_VIEW_H
static constexpr Scalar deg2rad(const Scalar deg)
friend class GLESFactory
Definition GLESPerspectiveView.h:35
Scalar fovX_
The view's horizontal field of view in radian, with range (0, PI).
Definition GLESPerspectiveView.h:84
Scalar fovX() const override
Returns the horizontal field of view in radian.
GLESPerspectiveView()
Creates a new perspective view.
~GLESPerspectiveView() override
Destructs a perspective view.
bool calculateProjectionMatrix() override
(Re-)calculates the view projection matrix.
Line3 viewingRay(const Scalar x, const Scalar y, const unsigned int width, const unsigned int height) const override
Returns a viewing ray into the scene.
bool setFovX(const Scalar fovx) override
Sets the horizontal field of view in radian.
void setProjectionMatrix(const SquareMatrix4 &clip_T_view) override
Sets the projection matrix explicitly.
GLESView()
Creates a new view object.
PerspectiveView()
Creates a new perspective view object.
LineT3< Scalar > Line3
Definition of the Line3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with single o...
Definition Line3.h:27
SquareMatrixT4< Scalar > SquareMatrix4
Definition of the SquareMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with ...
Definition SquareMatrix4.h:39
float Scalar
Definition of a scalar type.
Definition Math.h:129
Namespace of the Rendering GLESceneGraph library.
Definition rendering/glescenegraph/android/Android.h:20
Namespace of the Rendering library.
Definition AbsoluteTransform.h:18
The namespace covering the entire Ocean framework.
Definition Accessor.h:15