78 set_pos(PN_stdfloat x, PN_stdfloat y, PN_stdfloat z){
113 nassertr(type == ALINEAR || type == AQUADRATIC,
false);
114 _attenuation_type=type;
124 return _attenuation_type;
213 nassertr(type == FRANDOM || type == FSIN,
false);
224 return _flicker_type;
292 set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b) {
324 PandaNode::get_attrib(ColorAttrib::get_class_type());
325 if (attrib !=
nullptr) {
void set_a2(PN_stdfloat a2)
Set the quadratic attenuation factor a2 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
void set_a0(PN_stdfloat a0)
Set the quadratic attenuation factor a0 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
This is the base class for a number of render attributes (other than transform) that may be set on sc...
PN_stdfloat get_a2() const
Get the quadratic attenuation factor a2 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
PN_stdfloat get_a0() const
Get the quadratic attenuation factor a0 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
bool set_flicker_type(Flicker_Type type)
Flicker type can be FRANDOM or FSIN At a later point there might be a FCUSTOM Custom flicker will be ...
PN_stdfloat get_radius() const
Get radius of the spherical light volume.
void set_freq(PN_stdfloat f)
Set frequency of sin flicker.
PN_stdfloat get_offset() const
Get the offset value for the random and sin flicker variations.
get_color
If the type is T_flat or T_off, this returns the color that will be applied to geometry.
int compare_to(const PolylightNode &other) const
Returns a number less than zero if this PolylightNode sorts before the other one, greater than zero i...
void disable()
Disable this light.
void set_radius(PN_stdfloat r)
Set radius of the spherical light volume.
Attenuation_Type get_attenuation() const
Get "linear" or "quadratic" attenuation type.
bool is_enabled() const
Is this light is enabled/disabled?
PN_stdfloat get_step_size() const
Get the step size for the sin function in flicker This is the increment size for the value supplied t...
void set_pos(const LPoint3 &position)
Set this light's position.
void set_step_size(PN_stdfloat step)
Set the step size for the sin function in flicker This is the increment size for the value supplied t...
bool operator==(const PolylightNode &other) const
Returns true if the two lights are equivalent that is, all their properties are same.
LPoint3 get_pos() const
Returns position as a LPoint3.
bool operator !=(const PolylightNode &other) const
Returns true if the two lights are not equivalent.
PN_stdfloat get_freq() const
Get frequency of sin flicker.
bool operator<(const PolylightNode &other) const
Returns true if this PolylightNode sorts before the other one, false otherwise.
void flicker_on()
Set flickering to true so at every loop this light's color is varied based on flicker_type.
void flicker_off()
Turn flickering off.
bool set_attenuation(Attenuation_Type type)
Set ALINEAR or AQUADRATIC attenuation.
bool is_flickering() const
Check is this light is flickering.
void set_a1(PN_stdfloat a1)
Set the quadratic attenuation factor a1 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
PN_stdfloat get_a1() const
Get the quadratic attenuation factor a1 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
void set_offset(PN_stdfloat offset)
Set the offset value for the random and sin flicker variations...
void set_scale(PN_stdfloat scale)
Set the scale value for the random and sin flicker variations...
PN_stdfloat get_scale() const
Get the scale value for the random and sin flicker variations.
Indicates what color should be applied to renderable geometry.
void set_color(const LColor &color)
Set the light's color...
void enable()
Enable this light.
get_color_type
Returns the type of color specified by this ColorAttrib.
Flicker_Type get_flicker_type() const
Returns FRANDOM or FSIN.
LColor get_color_scenegraph() const
This differs from get_color in that when applying the light color we need to make sure that a color f...
LColor get_color() const
Returns the light's color as LColor.