Files
BlitzNext/Runtime/blitz3d/light.cpp
T
Michael Fabian 'Xaymar' Dirks 2196cb8419 runtime: Formatting
2019-01-18 17:04:17 +01:00

40 lines
621 B
C++

#include "light.hpp"
#include "../gxruntime/gxscene.hpp"
#include "std.hpp"
extern gxScene* gx_scene;
Light::Light(int type)
{
light = gx_scene->createLight(type);
}
Light::~Light()
{
gx_scene->freeLight(light);
}
void Light::setRange(float r)
{
light->setRange(r);
}
void Light::setColor(const Vector& v)
{
light->setColor((float*)&v.x);
}
void Light::setConeAngles(float inner, float outer)
{
light->setConeAngles(inner, outer);
}
bool Light::beginRender(float tween)
{
Object::beginRender(tween);
light->setPosition(&getRenderTform().v.x);
light->setDirection(&getRenderTform().m.k.x);
return true;
}