38class EXPCL_PANDA_PGRAPH Light {
41 INLINE Light(
const Light ©);
48 INLINE
void set_color(
const LColor &color);
63 virtual int get_class_priority()
const=0;
70 virtual void output(std::ostream &out)
const=0;
71 virtual void write(std::ostream &out,
int indent_level)
const=0;
76 const LPoint3 &from_object_point,
77 const LMatrix4 &to_object_space);
84 virtual void fill_viz_geom(
GeomNode *viz_geom);
85 INLINE
void mark_viz_stale();
94 CP_directional_priority,
107 bool _has_color_temperature;
108 PN_stdfloat _color_temperature;
111 class EXPCL_PANDA_PGRAPH CData :
public CycleData {
114 INLINE CData(
const CData ©);
119 return Light::get_class_type();
124 PT(GeomNode) _viz_geom;
125 bool _viz_geom_stale;
128 PipelineCycler<CData> _cycler;
129 typedef CycleDataReader<CData> CDReader;
130 typedef CycleDataLockedReader<CData> CDLockedReader;
131 typedef CycleDataWriter<CData> CDWriter;
134 void write_datagram(BamWriter *manager, Datagram &dg);
135 void fillin(DatagramIterator &scan, BamReader *manager);
138 static TypeHandle get_class_type() {
141 static void init_type() {
142 ReferenceCount::init_type();
144 ReferenceCount::get_class_type());
146 virtual TypeHandle get_type()
const {
147 return get_class_type();
151 static TypeHandle _type_handle;
154INLINE std::ostream &operator << (std::ostream &out,
const Light &light) {
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
A single page of data maintained by a PipelineCycler.
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 ...
A node that holds Geom objects, renderable pieces of geometry.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
The abstract interface to all kinds of lights.
virtual bool get_vector_to_light(LVector3 &result, const LPoint3 &from_object_point, const LMatrix4 &to_object_space)
Computes the vector from a particular vertex to this light.
get_color_temperature
Returns the basic color temperature of the light, assuming has_color_temperature() returns true.
set_priority
Changes the relative importance of this light relative to the other lights that are applied simultane...
virtual void attrib_ref()
This is called when the light is added to a LightAttrib.
virtual PN_stdfloat get_exponent() const
For spotlights, returns the exponent that controls the amount of light falloff from the center of the...
virtual const LVecBase3 & get_attenuation() const
Returns the terms of the attenuation equation for the light.
get_color
Returns the basic color of the light.
virtual bool is_ambient_light() const
Returns true if this is an AmbientLight, false if it is some other kind of light.
set_color
Sets the basic color of the light.
bool has_color_temperature() const
Returns true if the color was specified as a temperature in kelvins, and get_color_temperature is def...
virtual const LColor & get_specular_color() const
Returns the color of specular highlights generated by the light.
static UpdateSeq get_sort_seq()
Returns a global sequence number that is incremented any time any Light in the world changes sort or ...
virtual void attrib_unref()
This is called when the light is removed from a LightAttrib.
set_color_temperature
Sets the color temperature of the light in kelvins.
GeomNode * get_viz()
Returns a GeomNode that may be rendered to visualize the Light.
get_priority
Returns the priority associated with this light.
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
A basic node of the scene graph or data graph.
TypeHandle is the identifier used to differentiate C++ class types.
This is a sequence number that increments monotonically.
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.
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(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.