namespace Msp {
namespace GL {
-PointLight::PointLight():
- position(0.0f, 0.0f, 0.0f),
- attenuation{1.0f, 0.0f, 0.1f}
-{ }
-
void PointLight::update_matrix()
{
matrix = Matrix::translation(position);
void PointLight::update_shader_data(ProgramData &shdata, const string &base) const
{
shdata.uniform(base+".type", 2);
- shdata.uniform(base+".position", position.x, position.y, position.z, 1.0f);
+ shdata.uniform(base+".position", compose(position, 1.0f));
shdata.uniform(base+".color", color.r, color.g, color.b);
+ shdata.uniform3(base+".attenuation", attenuation);
}