Added Light::GetLightType
Former-commit-id: 22739eaaed4daf0651860c34af30bbfad87f538f
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include <cstring>
|
||||
#include <Nazara/3D/Debug.hpp>
|
||||
|
||||
///TODO: Utilisation des UBOs
|
||||
|
||||
NzLight::NzLight(nzLightType type) :
|
||||
m_type(type),
|
||||
m_ambientColor((type == nzLightType_Directional) ? NzColor(50, 50, 50) : NzColor::Black),
|
||||
@@ -29,7 +31,7 @@ NzLight::NzLight(const NzLight& light)
|
||||
|
||||
NzLight::~NzLight() = default;
|
||||
|
||||
void NzLight::Apply(unsigned int i) const
|
||||
void NzLight::Apply(unsigned int unit) const
|
||||
{
|
||||
/*
|
||||
struct Light
|
||||
@@ -66,10 +68,10 @@ void NzLight::Apply(unsigned int i) const
|
||||
int parameters2Location = shader->GetUniformLocation("Lights[0].parameters2");
|
||||
int parameters3Location = shader->GetUniformLocation("Lights[0].parameters3");
|
||||
|
||||
if (i > 0)
|
||||
if (unit > 0)
|
||||
{
|
||||
int type2Location = shader->GetUniformLocation("Lights[1].type");
|
||||
int offset = i * (type2Location - typeLocation); // type2Location - typeLocation donne la taille de la structure
|
||||
int offset = unit * (type2Location - typeLocation); // type2Location - typeLocation donne la taille de la structure
|
||||
|
||||
// On applique cet offset
|
||||
typeLocation += offset;
|
||||
@@ -133,6 +135,11 @@ float NzLight::GetInnerAngle() const
|
||||
return m_innerAngle;
|
||||
}
|
||||
|
||||
nzLightType NzLight::GetLightType() const
|
||||
{
|
||||
return m_type;
|
||||
}
|
||||
|
||||
float NzLight::GetOuterAngle() const
|
||||
{
|
||||
return m_outerAngle;
|
||||
|
||||
Reference in New Issue
Block a user