15 #include "pandabase.h"
18 #include "throw_event.h"
28 Camera(
const string &name,
Lens *lens) :
31 _camera_mask(~
PandaNode::get_overall_bit()),
43 Camera(
const Camera ©) :
45 _active(copy._active),
47 _camera_mask(copy._camera_mask),
48 _initial_state(copy._initial_state),
49 _lod_scale(copy._lod_scale),
50 _tag_state_key(copy._tag_state_key),
51 _tag_states(copy._tag_states)
66 nassertv(_display_regions.empty());
128 _tag_states[tag_state] = state;
139 _tag_states.erase(tag_state);
150 TagStates::const_iterator tsi;
151 tsi = _tag_states.find(tag_state);
152 return (tsi != _tag_states.end());
163 get_tag_state(const
string &tag_state)
const {
164 TagStates::const_iterator tsi;
165 tsi = _tag_states.find(tag_state);
166 if (tsi != _tag_states.end()) {
167 return (*tsi).second;
169 return RenderState::make_empty();
184 _aux_data[node_path] = data;
197 AuxData::iterator ai;
198 ai = _aux_data.find(node_path);
199 if (ai != _aux_data.end()) {
215 AuxData::const_iterator ai;
216 ai = _aux_data.find(node_path);
217 if (ai != _aux_data.end()) {
232 out << _aux_data.size() <<
" data objects held:\n";
233 AuxData::const_iterator ai;
234 for (ai = _aux_data.begin(); ai != _aux_data.end(); ++ai) {
235 out << (*ai).first <<
" " << *(*ai).second <<
"\n";
253 AuxData::iterator ai;
254 ai = _aux_data.begin();
255 while (ai != _aux_data.end()) {
256 AuxData::iterator anext = ai;
259 if (now > (*ai).second->get_expiration_time()) {
279 _display_regions.push_back(display_region);
291 DisplayRegions::iterator dri =
292 find(_display_regions.begin(), _display_regions.end(), display_region);
293 if (dri != _display_regions.end()) {
294 _display_regions.erase(dri);
337 parse_params(params, scan, manager);
338 node->fillin(scan, manager);
352 LensNode::fillin(scan, manager);
AuxSceneData * get_aux_scene_data(const NodePath &node_path) const
Returns the AuxSceneData associated with the indicated NodePath, or NULL if nothing is associated...
This is a base class for a generic data structure that can be attached per-instance to the camera...
static ClockObject * get_global_clock()
Returns a pointer to the global ClockObject.
int cleanup_aux_scene_data(Thread *current_thread=Thread::get_current_thread())
Walks through the list of currently-assigned AuxSceneData objects and releases any that are past thei...
A basic node of the scene graph or data graph.
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...
void set_aux_scene_data(const NodePath &node_path, AuxSceneData *data)
Associates the indicated AuxSceneData object with the given NodePath, possibly replacing a previous d...
static void register_with_read_factory()
Tells the BamReader how to create objects of type Camera.
void clear_tag_state(const string &tag_state)
Removes the association established by a previous call to set_tag_state().
A node that contains a Lens.
virtual PandaNode * make_copy() const
Returns a newly-allocated Node that is a shallow copy of this one.
Base class for objects that can be written to and read from Bam files.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
PN_uint32 get_uint32()
Extracts an unsigned 32-bit integer.
void set_word(WordType value)
Sets the entire BitMask to the value indicated by the given word.
void list_aux_scene_data(ostream &out) const
Outputs all of the NodePaths and AuxSceneDatas in use.
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.
void set_tag_state(const string &tag_state, const RenderState *state)
Associates a particular state transition with the indicated tag value.
double get_frame_time(Thread *current_thread=Thread::get_current_thread()) const
Returns the time in seconds as of the last time tick() was called (typically, this will be as of the ...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of Node by duplicating insta...
bool clear_aux_scene_data(const NodePath &node_path)
Removes the AuxSceneData associated with the indicated NodePath.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
A thread; that is, a lightweight process.
void add_uint32(PN_uint32 value)
Adds an unsigned 32-bit integer to the datagram.
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of Node by calling the xform()...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
An abstract base class for DisplayRegion, mainly so we can store DisplayRegion pointers in a Camera...
A class to retrieve the individual data elements previously stored in a Datagram. ...
WordType get_word() const
Returns the entire BitMask as a single word.
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 ...
NodePath is the fundamental system for disambiguating instances, and also provides a higher-level int...
bool has_tag_state(const string &tag_state) const
Returns true if set_tag_state() has previously been called with the indicated tag state...