Annwvyn::AnnLightObject Class Reference

Light Object : Represent a light source. More...

#include <AnnLightObject.hpp>

Inheritance diagram for Annwvyn::AnnLightObject:
Collaboration diagram for Annwvyn::AnnLightObject:

Public Types

enum  LightTypes { ANN_LIGHT_POINT = Ogre::Light::LightTypes::LT_POINT, ANN_LIGHT_DIRECTIONAL = Ogre::Light::LightTypes::LT_DIRECTIONAL, ANN_LIGHT_SPOTLIGHT = Ogre::Light::LightTypes::LT_SPOTLIGHT, ANN_LIGHT_ERROR = -1 }
 Defines the type of light. More...
 

Public Member Functions

 AnnLightObject (Ogre::Light *light, const std::string &name)
 
virtual ~AnnLightObject ()
 
void setPosition (AnnVect3 position) override
 Set the position of the light (if relevant) More...
 
AnnVect3 getPosition () override
 Get the position of the light (if relevant) More...
 
void setDirection (AnnVect3 direction) const
 Set the direction of the light (if relevant) More...
 
AnnVect3 getDirection () const
 Get the direction of the light (if relevant) More...
 
void setType (LightTypes type) const
 Set the type of the light. More...
 
void setDiffuseColor (AnnColor color) const
 Set the diffuse color of this light source. More...
 
void setSpecularColor (AnnColor color) const
 Set the specular color of this light source. More...
 
AnnColor getDiffuseColor () const
 Get the diffuse color of this light source. More...
 
AnnColor getSpecularColor () const
 Get the specular color of this light source. More...
 
void setPower (float lumens) const
 Set the power of this lamp (in lumens) More...
 
float getPower () const
 get the current power of this lamp More...
 
void setAttenuation (float range, float constant, float linear, float quadratic) const
 Set the attenuation parameters. More...
 
Ogre::Light * _getOgreLight () const
 Advanced method : get the underlying Ogre light object. More...
 
std::string getName () const
 Get the name of this light. More...
 
- Public Member Functions inherited from Annwvyn::AnnAbstractTranslatable
virtual ~AnnAbstractTranslatable ()=default
 

Static Public Member Functions

static LightTypes getLightTypeFromString (const std::string &ltype)
 

Private Attributes

Ogre::Light * light
 
Ogre::SceneNode * node
 
const std::string name
 

Friends

class AnnEngine
 
class AnnGameObjectManager
 

Additional Inherited Members

Detailed Description

Light Object : Represent a light source.

Definition at line 20 of file AnnLightObject.hpp.

Member Enumeration Documentation

◆ LightTypes

Defines the type of light.

Enumerator
ANN_LIGHT_POINT 

Point light sources give off light equally in all directions, so require only position not direction.

ANN_LIGHT_DIRECTIONAL 

Directional lights simulate parallel light beams from a distant source, hence have direction but no position.

ANN_LIGHT_SPOTLIGHT 

Spotlights simulate a cone of light from a source so require position and direction, plus extra values for falloff.

ANN_LIGHT_ERROR 

Definition at line 27 of file AnnLightObject.hpp.

Constructor & Destructor Documentation

◆ AnnLightObject()

AnnLightObject::AnnLightObject ( Ogre::Light *  light,
const std::string name 
)

Definition at line 11 of file AnnLightObject.cpp.

Here is the call graph for this function:

◆ ~AnnLightObject()

AnnLightObject::~AnnLightObject ( )
virtual

Definition at line 23 of file AnnLightObject.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ _getOgreLight()

Ogre::Light * AnnLightObject::_getOgreLight ( ) const

Advanced method : get the underlying Ogre light object.

Definition at line 98 of file AnnLightObject.cpp.

◆ getDiffuseColor()

AnnColor AnnLightObject::getDiffuseColor ( ) const

Get the diffuse color of this light source.

Definition at line 78 of file AnnLightObject.cpp.

◆ getDirection()

AnnVect3 AnnLightObject::getDirection ( ) const

Get the direction of the light (if relevant)

Definition at line 58 of file AnnLightObject.cpp.

◆ getLightTypeFromString()

AnnLightObject::LightTypes AnnLightObject::getLightTypeFromString ( const std::string ltype)
static

Definition at line 40 of file AnnLightObject.cpp.

◆ getName()

std::string AnnLightObject::getName ( ) const

Get the name of this light.

Definition at line 103 of file AnnLightObject.cpp.

◆ getPosition()

AnnVect3 AnnLightObject::getPosition ( )
overridevirtual

Get the position of the light (if relevant)

Implements Annwvyn::AnnAbstractTranslatable.

Definition at line 88 of file AnnLightObject.cpp.

◆ getPower()

float AnnLightObject::getPower ( ) const

get the current power of this lamp

Definition at line 113 of file AnnLightObject.cpp.

◆ getSpecularColor()

AnnColor AnnLightObject::getSpecularColor ( ) const

Get the specular color of this light source.

Definition at line 83 of file AnnLightObject.cpp.

◆ setAttenuation()

void AnnLightObject::setAttenuation ( float  range,
float  constant,
float  linear,
float  quadratic 
) const

Set the attenuation parameters.

Definition at line 93 of file AnnLightObject.cpp.

◆ setDiffuseColor()

void AnnLightObject::setDiffuseColor ( AnnColor  color) const

Set the diffuse color of this light source.

Definition at line 68 of file AnnLightObject.cpp.

Here is the call graph for this function:

◆ setDirection()

void AnnLightObject::setDirection ( AnnVect3  direction) const

Set the direction of the light (if relevant)

Definition at line 53 of file AnnLightObject.cpp.

◆ setPosition()

void AnnLightObject::setPosition ( AnnVect3  position)
overridevirtual

Set the position of the light (if relevant)

Implements Annwvyn::AnnAbstractTranslatable.

Definition at line 48 of file AnnLightObject.cpp.

◆ setPower()

void AnnLightObject::setPower ( float  lumens) const

Set the power of this lamp (in lumens)

Definition at line 108 of file AnnLightObject.cpp.

◆ setSpecularColor()

void AnnLightObject::setSpecularColor ( AnnColor  color) const

Set the specular color of this light source.

Definition at line 73 of file AnnLightObject.cpp.

Here is the call graph for this function:

◆ setType()

void AnnLightObject::setType ( LightTypes  type) const

Set the type of the light.

Definition at line 63 of file AnnLightObject.cpp.

Friends And Related Function Documentation

◆ AnnEngine

friend class AnnEngine
friend

Definition at line 75 of file AnnLightObject.hpp.

◆ AnnGameObjectManager

friend class AnnGameObjectManager
friend

Definition at line 76 of file AnnLightObject.hpp.

Member Data Documentation

◆ light

Ogre::Light* Annwvyn::AnnLightObject::light
private

Definition at line 77 of file AnnLightObject.hpp.

◆ name

const std::string Annwvyn::AnnLightObject::name
private

Definition at line 79 of file AnnLightObject.hpp.

◆ node

Ogre::SceneNode* Annwvyn::AnnLightObject::node
private

Definition at line 78 of file AnnLightObject.hpp.


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