Ocean
Loading...
Searching...
No Matches
GLESSpotLight.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_SPOT_LIGHT_H
9#define META_OCEAN_RENDERING_GLES_SPOT_LIGHT_H
10
13
15
16#include "ocean/math/Numeric.h"
17
18namespace Ocean
19{
20
21namespace Rendering
22{
23
24namespace GLESceneGraph
25{
26
27/**
28 * This class implements a GLESceneGraph spot light.
29 * @ingroup renderinggles
30 */
31class OCEAN_RENDERING_GLES_EXPORT GLESSpotLight :
32 virtual public GLESPointLight,
33 virtual public SpotLight
34{
35 friend class GLESFactory;
36
37 public:
38
39 /**
40 * Returns the direction of this directional light.
41 * @see SpotLight::direction().
42 */
43 Vector3 direction() const override;
44
45 /**
46 * Returns the angle of the light cone in radian.
47 * @see SpotLight::coneAngle().
48 */
49 Scalar coneAngle() const override;
50
51 /**
52 * Returns the sharpness of the spot as fall off exponent.
53 * @see SpotLight::spotExponent().
54 */
55 Scalar spotExponent() const override;
56
57 /**
58 * Sets the direction of this directional light.
59 * @see SpotLight::setDirection().
60 */
61 void setDirection(const Vector3& direction) override;
62
63 /**
64 * Sets the angle of the light cone in radian.
65 * @see SpotLight::setConeAngle().
66 */
67 bool setConeAngle(const Scalar angle) override;
68
69 /**
70 * Sets the sharpness of the spot as fall off exponent.
71 * @see SpotLight::setSpotExponent().
72 */
73 bool setSpotExponent(const Scalar exponent) override;
74
75 /**
76 * Binds this light source.
77 * @see GLESLightSource::bindLight().
78 */
79 void bindLight(GLESShaderProgram& shaderProgram, const HomogenousMatrix4& camera_T_model, const HomogenousMatrix4& camera_T_world, const SquareMatrix3& normalMatrix, const unsigned int index) override;
80
81 protected:
82
83 /**
84 * Creates a new GLESceneGraph spot light object.
85 */
87
88 /**
89 * Destructs a GLESceneGraph spot light object.
90 */
91 ~GLESSpotLight() override;
92
93 protected:
94
95 /// Light direction inside the local coordinate system.
97
98 /// Light cone angle.
100
101 /// Light spot exponent.
103};
104
105}
106
107}
108
109}
110
111#endif // META_OCEAN_RENDERING_GLES_SPOT_LIGHT_H
static constexpr Scalar deg2rad(const Scalar deg)
GLESPointLight()
Creates a new GLESceneGraph point light object.
This class implements a container for an OpenGL ES shader program.
Definition GLESShaderProgram.h:53
Scalar coneAngle_
Light cone angle.
Definition GLESSpotLight.h:99
friend class GLESFactory
Definition GLESSpotLight.h:35
Scalar spotExponent() const override
Returns the sharpness of the spot as fall off exponent.
GLESSpotLight()
Creates a new GLESceneGraph spot light object.
Scalar spotExponent_
Light spot exponent.
Definition GLESSpotLight.h:102
Vector3 direction() const override
Returns the direction of this directional light.
~GLESSpotLight() override
Destructs a GLESceneGraph spot light object.
Vector3 direction_
Light direction inside the local coordinate system.
Definition GLESSpotLight.h:96
Scalar coneAngle() const override
Returns the angle of the light cone in radian.
bool setSpotExponent(const Scalar exponent) override
Sets the sharpness of the spot as fall off exponent.
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 setConeAngle(const Scalar angle) override
Sets the angle of the light cone in radian.
void setDirection(const Vector3 &direction) override
Sets the direction of this directional light.
SpotLight()
Creates a new sport light.
HomogenousMatrixT4< Scalar > HomogenousMatrix4
Definition of the HomogenousMatrix4 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION flag eit...
Definition HomogenousMatrix4.h:44
VectorT3< Scalar > Vector3
Definition of a 3D vector.
Definition Vector3.h:29
SquareMatrixT3< Scalar > SquareMatrix3
Definition of the SquareMatrix3 object, depending on the OCEAN_MATH_USE_SINGLE_PRECISION either with ...
Definition SquareMatrix3.h:43
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