Light
// Generates light in the scene. There is only one light type. This single light type can fill
// many roles including an omni light, a spot light or an environment light, based on settings.
// A light can also be static, dynamic or a probe that receives light from other lights or probes.
class RVAPI Light
{
public:
// Light flags.
enum Flags
{
// Recalculate each frame.
DYNAMIC = 1,
// Is light probe.
PROBE = 2
};
// Get position.
const M4f &GetPos() const;
// Get color.
const Color &GetColor() const;
// Set color.
void SetColor(const Color &color);
// Set range. [range] is in meters. [falloff] is 0=Hardest edge to 2048=Smoothest edge.
void SetRange(float range, float falloff = 0);
// Set spherical opening. [aperture] is 0=no spherical opening to 1=full spherical opening.
// [falloff] is 0=Hardest edge to 2048=Smoothest edge.
void SetAperture(float aperture, float falloff = 0);
// Set position.
void SetPos(const M4f &pos);
// Internal.
void *operator () () const { return (void *)wobj; }
// Construct light at position [pos]. [flags] is combination of light flags or 0. For probe lights,
// [level] is the light probe level. 0 is the highest level probe. Lower level probes receive light
// from higher level probes. [response] is the probes's response time to light in seconds to help
// smooth light changes.
Light(const M4f &pos, uint flags = Flags::DYNAMIC, uint level = 0, float delay = 0);
// Destructor.
~Light();
private:
byte wobj[192];
};