Radium Engine
1.5.20
|
#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. | |
LightData (const LightData &data) | |
~LightData () | |
Destructor. | |
void | setName (const std::string &name) |
LIGHT DATA ///. | |
const Eigen::Matrix< Scalar, 4, 4 > & | getFrame () const |
FRAME. | |
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 | |
void | setLight (const Core::Utils::Color &color, const Eigen::Matrix< Scalar, 3, 1 > &position, LightAttenuation attenuation) |
construct a point light | |
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 | |
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 | |
LightType | getType () const |
TYPE. | |
bool | isPointLight () const |
QUERY. | |
bool | isSpotLight () const |
bool | isDirectionalLight () const |
bool | isAreaLight () const |
void | displayInfo () const |
DEBUG. | |
Public Member Functions inherited from Ra::Core::Asset::AssetData | |
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 |
Protected Attributes inherited from Ra::Core::Asset::AssetData | |
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 32 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 301 of file LightData.hpp.
|
inline |
FRAME.
Acces to the local frame of the light.
Definition at line 227 of file LightData.hpp.
|
inline |
|
inline |
Returns true if the light is an AreaLight
Definition at line 296 of file LightData.hpp.
|
inline |
Returns true if the light is a DirectionalLight
Definition at line 292 of file LightData.hpp.
|
inline |
|
inline |
Returns true if the light is a SpotLight
Definition at line 288 of file LightData.hpp.
|
inline |
Set the local frame of the light.
frame | the local frame |
Definition at line 231 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 270 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 236 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 254 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 244 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 217 of file LightData.hpp.
AreaLight Ra::Core::Asset::LightData::m_arealight |
Definition at line 208 of file LightData.hpp.
Core::Utils::Color Ra::Core::Asset::LightData::m_color |
Definition at line 180 of file LightData.hpp.
DirLight Ra::Core::Asset::LightData::m_dirlight |
Definition at line 205 of file LightData.hpp.
|
protected |
VARIABLE.
Definition at line 174 of file LightData.hpp.
PointLight Ra::Core::Asset::LightData::m_pointlight |
Definition at line 206 of file LightData.hpp.
SpotLight Ra::Core::Asset::LightData::m_spotlight |
Definition at line 207 of file LightData.hpp.
|
protected |
Definition at line 175 of file LightData.hpp.