Ocean
GIPointLight.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_GI_POINT_LIGHT_H
9 #define META_OCEAN_RENDERING_GI_POINT_LIGHT_H
10 
13 
15 
16 namespace Ocean
17 {
18 
19 namespace Rendering
20 {
21 
22 namespace GlobalIllumination
23 {
24 
25 /**
26  * This class implements a point light.
27  * @ingroup renderinggi
28  */
29 class OCEAN_RENDERING_GI_EXPORT GIPointLight :
30  virtual public GILightSource,
31  virtual public PointLight
32 {
33  friend class GIFactory;
34 
35  public:
36 
37  /**
38  * Returns the position of the light object.
39  * @see PointLight::position().
40  */
41  Vector3 position() const override;
42 
43  /**
44  * Returns the attenuation factors of the point light.
45  * @see PointLight::attenuation().
46  */
47  Vector3 attenuation() const override;
48 
49  /**
50  * Returns the position of the light object.
51  * @see position().
52  */
53  inline const Vector3& positionInline() const;
54 
55  /**
56  * Returns the attenuation factors of the point light.
57  * @see attenuation().
58  */
59  inline const Vector3& attenuationInline() const;
60 
61  /**
62  * Sets the position of the light object.
63  * @see PointLight::setPosition().
64  */
65  void setPosition(const Vector3& position) override;
66 
67  /**
68  * Sets the attenuation factors for the point light.
69  * @see PointLight::setAttenuation().
70  */
71  bool setAttenuation(const Vector3& factors) override;
72 
73  protected:
74 
75  /**
76  * Creates a new point light object.
77  */
79 
80  /**
81  * Destructs a point light object.
82  */
83  ~GIPointLight() override;
84 
85  protected:
86 
87  /// Light position inside the local coordinate system.
89 
90  /// Attenuation factor vector, with order (constant, linear, quadratic).
92 };
93 
95 {
96  return lightPosition;
97 }
98 
100 {
102 }
103 
104 }
105 
106 }
107 
108 }
109 
110 #endif // META_OCEAN_RENDERING_GI_POINT_LIGHT_H
This class implements a class factory for all Global Illumination objects.
Definition: GIFactory.h:30
This class is the base class for all Global Illumination light sources.
Definition: GILightSource.h:49
This class implements a point light.
Definition: GIPointLight.h:32
bool setAttenuation(const Vector3 &factors) override
Sets the attenuation factors for the point light.
Vector3 attenuation() const override
Returns the attenuation factors of the point light.
Vector3 lightPosition
Light position inside the local coordinate system.
Definition: GIPointLight.h:88
~GIPointLight() override
Destructs a point light object.
const Vector3 & positionInline() const
Returns the position of the light object.
Definition: GIPointLight.h:94
Vector3 position() const override
Returns the position of the light object.
const Vector3 & attenuationInline() const
Returns the attenuation factors of the point light.
Definition: GIPointLight.h:99
void setPosition(const Vector3 &position) override
Sets the position of the light object.
GIPointLight()
Creates a new point light object.
Vector3 lightAttenuationFactors
Attenuation factor vector, with order (constant, linear, quadratic).
Definition: GIPointLight.h:91
This class is the base class for all point lights.
Definition: rendering/PointLight.h:43
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15