Ocean
rendering/Background.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_BACKGROUND_H
9 #define META_OCEAN_RENDERING_BACKGROUND_H
10 
12 #include "ocean/rendering/Node.h"
13 
14 #include "ocean/math/Quaternion.h"
15 
16 namespace Ocean
17 {
18 
19 namespace Rendering
20 {
21 
22 // Forward declaration
23 class Background;
24 
25 /**
26  * Definition of a smart object reference holding a background.
27  * @see SmartObjectRef, Background.
28  * @ingroup rendering
29  */
31 
32 /**
33  * This class is the base class for all backgrounds.
34  * @ingroup rendering
35  */
36 class OCEAN_RENDERING_EXPORT Background : virtual public Node
37 {
38  public:
39 
40  /**
41  * Returns the distance between the world coordinate system and the background object.
42  * The default value is 1000.
43  * @return Background distance
44  * @see setDistance().
45  */
46  virtual Scalar distance() const;
47 
48  /**
49  * Returns the position used for this background.
50  * The position is defined in relation to the center of projection.
51  * @return Background position
52  */
53  virtual Vector3 position() const;
54 
55  /**
56  * Returns the orientation used for this background.
57  * @return Background orientation
58  */
59  virtual Quaternion orientation() const;
60 
61  /**
62  * Sets the distance between world coordinate system and the background object.
63  * @param distance Distance to set, must be positive
64  * @return True, if succeeded
65  * @see distance().
66  */
67  virtual bool setDistance(const Scalar distance);
68 
69  /**
70  * Sets the position used for this background.
71  * The position is defined in relation to the center of projection.
72  * @param position Background position to set
73  */
74  virtual void setPosition(const Vector3& position);
75 
76  /**
77  * Sets the orientation used for this background.
78  * @param orientation Background orientation to set
79  */
80  virtual void setOrientation(const Quaternion& orientation);
81 
82  /**
83  * Returns the type of this object.
84  * @see Object::type().
85  */
86  ObjectType type() const override;
87 
88  protected:
89 
90  /// Background distance;
92 
93  /**
94  * Creates a new background object.
95  */
97 
98  /**
99  * Destructs a background object.
100  */
101  ~Background() override;
102 };
103 
104 }
105 
106 }
107 
108 #endif // META_OCEAN_RENDERING_BACKGROUND_H
This class is the base class for all backgrounds.
Definition: rendering/Background.h:37
virtual Scalar distance() const
Returns the distance between the world coordinate system and the background object.
Background()
Creates a new background object.
virtual bool setDistance(const Scalar distance)
Sets the distance between world coordinate system and the background object.
~Background() override
Destructs a background object.
virtual void setPosition(const Vector3 &position)
Sets the position used for this background.
ObjectType type() const override
Returns the type of this object.
virtual void setOrientation(const Quaternion &orientation)
Sets the orientation used for this background.
virtual Vector3 position() const
Returns the position used for this background.
virtual Quaternion orientation() const
Returns the orientation used for this background.
Scalar backgroundDistance
Background distance;.
Definition: rendering/Background.h:91
This is the base class for all rendering nodes.
Definition: rendering/Node.h:47
ObjectType
Definition of different object type.
Definition: Object.h:63
This class implements a smart rendering object reference.
Definition: rendering/ObjectRef.h:34
float Scalar
Definition of a scalar type.
Definition: Math.h:128
SmartObjectRef< Background > BackgroundRef
Definition of a smart object reference holding a background.
Definition: rendering/Background.h:23
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15