Ocean
Loading...
Searching...
No Matches
GLESPointLight.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_POINT_LIGHT_H
9#define META_OCEAN_RENDERING_GLES_POINT_LIGHT_H
10
13
15
16namespace Ocean
17{
18
19namespace Rendering
20{
21
22namespace GLESceneGraph
23{
24
25/**
26 * This class implements a GLESceneGraph point light object.
27 * @ingroup renderinggles
28 */
29class OCEAN_RENDERING_GLES_EXPORT GLESPointLight :
30 virtual public GLESLightSource,
31 virtual public PointLight
32{
33 friend class GLESFactory;
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 * Sets the position of the light object.
51 * @see PointLight::setPosition().
52 */
53 void setPosition(const Vector3& position) override;
54
55 /**
56 * Sets the attenuation factors for the point light.
57 * @see PointLight::setAttenuation().
58 */
59 bool setAttenuation(const Vector3& factors) override;
60
61 /**
62 * Binds this light source.
63 * @see GLESLightSource::bindLight().
64 */
65 void bindLight(GLESShaderProgram& shaderProgram, const HomogenousMatrix4& camera_T_model, const HomogenousMatrix4& camera_T_world, const SquareMatrix3& normalMatrix, const unsigned int index) override;
66
67 protected:
68
69 /**
70 * Creates a new GLESceneGraph point light object.
71 */
73
74 /**
75 * Destructs a GLESceneGraph point light object.
76 */
77 ~GLESPointLight() override;
78
79 protected:
80
81 /// Light position inside the local coordinate system.
83
84 /// Attenuation factor vector, with order (constant, linear, quadratic).
86};
87
88}
89
90}
91
92}
93
94#endif // META_OCEAN_RENDERING_GLES_POINT_LIGHT_H
This class implements a class factory for all GLESceneGraph objects.
Definition GLESFactory.h:30
This class is the base class for all GLESceneGraph light sources.
Definition GLESLightSource.h:53
This class implements a GLESceneGraph point light object.
Definition GLESPointLight.h:32
Vector3 attenuation() const override
Returns the attenuation factors of the point light.
Vector3 position_
Light position inside the local coordinate system.
Definition GLESPointLight.h:82
void setPosition(const Vector3 &position) override
Sets the position of the light object.
~GLESPointLight() override
Destructs a GLESceneGraph point light object.
Vector3 attenuationFactors_
Attenuation factor vector, with order (constant, linear, quadratic).
Definition GLESPointLight.h:85
GLESPointLight()
Creates a new GLESceneGraph point light object.
Vector3 position() const override
Returns the position of the light object.
void bindLight(GLESShaderProgram &shaderProgram, const HomogenousMatrix4 &camera_T_model, const HomogenousMatrix4 &camera_T_world, const SquareMatrix3 &normalMatrix, const unsigned int index) override
Binds this light source.
bool setAttenuation(const Vector3 &factors) override
Sets the attenuation factors for the point light.
This class implements a container for an OpenGL ES shader program.
Definition GLESShaderProgram.h:53
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