Ocean
GLESNode.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_NODE_H
9 #define META_OCEAN_RENDERING_GLES_NODE_H
10 
15 
16 #include "ocean/rendering/Node.h"
17 
20 
21 namespace Ocean
22 {
23 
24 namespace Rendering
25 {
26 
27 namespace GLESceneGraph
28 {
29 
30 // Forward declaration.
31 class GLESFramebuffer;
32 
33 /**
34  * This class implements a GLESceneGraph node object.
35  * @ingroup renderinggles
36  */
37 class OCEAN_RENDERING_GLES_EXPORT GLESNode :
38  virtual public GLESObject,
39  virtual public Node
40 {
41  public:
42 
43  /**
44  * Adds this node and all child nodes to a traverser.
45  * @param framebuffer The framebuffer which the traverser will use when rendering the node
46  * @param projectionMatrix The projection matrix to be applied, must be valid
47  * @param camera_T_object The transformation between object and camera, often denoted as model view matrix, must be valid
48  * @param lights The lights used the render the node and all child nodes, can be empty
49  * @param traverser The traverser to which the node will be added
50  */
51  virtual void addToTraverser(const GLESFramebuffer& framebuffer, const SquareMatrix4& projectionMatrix, const HomogenousMatrix4& camera_T_object, const Lights& lights, GLESTraverser& traverser) const = 0;
52 
53  /**
54  * Returns whether the node is visible.
55  * @see Node::visible().
56  */
57  bool visible() const override;
58 
59  /**
60  * Sets whether the node is visible.
61  * @see Node::setVisible().
62  */
63  void setVisible(const bool visible) override;
64 
65  protected:
66 
67  /**
68  * Creates a new GLESceneGraph node object.
69  */
71 
72  /**
73  * Destructs a GLESceneGraph node object.
74  */
75  ~GLESNode() override;
76 
77  protected:
78 
79  /// True, if the node and all child nodes are visible.
80  bool visible_;
81 };
82 
83 }
84 
85 }
86 
87 }
88 
89 #endif // META_OCEAN_RENDERING_GLES_NODE_H
This class implements a base for all GLESceneGraph framebuffers.
Definition: rendering/glescenegraph/GLESFramebuffer.h:34
This class implements a GLESceneGraph node object.
Definition: GLESNode.h:40
virtual void addToTraverser(const GLESFramebuffer &framebuffer, const SquareMatrix4 &projectionMatrix, const HomogenousMatrix4 &camera_T_object, const Lights &lights, GLESTraverser &traverser) const =0
Adds this node and all child nodes to a traverser.
bool visible() const override
Returns whether the node is visible.
~GLESNode() override
Destructs a GLESceneGraph node object.
bool visible_
True, if the node and all child nodes are visible.
Definition: GLESNode.h:80
GLESNode()
Creates a new GLESceneGraph node object.
void setVisible(const bool visible) override
Sets whether the node is visible.
This class is the base class for all GLESceneGraph objects.
Definition: GLESObject.h:57
This class implements a traverser for renderables.
Definition: GLESTraverser.h:39
This is the base class for all rendering nodes.
Definition: rendering/Node.h:47
std::vector< LightPair > Lights
Definition of a set holding light sources.
Definition: GLESLightSource.h:44
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15