Lugdunum  0.1.0
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | Private Member Functions | Friends | List of all members
lug::Graphics::Render::Light Class Reference

Class for Light. More...

#include <Light.hpp>

Inheritance diagram for lug::Graphics::Render::Light:
[legend]
Collaboration diagram for lug::Graphics::Render::Light:
[legend]

Classes

struct  Data
 

Public Types

enum  Type : uint8_t { Type::Ambient = 0, Type::Directional = 1, Type::Point = 2, Type::Spot = 3 }
 
- Public Types inherited from lug::Graphics::Resource
enum  Type : uint8_t {
  Type::Scene, Type::SceneNode, Type::Material, Type::Mesh,
  Type::Light, Type::Texture, Type::Pipeline, Type::Camera,
  Type::SkyBox
}
 Type of the resource. More...
 

Public Member Functions

 Light (const Light &)=delete
 
 Light (Light &&)=delete
 
Lightoperator= (const Light &)=delete
 
Lightoperator= (Light &&)=delete
 
 ~Light ()=default
 
void setType (Type type)
 
void setColor (const Math::Vec4f &color)
 
void setDirection (const Math::Vec3f &direction)
 
void setConstantAttenuation (float constantAttenuation)
 
void setDistance (float distance)
 
void setLinearAttenuation (float linearAttenuation)
 
void setQuadraticAttenuation (float quadraticAttenuation)
 
void setFalloffAngle (float falloffAngle)
 
void setFalloffExponent (float falloffExponent)
 
Type getType () const
 Gets the light type. More...
 
const Math::Vec4f & getColor () const
 
const Math::Vec3f & getDirection () const
 
float getConstantAttenuation () const
 
float getDistance () const
 
float getLinearAttenuation () const
 
float getQuadraticAttenuation () const
 
float getFalloffAngle () const
 
float getFalloffExponent () const
 
void getData (Light::Data &lightData, Scene::Node &node)
 
- Public Member Functions inherited from lug::Graphics::Resource
 Resource (Type type, const std::string &name)
 
 Resource (const Resource &)=delete
 
 Resource (Resource &&)=delete
 
Resourceoperator= (const Resource &)=delete
 
Resourceoperator= (Resource &&)=delete
 
virtual ~Resource ()=default
 
Type getType () const
 Returns the type of the Resource. More...
 
Handle getHandle () const
 Returns the handle of the Resource. More...
 
const std::string & getName () const
 Gets the name of the Resource. More...
 
void setName (const std::string &name)
 Sets the name of the Resource. More...
 
- Public Member Functions inherited from lug::Graphics::Render::DirtyObject
 DirtyObject ()=default
 
 DirtyObject (const DirtyObject &)=delete
 
 DirtyObject (DirtyObject &&)=delete
 
DirtyObjectoperator= (const DirtyObject &)=delete
 
DirtyObjectoperator= (DirtyObject &&)=delete
 
 ~DirtyObject ()=default
 
void setDirty ()
 
void setDirty (uint32_t currentFrame)
 
void clearDirty ()
 
void clearDirty (uint32_t currentFrame)
 
bool isDirty (uint32_t currentFrame) const
 
bool isDirty () const
 

Static Public Attributes

static constexpr uint32_t strideShader { 80 }
 

Protected Attributes

Type _type {Type::Ambient}
 
Math::Vec4f _color {0.0f, 0.0f, 0.0f, 1.0f}
 
Math::Vec3f _direction {0.0f, 0.0f, 0.0f}
 
float _constantAttenuation {0.0f}
 
float _distance {0.0f}
 
float _linearAttenuation {1.0f}
 
float _quadraticAttenuation {1.0f}
 
float _falloffAngle {Math::halfPi<float>()}
 
float _falloffExponent {0.0f}
 
- Protected Attributes inherited from lug::Graphics::Resource
std::string _name
 

Private Member Functions

 Light (const std::string &name, Type type)
 Constructs a light. More...
 

Friends

class ::lug::Graphics::Builder::Light
 

Detailed Description

Class for Light.

Definition at line 26 of file Light.hpp.

Member Enumeration Documentation

◆ Type

enum lug::Graphics::Render::Light::Type : uint8_t
strong
Enumerator
Ambient 
Directional 
Point 
Spot 

Definition at line 30 of file Light.hpp.

Constructor & Destructor Documentation

◆ Light() [1/3]

lug::Graphics::Render::Light::Light ( const Light )
delete

◆ Light() [2/3]

lug::Graphics::Render::Light::Light ( Light &&  )
delete

◆ ~Light()

lug::Graphics::Render::Light::~Light ( )
default

◆ Light() [3/3]

lug::Graphics::Render::Light::Light ( const std::string &  name,
Type  type 
)
private

Constructs a light.

Parameters
[in]nameThe name of the Node
[in]typeThe type of the Light

Definition at line 9 of file Light.cpp.

Member Function Documentation

◆ operator=() [1/2]

Light& lug::Graphics::Render::Light::operator= ( const Light )
delete

◆ operator=() [2/2]

Light& lug::Graphics::Render::Light::operator= ( Light &&  )
delete

◆ setType()

void Light::setType ( Type  type)
inline

Definition at line 1 of file Light.inl.

◆ setColor()

void Light::setColor ( const Math::Vec4f &  color)
inline

Definition at line 5 of file Light.inl.

◆ setDirection()

void Light::setDirection ( const Math::Vec3f &  direction)
inline

Definition at line 9 of file Light.inl.

◆ setConstantAttenuation()

void Light::setConstantAttenuation ( float  constantAttenuation)
inline

Definition at line 13 of file Light.inl.

◆ setDistance()

void Light::setDistance ( float  distance)
inline

Definition at line 17 of file Light.inl.

◆ setLinearAttenuation()

void Light::setLinearAttenuation ( float  linearAttenuation)
inline

Definition at line 21 of file Light.inl.

◆ setQuadraticAttenuation()

void Light::setQuadraticAttenuation ( float  quadraticAttenuation)
inline

Definition at line 25 of file Light.inl.

◆ setFalloffAngle()

void Light::setFalloffAngle ( float  falloffAngle)
inline

Definition at line 29 of file Light.inl.

◆ setFalloffExponent()

void Light::setFalloffExponent ( float  falloffExponent)
inline

Definition at line 33 of file Light.inl.

◆ getType()

Light::Type Light::getType ( ) const
inline

Gets the light type.

Returns
The light type.

Definition at line 46 of file Light.inl.

◆ getColor()

const Math::Vec4f & Light::getColor ( ) const
inline

Definition at line 50 of file Light.inl.

◆ getDirection()

const Math::Vec3f & Light::getDirection ( ) const
inline

Definition at line 54 of file Light.inl.

◆ getConstantAttenuation()

float Light::getConstantAttenuation ( ) const
inline

Definition at line 58 of file Light.inl.

◆ getDistance()

float Light::getDistance ( ) const
inline

Definition at line 62 of file Light.inl.

◆ getLinearAttenuation()

float Light::getLinearAttenuation ( ) const
inline

Definition at line 66 of file Light.inl.

◆ getQuadraticAttenuation()

float Light::getQuadraticAttenuation ( ) const
inline

Definition at line 70 of file Light.inl.

◆ getFalloffAngle()

float Light::getFalloffAngle ( ) const
inline

Definition at line 74 of file Light.inl.

◆ getFalloffExponent()

float Light::getFalloffExponent ( ) const
inline

Definition at line 78 of file Light.inl.

◆ getData()

void lug::Graphics::Render::Light::getData ( Light::Data lightData,
Scene::Node node 
)

Definition at line 11 of file Light.cpp.

Friends And Related Function Documentation

◆ ::lug::Graphics::Builder::Light

friend class ::lug::Graphics::Builder::Light
friend

Definition at line 27 of file Light.hpp.

Member Data Documentation

◆ strideShader

constexpr uint32_t lug::Graphics::Render::Light::strideShader { 80 }
static

Definition at line 51 of file Light.hpp.

◆ _type

Type lug::Graphics::Render::Light::_type {Type::Ambient}
protected

Definition at line 100 of file Light.hpp.

◆ _color

Math::Vec4f lug::Graphics::Render::Light::_color {0.0f, 0.0f, 0.0f, 1.0f}
protected

Definition at line 102 of file Light.hpp.

◆ _direction

Math::Vec3f lug::Graphics::Render::Light::_direction {0.0f, 0.0f, 0.0f}
protected

Definition at line 103 of file Light.hpp.

◆ _constantAttenuation

float lug::Graphics::Render::Light::_constantAttenuation {0.0f}
protected

Definition at line 104 of file Light.hpp.

◆ _distance

float lug::Graphics::Render::Light::_distance {0.0f}
protected

Definition at line 105 of file Light.hpp.

◆ _linearAttenuation

float lug::Graphics::Render::Light::_linearAttenuation {1.0f}
protected

Definition at line 106 of file Light.hpp.

◆ _quadraticAttenuation

float lug::Graphics::Render::Light::_quadraticAttenuation {1.0f}
protected

Definition at line 107 of file Light.hpp.

◆ _falloffAngle

float lug::Graphics::Render::Light::_falloffAngle {Math::halfPi<float>()}
protected

Definition at line 108 of file Light.hpp.

◆ _falloffExponent

float lug::Graphics::Render::Light::_falloffExponent {0.0f}
protected

Definition at line 109 of file Light.hpp.


The documentation for this class was generated from the following files: