The ambient light, which illuminates all objects in the scene equally.
More...
#include <AmbientLight.hpp>
|
| AmbientLight (Color _color, double _intensity) |
| Creates a new ambient light with the specified color and intensity.
|
|
bool | isAmbientLight () const override |
| Returns whether or not this light is an ambient light.
|
|
bool | isLight () const override |
| Returns whether or not this 3D object is a light.
|
|
virtual bool | isPointLight () const |
| Returns whether or not this light is a point light.
|
|
virtual bool | isDirectionalLight () const |
| Returns whether or not this light is a directional light.
|
|
virtual bool | isSpotLight () const |
| Returns whether or not this light is a spot light.
|
|
virtual bool | isMesh () const |
| Returns whether this 3D object is a mesh.
|
|
Object3D & | add (Object3D &child) |
| Adds another 3D object as a child of this 3D object.
|
|
Object3D & | translate (double x, double y, double z) |
| Translates this 3D object by the specified amounts along the x, y, and z axes in local space.
|
|
Object3D & | rotate (double x, double y, double z, EulerRotationOrder order) |
| Rotates this 3D object by the specified angles around the x, y, and z axes in local space.
|
|
Object3D & | scale (double x, double y, double z) |
| Scales this 3D object by the specified amounts along the x, y, and z axes in local space.
|
|
Object3D & | updateLocalMatrix () |
| Updates the local transformation matrix of this 3D object.
|
|
Object3D & | updateModelMatrix () |
| Updates the model matrix of this 3D object.
|
|
|
Color | color |
| The color of this ambient light.
|
|
double | intensity |
| The intensity of this ambient light.
|
|
std::optional< std::reference_wrapper< Object3D > > | parent |
| The parent of this 3D object.
|
|
Vector3 | up = DEFAULT_UP |
| The vector pointing to the up direction in object space.
|
|
Vector3 | localPosition |
| The position of this 3D object relative to its parent.
|
|
EulerRotation | localRotation |
| The rotation of this 3D object relative to its parent.
|
|
Vector3 | localScale |
| The scale of this 3D object relative to its parent.
|
|
Matrix4x4 | localMatrix |
| The matrix of the local transformation of this 3D object.
|
|
Matrix4x4 | modelMatrix |
| The model matrix of this 3D object, transformating local space to world space.
|
|
std::vector< std::reference_wrapper< Object3D > > | children |
| The children of this 3D object.
|
|
The ambient light, which illuminates all objects in the scene equally.
Ambient lighting is used in many ways, such as providing a base level of illumination in a dark scene where you don't want the scene to be completely dark. It is also a component of the Phong reflection model.
For the BlinnPhong
material, the light's color contribution will be \(c = c_{o} \times c_{l} \times s\) where:
◆ AmbientLight()
t::AmbientLight::AmbientLight |
( |
Color | _color, |
|
|
double | _intensity ) |
|
inline |
Creates a new ambient light with the specified color and intensity.
- Parameters
-
_color | The color of the new ambient light. |
_intensity | The intensity of the new ambient light. 0 means the ambient light will have no effect. 1 means full intensity. |
◆ isAmbientLight()
bool t::AmbientLight::isAmbientLight |
( |
| ) |
const |
|
inlineoverridevirtual |
Returns whether or not this light is an ambient light.
Always returns true
. May be used in vertex and fragment shaders to determine the type of light and make a cast from Light
appropriately.
- Returns
true
Reimplemented from t::Light.
The documentation for this class was generated from the following file: