![]() |
Radium Engine
1.5.0
|
#include <Core/Asset/LightData.hpp>
Classes | |
struct | LightAttenuation |
Public Types | |
enum | LightType { UNKNOWN = 1 << 0 , POINT_LIGHT = 1 << 1 , SPOT_LIGHT = 1 << 2 , DIRECTIONAL_LIGHT = 1 << 3 , AREA_LIGHT = 1 << 4 } |
Public Member Functions | |
LightData (const std::string &name="", const LightType &type=UNKNOWN) | |
CONSTRUCTOR. More... | |
LightData (const LightData &data) | |
~LightData () | |
Destructor. More... | |
void | setName (const std::string &name) |
LIGHT DATA ///. More... | |
const Eigen::Matrix< Scalar, 4, 4 > & | getFrame () const |
FRAME. More... | |
void | setFrame (const Eigen::Matrix< Scalar, 4, 4 > &frame) |
void | setLight (const Core::Utils::Color &color, const Eigen::Matrix< Scalar, 3, 1 > &direction) |
construct a directional light More... | |
void | setLight (const Core::Utils::Color &color, const Eigen::Matrix< Scalar, 3, 1 > &position, LightAttenuation attenuation) |
construct a point light More... | |
void | setLight (const Core::Utils::Color &color, const Eigen::Matrix< Scalar, 3, 1 > &position, const Eigen::Matrix< Scalar, 3, 1 > &direction, Scalar inAngle, Scalar outAngle, LightAttenuation attenuation) |
construct a spot light More... | |
void | setLight (const Core::Utils::Color &color, const Eigen::Matrix< Scalar, 3, 1 > &cog, const Eigen::Matrix< Scalar, 3, 3 > &spatialCov, const Eigen::Matrix< Scalar, 3, 3 > &normalCov, LightAttenuation attenuation) |
construct an area light More... | |
LightType | getType () const |
TYPE. More... | |
bool | isPointLight () const |
QUERY. More... | |
bool | isSpotLight () const |
bool | isDirectionalLight () const |
bool | isAreaLight () const |
void | displayInfo () const |
DEBUG. More... | |
![]() | |
AssetData (const std::string &name) | |
Construct an asset data given its name. | |
AssetData (const AssetData &other)=default | |
Copy constructor. Default here. | |
virtual | ~AssetData () |
Simple delete operator. | |
virtual const std::string & | getName () const |
Acces to the name of the asset. | |
Public Attributes | |
Core::Utils::Color | m_color |
union { | |
DirLight m_dirlight | |
PointLight m_pointlight | |
SpotLight m_spotlight | |
AreaLight m_arealight | |
}; | |
Protected Attributes | |
Eigen::Matrix< Scalar, 4, 4 > | m_frame |
VARIABLE. | |
LightType | m_type |
![]() | |
std::string | m_name |
Asset defining how lights must be passed to the Radium systems from a loader.
Supported light type are : Point light : a local, punctual, isotropic spherical light. Spot light : a local, punctual, isotropic conical light. Directional light : an infinite, isotropic light. Area light : a local isotropic area light.
Definition at line 25 of file LightData.hpp.
Supported light type
Definition at line 34 of file LightData.hpp.
|
explicit |
CONSTRUCTOR.
Light constructor. Must be called explicitely with a name for the light and its type.
Definition at line 8 of file LightData.cpp.
Ra::Core::Asset::LightData::LightData | ( | const LightData & | data | ) |
Copy constructor. As a Light a a union like object, no default copy constructor could be generated. This will take care of copying the good members of the union.
data |
Definition at line 11 of file LightData.cpp.
Ra::Core::Asset::LightData::~LightData | ( | ) |
|
inline |
DEBUG.
For debugging purpose, prints out the formated content of the LightData object.
Definition at line 303 of file LightData.hpp.
|
inline |
FRAME.
Acces to the local frame of the light.
Definition at line 229 of file LightData.hpp.
|
inline |
|
inline |
Returns true if the light is an AreaLight
Definition at line 298 of file LightData.hpp.
|
inline |
Returns true if the light is a DirectionalLight
Definition at line 294 of file LightData.hpp.
|
inline |
|
inline |
Returns true if the light is a SpotLight
Definition at line 290 of file LightData.hpp.
|
inline |
Set the local frame of the light.
frame | the local frame |
Definition at line 233 of file LightData.hpp.
|
inline |
construct an area light
Construct a area light. An area light, (isotropic with constant emision defined by its color) is approximated by its center and the covariance matrices modelling the spatial extent as well as the elliptical distribution of normals.
AREA_LIGHT
light, whatever it was before the call and only the directional light part of the union is consistent after the call Definition at line 272 of file LightData.hpp.
|
inline |
construct a directional light
Construct a directional light. A directional light is only defined by its color and its lighting direction. No attenuation on directional.
DIRECTIONAL_LIGHT
light, whatever it was before the call and only the directional light part of the union is consistent after the call Definition at line 238 of file LightData.hpp.
|
inline |
construct a spot light
Construct a spot light. A spot light is defined by its color, its position, the cone axis and light distribution (constant inside inangle, quadratically deacreasing toward 0 fron inAngle to ouAngle) and its attenuation.
SPOT_LIGHT
light, whatever it was before the call and only the directional light part of the union is consistent after the call Definition at line 256 of file LightData.hpp.
|
inline |
construct a point light
Construct a point light. A point light is defined by its color, its position and its attenuation.
POINT_LIGHT
light, whatever it was before the call and only the directional light part of the union is consistent after the call Definition at line 246 of file LightData.hpp.
|
inline |
LIGHT DATA ///.
Extension of of the AssetData interface so that we can modify an abcet afeter ts creation. This has no impact on the coherence of the LightData object and could be used without restriction.
NAME
Definition at line 219 of file LightData.hpp.