ComputerGraphik TU WIEN
Public Member Functions | Protected Attributes | List of all members
Light Class Reference

Used for further implementations of light in the scene (Sun is a direct derivation). More...

#include <light.hpp>

Inheritance diagram for Light:
SceneObject ShadowMap Sun

Public Member Functions

 Light (const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1))
 Construct new light. More...
 
virtual ~Light ()
 
glm::vec3 getPower () const
 
glm::vec3 getDiffuse () const
 
glm::vec3 getAmbient () const
 
glm::vec3 getSpecular () const
 
glm::vec3 getPosition () const
 
void setPower (const glm::vec3 &val)
 
void setDiffuse (const glm::vec3 &val)
 
void setAmbient (const glm::vec3 &val)
 
void setSpecular (const glm::vec3 &val)
 
- Public Member Functions inherited from SceneObject
 SceneObject (std::shared_ptr< SceneObject > &effectParent, const glm::mat4 &modelMatrix=glm::mat4(1))
 
 SceneObject (const std::string &name, Scene *scene=0, Model *model=0, const glm::mat4 &modelMatrix=glm::mat4(1))
 
virtual ~SceneObject ()
 
ModelgetModel () const
 
ShadergetShader () const
 
glm::mat4 getModelMatrix () const
 
glm::mat4 getGlobalModelMatrix () const
 
std::string getName () const
 
std::shared_ptr< SceneObjectgetParent () const
 
void setAnimationTime (double time)
 
bool setAnimation (const Animation &anim)
 
bool delChild (size_t idx)
 
bool getChild (size_t idx, std::shared_ptr< SceneObject > &child) const
 
bool addChild (std::shared_ptr< SceneObject > &child)
 
bool remEffect (const std::string &name)
 
SceneObjectgetEffect (const std::string &name) const
 
bool addEffect (const std::string &name, std::unique_ptr< SceneObject > &effect)
 
bool doNotRender ()
 
bool getIsVolSun ()
 
virtual void reset ()
 
virtual void draw () const
 
virtual bool animate (double time)
 
virtual void update (double deltaT)
 
virtual void setShader (Shader *val)
 

Protected Attributes

glm::vec3 power
 
glm::vec3 diffuse
 
glm::vec3 ambient
 
glm::vec3 specular
 
- Protected Attributes inherited from SceneObject
GLuint vao
 
Scenescene
 
Modelmodel
 
Shadershader
 
glm::mat4 modelMatrix
 
std::string name
 
std::weak_ptr< SceneObjectparent
 
std::vector< std::shared_ptr< SceneObject > > childs
 
std::map< std::string, std::unique_ptr< SceneObject > > effectChilds
 
size_t animIDX
 
Animation animation
 
bool norender
 
bool isVolSun
 

Additional Inherited Members

- Public Types inherited from SceneObject
typedef std::vector< std::pair< double, glm::mat4 > > Animation
 

Detailed Description

Used for further implementations of light in the scene (Sun is a direct derivation).

The Light Object provides methods for retrieval of intrinsic parameters that are necessary for the computation of light. Ambient, diffuse, and specular coefficients can be queried as well as the position itsel. The class can be seen as an interface for further derivations.

Constructor & Destructor Documentation

Light::Light ( const std::string &  name,
Scene scene = 0,
Model model = 0,
const glm::mat4 &  modelMatrix = glm::mat4(1) 
)
inline

Construct new light.

virtual Light::~Light ( )
inlinevirtual

Member Function Documentation

glm::vec3 Light::getAmbient ( ) const
inline
glm::vec3 Light::getDiffuse ( ) const
inline
glm::vec3 Light::getPosition ( ) const
inline
glm::vec3 Light::getPower ( ) const
inline
glm::vec3 Light::getSpecular ( ) const
inline
void Light::setAmbient ( const glm::vec3 &  val)
inline
void Light::setDiffuse ( const glm::vec3 &  val)
inline
void Light::setPower ( const glm::vec3 &  val)
inline
void Light::setSpecular ( const glm::vec3 &  val)
inline

Member Data Documentation

glm::vec3 Light::ambient
protected
glm::vec3 Light::diffuse
protected
glm::vec3 Light::power
protected
glm::vec3 Light::specular
protected

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