Elevate Engine 1
Loading...
Searching...
No Matches
Elevate::PointLight Class Reference

#include <PointLight.h>

Inheritance diagram for Elevate::PointLight:
Elevate::Light Elevate::Component EEObject

Public Member Functions

 PointLight ()=default
 
 PointLight (const glm::vec3 &color)
 
void UploadToShader (Shader *shader, uint32_t index)
 
- Public Member Functions inherited from Elevate::Light
 Light ()=default
 
 Light (const glm::vec3 &color)
 
 Light (const glm::vec3 &amb, const glm::vec3 &dif, const glm::vec3 &spec, float intensity=1.0f)
 
void SetColor (const glm::vec3 &color)
 
void SetAmbientColor (const glm::vec3 &color)
 
void SetDiffuseColor (const glm::vec3 &color)
 
void SetSpecularColor (const glm::vec3 &color)
 
void SetIntensity (const float &intensity)
 
const glm::vec3 & GetAmbientColor () const
 
const glm::vec3 & GetDiffuseColor () const
 
const glm::vec3 & GetSpecularColor () const
 
const float & GetIntensity () const
 
- Public Member Functions inherited from Elevate::Component
 Component ()=default
 
virtual ~Component ()=default
 
virtual ComponentClone ()=0
 
virtual void CopyFrom (Component *other)=0
 
virtual GameObjectComponentFactory GetFactory () const =0
 
virtual GameObjectComponentDestructor GetDestructor () const =0
 
virtual const void * GetEditorIconHandle () const
 
virtual std::type_index GetTypeIndex () const =0
 
void SetActive (bool newState)
 
bool IsActive ()
 
virtual ComponentLayout GetLayout () const
 
virtual bool RemoveFromGameObject ()
 
virtual std::string GetName () const
 
- Public Member Functions inherited from EEObject
virtual EECategory GetCategory () const
 

Additional Inherited Members

- Public Attributes inherited from Elevate::Component
std::function< bool()> RemoveFromGOFunc
 
GameObjectgameObject = nullptr
 
- Protected Member Functions inherited from Elevate::Component
virtual void Init ()
 
virtual void Destroy ()
 
virtual void Update ()
 
virtual void Render ()
 
virtual void RenderInEditor ()
 
virtual void RenderWhenSelected ()
 
virtual void OnSetPosition ()
 
virtual void OnSetRotation ()
 
virtual void OnSetScale ()
 
virtual void OnNotify (Event &event)
 
- Protected Attributes inherited from Elevate::Light
glm::vec3 m_ambientColor = { 1.0f, 1.0f, 1.0f }
 
glm::vec3 m_diffuseColor = { 1.0f, 1.0f, 1.0f }
 
glm::vec3 m_specularColor = { 1.0f, 1.0f, 1.0f }
 
float m_intensity = 1.0f
 
- Protected Attributes inherited from Elevate::Component
bool m_IsActive = true
 
- Protected Attributes inherited from EEObject
EECategory m_category
 

Detailed Description

Definition at line 6 of file PointLight.h.

Constructor & Destructor Documentation

◆ PointLight() [1/2]

Elevate::PointLight::PointLight ( )
default

◆ PointLight() [2/2]

Elevate::PointLight::PointLight ( const glm::vec3 &  color)
inline

Definition at line 12 of file PointLight.h.

12: Light(color) { }
Light()=default

Member Function Documentation

◆ UploadToShader()

void Elevate::PointLight::UploadToShader ( Shader shader,
uint32_t  index 
)

Definition at line 8 of file PointLight.cpp.

9 {
10 const std::string name = "pointLights[" + std::to_string(index) + "]";
11 shader->UseLight(this, name);
12 // Todo utiliser les paramettres
13 shader->SetUniform3f(name + ".position", gameObject->GetGlobalPosition());
14 shader->SetUniform1f(name + ".constant", 1.0f);
15 shader->SetUniform1f(name + ".linear", 0.09f);
16 shader->SetUniform1f(name + ".quadratic", 0.032f);
17 }
GameObject * gameObject
Definition Component.h:73
glm::vec3 GetGlobalPosition()

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