Ocean
Loading...
Searching...
No Matches
GLESParallelView.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_PARALLEL_VIEW_H
9#define META_OCEAN_RENDERING_GLES_PARALLEL_VIEW_H
10
13
15
16namespace Ocean
17{
18
19namespace Rendering
20{
21
22namespace GLESceneGraph
23{
24
25/**
26 * This class implements a parallel (orthographic) view for GLESceneGraph.
27 * @ingroup renderinggles
28 */
29class OCEAN_RENDERING_GLES_EXPORT GLESParallelView :
30 virtual public GLESView,
31 virtual public ParallelView
32{
33 friend class GLESFactory;
34
35 public:
36
37 /**
38 * Returns the width of the orthographic viewing box in world units.
39 * @return The view width in world units
40 */
41 Scalar width() const override;
42
43 /**
44 * Sets the width of the orthographic viewing box in world units.
45 * The height is automatically derived from the width and aspect ratio.
46 * @param width The view width in world units, with range (0, infinity)
47 * @return True if succeeded
48 */
49 bool setWidth(const Scalar width) override;
50
51 /**
52 * Returns a viewing ray into the scene.
53 * For parallel projection, all rays have the same direction (parallel to camera's forward axis).
54 * @see View::viewingRay().
55 */
56 Line3 viewingRay(const Scalar x, const Scalar y, const unsigned int width, const unsigned int height) const override;
57
58 protected:
59
60 /**
61 * Creates a new parallel view.
62 */
64
65 /**
66 * Destructs a parallel view.
67 */
69
70 /**
71 * (Re-)calculates the view projection matrix using orthographic projection.
72 * @see GLESView::calculateProjectionMatrix().
73 */
75
76 protected:
77
78 /// The view's width in world units, with range (0, infinity)
80};
81
82}
83
84}
85
86}
87
88#endif // META_OCEAN_RENDERING_GLES_PARALLEL_VIEW_H
friend class GLESFactory
Definition GLESParallelView.h:33
GLESParallelView()
Creates a new parallel view.
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.
~GLESParallelView() override
Destructs a parallel view.
bool setWidth(const Scalar width) override
Sets the width of the orthographic viewing box in world units.
Scalar width() const override
Returns the width of the orthographic viewing box in world units.
Scalar width_
The view's width in world units, with range (0, infinity).
Definition GLESParallelView.h:79
bool calculateProjectionMatrix() override
(Re-)calculates the view projection matrix using orthographic projection.
GLESView()
Creates a new view object.
ParallelView()
Creates a new parallel 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
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