15 #include "lightLensNode.h"
16 #include "bamWriter.h"
17 #include "bamReader.h"
19 #include "datagramIterator.h"
20 #include "renderState.h"
21 #include "cullFaceAttrib.h"
22 #include "colorWriteAttrib.h"
32 LightLensNode(
const string &name,
Lens *lens) :
36 _shadow_caster =
false;
42 set_initial_state(RenderState::make(CullFaceAttrib::make_reverse(),
43 ColorWriteAttrib::make(ColorWriteAttrib::C_off)));
54 clear_shadow_buffers();
67 _shadow_caster =
false;
72 set_initial_state(RenderState::make(CullFaceAttrib::make_reverse(),
73 ColorWriteAttrib::make(ColorWriteAttrib::C_off)));
84 clear_shadow_buffers() {
85 ShadowBuffers::iterator it;
86 for(it = _sbuffers.begin(); it != _sbuffers.end(); ++it) {
87 (*it).first->remove_window((*it).second);
120 output(ostream &out)
const {
121 LensNode::output(out);
130 write(ostream &out,
int indent_level)
const {
131 LensNode::write(out, indent_level);
143 Light::write_datagram(manager, dg);
160 Camera::fillin(scan, manager);
161 Light::fillin(scan, manager);
163 bool shadow_caster = scan.
get_bool();
void set_shadow_caster(bool caster)
Sets the flag indicating whether this light should cast shadows or not.
A basic node of the scene graph or data graph.
The abstract interface to all kinds of lights.
bool get_bool()
Extracts a boolean value.
A base class for any number of different kinds of lenses, linear and otherwise.
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 ...
PN_int32 get_int32()
Extracts a signed 32-bit integer.
void set_active(bool active)
Sets the active flag on the camera.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
void add_bool(bool value)
Adds a boolean value to the datagram.
virtual Light * as_light()
Cross-casts the node to a Light pointer, if it is one of the four kinds of Light nodes, or returns NULL if it is not.
A derivative of Light and of Camera.
virtual PandaNode * as_node()
Returns the Light object upcast to a PandaNode.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
void add_int32(PN_int32 value)
Adds a signed 32-bit integer to the datagram.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
A node that can be positioned around in the scene graph to represent a point of view for rendering a ...
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...