#include <SunLight.hpp>
Public Member Functions | |
SunLight (Eigen::Vector3f direction) | |
Eigen::VectorXf | vertexLighting (const Eigen::Matrix3Xf &normals) override |
Eigen::Vector3f | getDirection () |
void | setDirection (float x, float y, float z) |
void | translate (float x, float y, float z) override |
void | scale (float m) override |
void | rotate (float x, float y, float z) override |
void | transform (const Transformation &t) override |
Private Attributes | |
Eigen::Vector3f | direction |
The 3d direction unit vector of the light. | |
A directional light class.
Geno3D::SunLight::SunLight | ( | Eigen::Vector3f | direction | ) |
Construct a sun light with a direction vector.
direction | the 3D direction vector of the light |
|
inline |
Get the current direction of the light as a 3D unit vector.
References direction.
|
overridevirtual |
Rotate by Euler angles, in radians.
x | the angle to rotate by about the x-axis |
y | the angle to rotate by about the y-axis |
z | the angle to rotate by about the z-axis |
Implements Geno3D::Transformable.
References direction.
|
inlineoverridevirtual |
void Geno3D::SunLight::setDirection | ( | float | x, |
float | y, | ||
float | z | ||
) |
Set the direction of the light as a 3D vector.
x | the magnitude of the direction in the x-axis |
y | the magnitude of the direction in the y-axis |
z | the magnitude of the direction in the z-axis |
|
overridevirtual |
Transform by a compound transformation.
t | the transformation to apply |
Implements Geno3D::Transformable.
References Geno3D::Transformation::apply(), and direction.
|
overridevirtual |
Translate by a 3D vector.
x | the amount to translate in the x-axis |
y | the amount to translate in the y-axis |
z | the amount to translate in the z-axis |
Implements Geno3D::Transformable.
References direction.
|
overridevirtual |
Calculate the lighting on each vertex of an object. Uses vertex normals to calculate the clamped light intensity on each vertex.
normals | a 3 by X matrix containing the normals as 3D unit vectors |
Implements Geno3D::Light.
References direction.