27 Camera(
const string &name,
Lens *lens) :
30 _camera_mask(~
PandaNode::get_overall_bit()),
40 Camera(
const Camera ©) :
42 _active(copy._active),
44 _camera_mask(copy._camera_mask),
45 _initial_state(copy._initial_state),
46 _lod_scale(copy._lod_scale),
47 _tag_state_key(copy._tag_state_key),
48 _tag_states(copy._tag_states)
60 nassertv(_display_regions.empty());
108 _tag_states[tag_state] = state;
116 _tag_states.erase(tag_state);
133 TagStates::const_iterator tsi;
134 tsi = _tag_states.find(tag_state);
135 return (tsi != _tag_states.end());
143 get_tag_state(
const string &tag_state)
const {
144 TagStates::const_iterator tsi;
145 tsi = _tag_states.find(tag_state);
146 if (tsi != _tag_states.end()) {
147 return (*tsi).second;
149 return RenderState::make_empty();
158 if (data ==
nullptr) {
161 _aux_data[node_path] = data;
171 AuxData::iterator ai;
172 ai = _aux_data.find(node_path);
173 if (ai != _aux_data.end()) {
187 AuxData::const_iterator ai;
188 ai = _aux_data.find(node_path);
189 if (ai != _aux_data.end()) {
201 out << _aux_data.size() <<
" data objects held:\n";
202 AuxData::const_iterator ai;
203 for (ai = _aux_data.begin(); ai != _aux_data.end(); ++ai) {
204 out << (*ai).first <<
" " << *(*ai).second <<
"\n";
219 AuxData::iterator ai;
220 ai = _aux_data.begin();
221 while (ai != _aux_data.end()) {
222 AuxData::iterator anext = ai;
225 if (now > (*ai).second->get_expiration_time()) {
242 _display_regions.push_back(display_region);
251 DisplayRegions::iterator dri =
252 find(_display_regions.begin(), _display_regions.end(), display_region);
253 if (dri != _display_regions.end()) {
254 _display_regions.erase(dri);
309 node->fillin(scan, manager);
320 LensNode::fillin(scan, manager);
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.
void clear_tag_states()
Removes all associations established by previous calls to set_tag_state().
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.
PN_stdfloat get_stdfloat()
Extracts either a 32-bit or a 64-bit floating-point number, according to Datagram::set_stdfloat_doubl...
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...
CPT(RenderState) Camera
Returns the state associated with the indicated tag state by a previous call to set_tag_state(),...
static void register_with_read_factory()
Tells the BamReader how to create objects of type Camera.
CPT(RenderState) get_tag_state(const std has_tag_state
Returns true if set_tag_state() has previously been called with the indicated tag state,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A node that contains a Lens.
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being written.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
virtual PandaNode * make_copy() const
Returns a newly-allocated Node that is a shallow copy of this one.
void set_word(WordType value)
Sets the entire BitMask to the value indicated by the given word.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
CPT(RenderState) get_tag_state(const std set_tag_state
Associates a particular state transition with the indicated tag value.
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
void add_uint32(uint32_t value)
Adds an unsigned 32-bit integer to the datagram.
void add_stdfloat(PN_stdfloat value)
Adds either a 32-bit or a 64-bit floating-point number, according to set_stdfloat_double().
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
WordType get_word() const
Returns the entire BitMask as a single word.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
void add_bool(bool value)
Adds a boolean value to the datagram.
get_frame_time
Returns the time in seconds as of the last time tick() was called (typically, this will be as of the ...
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of Node by duplicating insta...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual bool safe_to_transform() const
Returns true if it is generally safe to transform this particular kind of Node by calling the xform()...
uint32_t get_uint32()
Extracts an unsigned 32-bit integer.
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
get_aux_scene_data
Returns the AuxSceneData associated with the indicated NodePath, or NULL if nothing is associated.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
clear_aux_scene_data
Removes the AuxSceneData associated with the indicated NodePath.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
A thread; that is, a lightweight process.
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
A rectangular subregion within a window for rendering into.
A class to retrieve the individual data elements previously stored in a Datagram.
virtual int complete_pointers(TypedWritable **plist, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
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...
CPT(RenderState) get_tag_state(const std clear_tag_state
Removes the association established by a previous call to set_tag_state().
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
void list_aux_scene_data(std::ostream &out) const
Outputs all of the NodePaths and AuxSceneDatas in use.