45 (
"allow-flatten-color",
false,
46 PRC_DESC(
"allows color to always be flattened to vertices"));
54GeomNode(
const std::string &name) :
57 _preserved = preserve_geom_nodes;
60 set_into_collide_mask(get_default_collide_mask());
69 _preserved(copy._preserved),
103 if (pgraph_cat.is_debug()) {
105 <<
"Transforming geometry:\n";
106 attribs.write(pgraph_cat.debug(
false), attrib_types, 2);
109 if ((attrib_types & SceneGraphReducer::TT_transform) != 0) {
110 if (!attribs._transform->is_identity()) {
116 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
117 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
118 PT(
GeomList) geoms = cdata->modify_geoms();
124 size_t num_geoms = geoms->size();
125 for (
size_t i = 0; i < num_geoms; ++i) {
127 PT(
Geom) new_geom = entry->_geom.get_read_pointer()->make_copy();
130 entry->_state = geom_attribs.
collect(entry->_state, attrib_types);
132 bool any_changed =
false;
134 if ((attrib_types & SceneGraphReducer::TT_color) != 0) {
137 int override = geom_attribs._color_override;
138 entry->_state = entry->_state->add_attrib(ra,
override);
141 ra = entry->_state->get_attrib_def(ColorAttrib::get_class_slot());
143 if (ca->get_color_type() != ColorAttrib::T_vertex) {
144 if(allow_flatten_color) {
145 if(transformer.
set_color(new_geom, ca->get_color())) {
147 entry->_state = entry->_state->set_attrib(ColorAttrib::make_vertex());
150 if (transformer.
remove_column(new_geom, InternalName::get_color())) {
156 if ((attrib_types & SceneGraphReducer::TT_color_scale) != 0) {
157 if (geom_attribs._color_scale !=
nullptr) {
159 if (csa->get_scale() != LVecBase4(1.0f, 1.0f, 1.0f, 1.0f)) {
164 CPT(
RenderAttrib) ra = entry->_state->get_attrib_def(ColorAttrib::get_class_slot());
166 if(allow_flatten_color) {
171 if (ca->get_color_type() == ColorAttrib::T_off) {
172 entry->_state = entry->_state->set_attrib(ColorAttrib::make_vertex());
175 entry->_state = entry->_state->set_attrib(ColorAttrib::make_flat(csa->get_scale()));
177 }
else if (ca->get_color_type() == ColorAttrib::T_flat) {
180 const LColor &c1 = ca->get_color();
181 const LVecBase4 &c2 = csa->get_scale();
182 LColor color(c1[0] * c2[0], c1[1] * c2[1],
183 c1[2] * c2[2], c1[3] * c2[3]);
184 entry->_state = entry->_state->set_attrib(ColorAttrib::make_flat(color));
192 entry->_state = entry->_state->set_attrib(ColorAttrib::make_vertex());
199 if ((attrib_types & SceneGraphReducer::TT_tex_matrix) != 0) {
200 if (geom_attribs._tex_matrix !=
nullptr) {
208 if (geom_attribs._texture !=
nullptr) {
211 for (
int si = 0; si < num_on_stages; si++) {
214 count_name(name_count, name);
223 int num_stages = tma->get_num_stages();
224 for (
int i = 0; i < num_stages; i++) {
227 if (get_name_count(name_count, name) > 1) {
230 new_tma = DCAST(
TexMatrixAttrib, new_tma->add_stage(stage, tma->get_transform(stage)));
241 if (!new_tma->is_empty()) {
242 entry->_state = entry->_state->add_attrib(new_tma);
247 if ((attrib_types & SceneGraphReducer::TT_other) != 0) {
248 entry->_state = geom_attribs._other->compose(entry->_state);
255 if ((attrib_types & SceneGraphReducer::TT_cull_face) != 0) {
256 if (geom_attribs._cull_face !=
nullptr) {
260 case CullFaceAttrib::M_cull_none:
263 bool has_normals = (new_geom->get_vertex_data()->has_column(InternalName::get_normal()));
267 PT(
Geom) dup_geom = new_geom->reverse();
270 geoms->push_back(
GeomEntry(dup_geom, entry->_state));
274 entry = &(*geoms)[i];
279 new_geom->doubleside_in_place();
285 case CullFaceAttrib::M_cull_counter_clockwise:
287 new_geom->reverse_in_place();
299 entry->_geom = new_geom;
303 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
305 if ((attrib_types & SceneGraphReducer::TT_apply_texture_color) != 0) {
321xform(
const LMatrix4 &mat) {
366 CDReader cdata(_cycler, current_thread);
367 GeomList::const_iterator gi;
368 CPT(
GeomList) geoms = cdata->get_geoms();
369 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
371 CPT(
RenderState) geom_state = node_state->compose(entry._state);
372 CPT(
Geom) geom = entry._geom.get_read_pointer();
375 PT(
GeomMunger) munger = gsg->get_geom_munger(geom_state, current_thread);
376 geom = transformer.premunge_geom(geom, munger);
379 CPT(
GeomVertexData) vdata = geom->get_animated_vertex_data(
false, current_thread);
381 int num_arrays = vdata_reader.get_num_arrays();
382 for (
int i = 0; i < num_arrays; ++i) {
388 int num_primitives = geom->get_num_primitives();
389 for (
int i = 0; i < num_primitives; ++i) {
394 if (munger->is_of_type(StateMunger::get_class_type())) {
396 geom_state = state_munger->munge_state(geom_state);
401 if (geom_state->get_attrib(sa)) {
403 if (shader !=
nullptr) {
407 gsg->ensure_generated_shader(geom_state);
409 else if (munger->is_of_type(StateMunger::get_class_type())) {
412 geom_state = state_munger->munge_state(geom_state);
419 if (geom_state->get_attrib(ta)) {
421 for (
int i = 0; i < num_stages; ++i) {
424 if (texture !=
nullptr) {
470calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point,
bool &found_any,
473 PandaNode::calc_tight_bounds(min_point, max_point, found_any, transform,
476 const LMatrix4 &mat = next_transform->get_mat();
478 CDReader cdata(_cycler, current_thread);
479 GeomList::const_iterator gi;
480 CPT(GeomList) geoms = cdata->get_geoms();
481 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
482 CPT(
Geom) geom = (*gi)._geom.get_read_pointer();
483 geom->calc_tight_bounds(min_point, max_point, found_any,
484 geom->get_animated_vertex_data(
true, current_thread),
485 !next_transform->is_identity(), mat,
489 return next_transform;
510 trav->_geom_nodes_pcollector.add_level(1);
512 if (pgraph_cat.is_spam()) {
514 <<
"Found " << *
this <<
" in state " << *data._state
515 <<
" draw_mask = " << data._draw_mask <<
"\n";
522 int num_geoms = geoms.get_num_geoms();
523 trav->_geoms_pcollector.add_level(num_geoms);
524 CPT(
TransformState) internal_transform = data.get_internal_transform(trav);
526 for (
int i = 0; i < num_geoms; i++) {
527 CPT(
Geom) geom = geoms.get_geom(i);
528 if (geom->is_empty()) {
532 CPT(
RenderState) state = data._state->compose(geoms.get_geom_state(i));
533 if (state->has_cull_callback() && !state->cull_callback(trav, data)) {
543 if (data._view_frustum !=
nullptr) {
545 CPT(
BoundingVolume) geom_volume = geom->get_bounds(current_thread);
549 int result = data._view_frustum->contains(geom_gbv);
550 if (result == BoundingVolume::IF_no_intersection) {
555 if (!data._cull_planes->is_empty()) {
557 CPT(
BoundingVolume) geom_volume = geom->get_bounds(current_thread);
561 data._cull_planes->do_cull(result, state, geom_gbv);
562 if (result == BoundingVolume::IF_no_intersection) {
570 new CullableObject(std::move(geom), std::move(state), internal_transform);
595 nassertv(geom !=
nullptr);
597 nassertv(state !=
nullptr);
600 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
601 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
603 cdata->modify_geoms()->push_back(
GeomEntry(geom, state));
605 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
607 mark_internal_bounds_stale();
617 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
618 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
619 CDStageReader cdata_other(other->_cycler, pipeline_stage, current_thread);
621 GeomList::const_iterator gi;
622 CPT(
GeomList) other_geoms = cdata_other->get_geoms();
623 PT(
GeomList) this_geoms = cdata->modify_geoms();
624 for (gi = other_geoms->begin(); gi != other_geoms->end(); ++gi) {
626 nassertv(entry._geom.get_read_pointer()->check_valid());
627 this_geoms->push_back(entry);
630 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
632 mark_internal_bounds_stale();
646 nassertv(geom !=
nullptr);
650 PT(
GeomList) geoms = cdata->modify_geoms();
651 nassertv(n >= 0 && n < (
int)geoms->size());
652 (*geoms)[n]._geom = geom;
654 mark_internal_bounds_stale();
665 for (
int i = 0; i < num_geoms; i++) {
666 const Geom *geom = get_geom(i);
688 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
689 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
691 GeomList::iterator gi;
692 PT(
GeomList) geoms = cdata->modify_geoms();
693 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
695 nassertv(entry._geom.test_ref_count_integrity());
696 PT(
Geom) geom = entry._geom.get_write_pointer();
697 geom->decompose_in_place();
700 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
722unify(
int max_indices,
bool preserve_order) {
723 bool any_changed =
false;
726 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
727 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
734 GeomList::const_iterator gi;
735 CPT(
GeomList) old_geoms = cdata->get_geoms();
736 for (gi = old_geoms->begin(); gi != old_geoms->end(); ++gi) {
739 bool unified =
false;
742 GeomList::reverse_iterator gj;
743 for (gj = new_geoms->rbegin(); gj != new_geoms->rend() && !unified; ++gj) {
745 if (old_entry._state == new_entry._state) {
747 CPT(
Geom) old_geom = old_entry._geom.get_read_pointer();
748 PT(
Geom) new_geom = new_entry._geom.get_write_pointer();
749 if (new_geom->copy_primitives_from(old_geom)) {
756 if (preserve_order) {
766 new_geoms->push_back(old_entry);
771 cdata->set_geoms(new_geoms);
774 GeomList::iterator wgi;
775 for (wgi = new_geoms->begin(); wgi != new_geoms->end(); ++wgi) {
777 nassertv(entry._geom.test_ref_count_integrity());
778 PT(
Geom) geom = entry._geom.get_write_pointer();
779 geom->unify_in_place(max_indices, preserve_order);
782 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
785 mark_internal_bounds_stale();
793write_geoms(std::ostream &out,
int indent_level)
const {
795 write(out, indent_level);
796 GeomList::const_iterator gi;
797 CPT(
GeomList) geoms = cdata->get_geoms();
798 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
800 indent(out, indent_level + 2)
801 << *entry._geom.get_read_pointer() <<
" " << *entry._state <<
"\n";
811 write(out, indent_level);
812 GeomList::const_iterator gi;
813 CPT(
GeomList) geoms = cdata->get_geoms();
814 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
816 CPT(
Geom) geom = entry._geom.get_read_pointer();
817 indent(out, indent_level + 2)
818 << *geom <<
" " << *entry._state <<
"\n";
819 geom->write(out, indent_level + 4);
827output(std::ostream &out)
const {
833 CDReader cdata(_cycler);
837 GeomList::const_iterator gi;
838 CPT(
RenderState) common = RenderState::make_empty();
840 CPT(GeomList) geoms = cdata->get_geoms();
841 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
842 const GeomEntry &entry = (*gi);
843 common = common->compose(entry._state);
846 PandaNode::output(out);
847 out <<
" (" << geoms->size() <<
" geoms";
849 if (!common->is_empty()) {
850 out <<
": " << *common;
879 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
880 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
882 GeomList::iterator gi;
883 PT(
GeomList) geoms = cdata->modify_geoms();
884 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
886 CPT(
RenderState) geom_state = node_state->compose(entry._state);
887 CPT(
Geom) geom = entry._geom.get_read_pointer();
888 PT(
GeomMunger) munger = gsg->get_geom_munger(geom_state, current_thread);
889 entry._geom = transformer.premunge_geom(geom, munger);
892 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
900r_mark_geom_bounds_stale(
Thread *current_thread) {
901 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
902 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
904 GeomList::iterator gi;
905 PT(GeomList) geoms = cdata->modify_geoms();
906 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
907 GeomEntry &entry = (*gi);
908 entry._geom.get_read_pointer()->mark_bounds_stale();
911 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
912 mark_internal_bounds_stale();
914 PandaNode::r_mark_geom_bounds_stale(current_thread);
924 int &internal_vertices,
926 Thread *current_thread)
const {
927 int num_vertices = 0;
929 CDLockedStageReader cdata(_cycler, pipeline_stage, current_thread);
935 GeomList::const_iterator gi;
936 CPT(GeomList) geoms = cdata->get_geoms();
937 child_volumes.reserve(geoms->size());
938 child_volumes_ref.reserve(geoms->size());
940 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
941 const GeomEntry &entry = (*gi);
942 CPT(
Geom) geom = entry._geom.get_read_pointer();
945 if (!volume->is_empty()) {
946 child_volumes.push_back(volume);
947 child_volumes_ref.push_back(volume);
948 if (!volume->is_exact_type(BoundingBox::get_class_type())) {
952 num_vertices += geom->get_nested_vertices();
958 if (btype == BoundingVolume::BT_default) {
962 if (btype == BoundingVolume::BT_box ||
963 (btype != BoundingVolume::BT_sphere && all_box)) {
972 if (child_volumes.size() > 0) {
974 const BoundingVolume **child_end = child_begin + child_volumes.size();
978 internal_bounds = gbv;
979 internal_vertices = num_vertices;
1017 CPT(
RenderAttrib) vertex_color = ColorAttrib::make_vertex();
1020 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
1021 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
1023 GeomList::iterator gi;
1024 PT(
GeomList) geoms = cdata->modify_geoms();
1025 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
1027 CPT(
Geom) geom = entry._geom.get_read_pointer();
1032 CPT(
GeomVertexData) vdata = geom->get_vertex_data(current_thread);
1034 for (
size_t i = 0; i < vformat->get_num_arrays(); ++i) {
1039 if (vdata->has_column(color) &&
1040 !entry._state->has_attrib(ColorAttrib::get_class_slot())) {
1044 aux_data->_hold_state = entry._state;
1047 entry._state = entry._state->add_attrib(vertex_color, -1);
1051 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
1067 node->fillin(scan, manager);
1082 PandaNode::fillin(scan, manager);
1090CData(
const GeomNode::CData ©) :
1100 return new CData(*
this);
1107void GeomNode::CData::
1109 CPT(GeomList) geoms = _geoms.get_read_pointer();
1110 int num_geoms = geoms->size();
1111 nassertv(num_geoms == (
int)(uint16_t)num_geoms);
1114 GeomList::const_iterator gi;
1115 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
1116 const GeomEntry &entry = (*gi);
1126int GeomNode::CData::
1131 GeomList::iterator gi;
1132 PT(GeomList) geoms = _geoms.get_write_pointer();
1133 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
1134 GeomEntry &entry = (*gi);
1135 entry._geom = DCAST(
Geom, p_list[pi++]);
1146void GeomNode::CData::
1150 PT(GeomList) geoms =
new GeomList;
1151 geoms->reserve(num_geoms);
1152 for (
int i = 0; i < num_geoms; i++) {
1155 geoms->push_back(GeomEntry(
nullptr,
nullptr));
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is used by the SceneGraphReducer to maintain and accumulate the set of attributes we have ...
void collect(PandaNode *node, int attrib_types)
Collects the state and transform from the indicated node and adds it to the accumulator,...
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
void register_finalize(TypedWritable *whom)
Should be called by an object reading itself from the Bam file to indicate that this particular objec...
void finalize_now(TypedWritable *whom)
Forces the finalization of a particular object.
void set_aux_data(TypedWritable *obj, const std::string &name, AuxData *data)
Associates an arbitrary block of data with the indicated object (or NULL), and the indicated name.
bool read_pointer(DatagramIterator &scan)
The interface for reading a pointer to another object from a Bam file.
int get_file_minor_ver() const
Returns the minor version number of the Bam file currently being read.
void read_cdata(DatagramIterator &scan, PipelineCyclerBase &cycler)
Reads in the indicated CycleData object.
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
This is the fundamental interface for writing binary objects to a Bam file, to be extracted later by ...
void write_cdata(Datagram &packet, const PipelineCyclerBase &cycler)
Writes out the indicated CycleData object.
void write_pointer(Datagram &packet, const TypedWritable *dest)
The interface for writing a pointer to another object to a Bam file.
static BitMask< uint32_t, nbits > all_on()
Returns a BitMask whose bits are all on.
An axis-aligned bounding box; that is, a minimum and maximum coordinate triple.
This defines a bounding sphere, consisting of a center and a radius.
This is an abstract class for any volume in any sense which can be said to define the locality of ref...
Indicates what color should be applied to renderable geometry.
Applies a scale to colors in the scene graph and on vertices.
This is a convenience class to specialize ConfigVariable as a boolean type.
This is similar to RefCountObj, but it implements a CopyOnWriteObject inheritance instead of a Refere...
Indicates which faces should be culled based on their vertex ordering.
get_effective_mode
Returns the effective culling mode.
virtual void record_object(CullableObject *object, const CullTraverser *traverser)
This callback function is intended to be overridden by a derived class.
This collects together the pieces of data that are accumulated for each node while walking the scene ...
This object performs a depth-first traversal of the scene graph, with optional view-frustum culling,...
CullHandler * get_cull_handler() const
Returns the object that will receive the culled Geoms.
Thread * get_current_thread() const
Returns the currently-executing thread object, as passed to the CullTraverser constructor.
The smallest atom of cull.
This template class calls PipelineCycler::read_unlocked(), and then provides a transparent read-only ...
This class is similar to CycleDataReader, except it allows reading from a particular stage of the pip...
This class is similar to CycleDataWriter, except it allows writing to a particular stage of the pipel...
This template class calls PipelineCycler::write() in the constructor and PipelineCycler::release_writ...
A single page of data maintained by a PipelineCycler.
virtual int complete_pointers(TypedWritable **p_list, BamReader *manager)
Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
A class to retrieve the individual data elements previously stored in a Datagram.
uint16_t get_uint16()
Extracts an unsigned 16-bit integer.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_uint16(uint16_t value)
Adds an unsigned 16-bit integer to the datagram.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
Objects of this class are used to convert vertex data from a Geom into a format suitable for passing ...
A node that holds Geom objects, renderable pieces of geometry.
void add_geoms_from(const GeomNode *other)
Copies the Geoms (and their associated RenderStates) from the indicated GeomNode into this one.
void do_premunge(GraphicsStateGuardianBase *gsg, const RenderState *node_state, GeomTransformer &transformer)
Uses the indicated GSG to premunge the Geoms in this node to optimize them for eventual rendering.
void write_geoms(std::ostream &out, int indent_level) const
Writes a short description of all the Geoms in the node.
void add_geom(Geom *geom, const RenderState *state=RenderState::make_empty())
Adds a new Geom to the node.
virtual bool safe_to_combine() const
Returns true if it is generally safe to combine this particular kind of PandaNode with other kinds of...
get_num_geoms
Returns the number of geoms in the node.
Geoms get_geoms(Thread *current_thread=Thread::get_current_thread()) const
Returns an object that can be used to walk through the list of geoms of the node.
virtual PandaNode * make_copy() const
Returns a newly-allocated PandaNode that is a shallow copy of this one.
void unify(int max_indices, bool preserve_order)
Attempts to unify all of the Geoms contained within this node into a single Geom, or at least as few ...
virtual void xform(const LMatrix4 &mat)
Transforms the contents of this node by the indicated matrix, if it means anything to do so.
virtual PandaNode * combine_with(PandaNode *other)
Collapses this node with the other node, if possible, and returns a pointer to the combined node,...
virtual void apply_attribs_to_vertices(const AccumulatedAttribs &attribs, int attrib_types, GeomTransformer &transformer)
Applies whatever attributes are specified in the AccumulatedAttribs object (and by the attrib_types b...
virtual void write_datagram(BamWriter *manager, Datagram &dg)
Writes the contents of this object to the datagram for shipping out to a Bam file.
virtual bool safe_to_flatten() const
Returns true if it is generally safe to flatten out this particular kind of PandaNode by duplicating ...
static void register_with_read_factory()
Tells the BamReader how to create objects of type GeomNode.
virtual bool is_renderable() const
Returns true if there is some value to visiting this particular node during the cull traversal for an...
virtual CollideMask get_legal_collide_mask() const
Returns the subset of CollideMask bits that may be set for this particular type of PandaNode.
virtual bool is_geom_node() const
A simple downcast check.
virtual void add_for_draw(CullTraverser *trav, CullTraverserData &data)
Adds the node's contents to the CullResult we are building up during the cull traversal,...
void set_geom(int n, Geom *geom)
Replaces the nth Geom of the node with a new pointer.
virtual void r_prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state, GeomTransformer &transformer, Thread *current_thread)
The recursive implementation of prepare_scene().
void write_verbose(std::ostream &out, int indent_level) const
Writes a detailed description of all the Geoms in the node.
virtual void finalize(BamReader *manager)
Called by the BamReader to perform any final actions needed for setting up the object after all objec...
bool check_valid() const
Verifies that the each Geom within the GeomNode reference vertices that actually exist within its Geo...
void decompose()
Calls decompose() on each Geom with the GeomNode.
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
This is the data for one array of a GeomVertexData structure.
Encapsulates the data from a GeomVertexData, pre-fetched for one stage of the pipeline.
This defines the actual numeric vertex data stored in a Geom, in the structure defined by a particula...
A container for geometry primitives.
bool check_valid() const
Verifies that the all of the primitives within the geom reference vertices that actually exist within...
This is another abstract class, for a general class of bounding volumes that actually enclose points ...
virtual GeometricBoundingVolume * as_geometric_bounding_volume() final
Virtual downcast method.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
Encodes a string name in a hash table, mapping it to a pointer.
A basic node of the scene graph or data graph.
virtual PandaNode * combine_with(PandaNode *other)
Collapses this PandaNode with the other PandaNode, if possible, and returns a pointer to the combined...
virtual void r_prepare_scene(GraphicsStateGuardianBase *gsg, const RenderState *node_state, GeomTransformer &transformer, Thread *current_thread)
The recursive implementation of prepare_scene().
get_bounds_type
Returns the bounding volume type set with set_bounds_type().
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 table of objects that are saved within the graphics context for reference by handle later.
void enqueue_vertex_buffer(GeomVertexArrayData *data)
Indicates that a buffer would like to be put on the list to be prepared when the GSG is next ready to...
void enqueue_texture(Texture *tex)
Indicates that a texture would like to be put on the list to be prepared when the GSG is next ready t...
void enqueue_index_buffer(GeomPrimitive *data)
Indicates that a buffer would like to be put on the list to be prepared when the GSG is next ready to...
void enqueue_shader(Shader *shader)
Indicates that a shader would like to be put on the list to be prepared when the GSG is next ready to...
This is the base class for a number of render attributes (other than transform) that may be set on sc...
This represents a unique collection of RenderAttrib objects that correspond to a particular renderabl...
bool auto_shader() const
If true, then this ShaderAttrib does not contain an explicit shader - instead, it requests the automa...
This is just a simple derivative of GeomMunger that adds the ability to munge states.
Applies a transform matrix to UV's before they are rendered.
Indicates the set of TextureStages and their associated Textures that should be applied to (or remove...
get_num_on_stages
Returns the number of stages that are turned on by the attribute.
get_on_texture
Returns the texture associated with the indicated stage, or NULL if no texture is associated.
get_on_stage
Returns the nth stage turned on by the attribute, sorted in render order.
Defines the properties of a named stage of the multitexture pipeline.
get_texcoord_name
See set_texcoord_name.
Represents a texture object, which is typically a single 2-d image but may also represent a 1-d or 3-...
A thread; that is, a lightweight process.
get_current_thread
Returns a pointer to the currently-executing Thread object.
TypeHandle is the identifier used to differentiate C++ class types.
bool is_exact_type(TypeHandle handle) const
Returns true if the current object is the indicated type exactly.
Base class for objects that can be written to and read from Bam files.
This is our own Panda specialization on the default STL map.
This is our own Panda specialization on the default STL set.
This is our own Panda specialization on the default STL vector.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
std::ostream & indent(std::ostream &out, int indent_level)
A handy function for doing text formatting.
CPT(TransformState) GeomNode
This is used to support NodePath::calc_tight_bounds().
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.