14#ifndef POLYLIGHTNODE_H
15#define POLYLIGHTNODE_H
50 enum Attenuation_Type {
58 INLINE
void set_pos(
const LPoint3 &position);
59 INLINE
void set_pos(PN_stdfloat x,PN_stdfloat y, PN_stdfloat z);
61 INLINE
void set_color(
const LColor &color);
62 INLINE
void set_color(PN_stdfloat r, PN_stdfloat g, PN_stdfloat b);
69 INLINE
void set_a0(PN_stdfloat a0);
70 INLINE
void set_a1(PN_stdfloat a1);
71 INLINE
void set_a2(PN_stdfloat a2);
72 INLINE PN_stdfloat
get_a0()
const;
73 INLINE PN_stdfloat
get_a1()
const;
74 INLINE PN_stdfloat
get_a2()
const;
100 virtual void xform(
const LMatrix4 &mat);
107 Attenuation_Type _attenuation_type;
112 Flicker_Type _flicker_type;
115 PN_stdfloat _step_size;
116 PN_stdfloat _sin_freq;
123 virtual void output(std::ostream &out)
const;
126 static TypedWritable *make_from_bam(
const FactoryParams ¶ms);
135 static void init_type() {
136 PandaNode::init_type();
138 PandaNode::get_class_type());
141 return get_class_type();
143 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
A class to retrieve the individual data elements previously stored in a Datagram.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
static void register_with_read_factory()
Tells the BamReader how to create objects of type PandaNode.
virtual void xform(const LMatrix4 &mat)
Transforms the contents of this PandaNode by the indicated matrix, if it means anything to do so.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
Attenuation_Type get_attenuation() const
Get "linear" or "quadratic" attenuation type.
LPoint3 get_pos() const
Returns position as a LPoint3.
PN_stdfloat get_offset() const
Get the offset value for the random and sin flicker variations.
bool is_enabled() const
Is this light is enabled/disabled?
PN_stdfloat get_a2() const
Get the quadratic attenuation factor a2 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
void enable()
Enable this light.
void flicker_off()
Turn flickering off.
void set_pos(const LPoint3 &position)
Set this light's position.
PN_stdfloat get_scale() const
Get the scale value for the random and sin flicker variations.
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...
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...
void set_a2(PN_stdfloat a2)
Set the quadratic attenuation factor a2 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
void flicker_on()
Set flickering to true so at every loop this light's color is varied based on flicker_type.
PN_stdfloat get_radius() const
Get radius of the spherical light volume.
void set_radius(PN_stdfloat r)
Set radius of the spherical light volume.
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 ...
LColor flicker() const
If flickering is on, the do_poly_light function in PolylightNodeEffect will compute this light's colo...
void set_offset(PN_stdfloat offset)
Set the offset value for the random and sin flicker variations... used to tweak the flicker This valu...
void set_a1(PN_stdfloat a1)
Set the quadratic attenuation factor a1 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
void set_freq(PN_stdfloat f)
Set frequency of sin flicker.
void set_a0(PN_stdfloat a0)
Set the quadratic attenuation factor a0 fd = 1 / ( a0 + a1*distance + a2*distance*distance)
Flicker_Type get_flicker_type() const
Returns FRANDOM or FSIN.
LColor get_color() const
Returns the light's color as LColor.
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...
PolylightNode(const std::string &name)
Use PolylightNode() to construct a new PolylightNode object.
bool is_flickering() const
Check is this light is flickering.
PN_stdfloat get_a1() const
Get the quadratic attenuation factor a1 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_attenuation(Attenuation_Type type)
Set ALINEAR or AQUADRATIC attenuation.
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...
PN_stdfloat get_freq() const
Get frequency of sin flicker.
void set_color(const LColor &color)
Set the light's color...
void disable()
Disable this light.
void set_scale(PN_stdfloat scale)
Set the scale value for the random and sin flicker variations... used to tweak the flicker This value...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...