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) {
210 int num_stages = tma->get_num_stages();
211 for (
int i = 0; i < num_stages; i++) {
214 name_transforms[name].insert(tma->get_transform(stage)->get_unique());
217 if (geom_attribs._texture !=
nullptr) {
222 for (
int si = 0; si < num_on_stages; si++) {
225 if (!tma->has_stage(stage)) {
226 name_transforms[name].insert(TransformState::make_identity());
233 for (
int i = 0; i < num_stages; i++) {
236 auto it = name_transforms.find(name);
237 if (it == name_transforms.end()) {
240 else if (it->second.size() != 1) {
243 new_tma = DCAST(
TexMatrixAttrib, new_tma->add_stage(stage, tma->get_transform(stage)));
255 name_transforms.erase(it);
259 if (!new_tma->is_empty()) {
260 entry->_state = entry->_state->add_attrib(new_tma);
265 if ((attrib_types & SceneGraphReducer::TT_other) != 0) {
266 entry->_state = geom_attribs._other->compose(entry->_state);
273 if ((attrib_types & SceneGraphReducer::TT_cull_face) != 0) {
274 if (geom_attribs._cull_face !=
nullptr) {
278 case CullFaceAttrib::M_cull_none:
281 bool has_normals = (new_geom->get_vertex_data()->has_column(InternalName::get_normal()));
285 PT(
Geom) dup_geom = new_geom->reverse();
288 geoms->push_back(
GeomEntry(dup_geom, entry->_state));
292 entry = &(*geoms)[i];
297 new_geom->doubleside_in_place();
303 case CullFaceAttrib::M_cull_counter_clockwise:
305 new_geom->reverse_in_place();
317 entry->_geom = new_geom;
321 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
323 if ((attrib_types & SceneGraphReducer::TT_apply_texture_color) != 0) {
339xform(
const LMatrix4 &mat) {
384 CDReader cdata(_cycler, current_thread);
385 GeomList::const_iterator gi;
386 CPT(
GeomList) geoms = cdata->get_geoms();
387 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
389 CPT(
RenderState) geom_state = node_state->compose(entry._state);
390 CPT(
Geom) geom = entry._geom.get_read_pointer();
393 PT(
GeomMunger) munger = gsg->get_geom_munger(geom_state, current_thread);
394 geom = transformer.premunge_geom(geom, munger);
397 CPT(
GeomVertexData) vdata = geom->get_animated_vertex_data(
false, current_thread);
399 int num_arrays = vdata_reader.get_num_arrays();
400 for (
int i = 0; i < num_arrays; ++i) {
406 int num_primitives = geom->get_num_primitives();
407 for (
int i = 0; i < num_primitives; ++i) {
412 if (munger->is_of_type(StateMunger::get_class_type())) {
414 geom_state = state_munger->munge_state(geom_state);
419 if (geom_state->get_attrib(sa)) {
421 if (shader !=
nullptr) {
425 gsg->ensure_generated_shader(geom_state);
427 else if (munger->is_of_type(StateMunger::get_class_type())) {
430 geom_state = state_munger->munge_state(geom_state);
437 if (geom_state->get_attrib(ta)) {
439 for (
int i = 0; i < num_stages; ++i) {
442 if (texture !=
nullptr) {
488calc_tight_bounds(LPoint3 &min_point, LPoint3 &max_point,
bool &found_any,
491 PandaNode::calc_tight_bounds(min_point, max_point, found_any, transform,
494 const LMatrix4 &mat = next_transform->get_mat();
496 CDReader cdata(_cycler, current_thread);
497 GeomList::const_iterator gi;
498 CPT(GeomList) geoms = cdata->get_geoms();
499 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
500 CPT(
Geom) geom = (*gi)._geom.get_read_pointer();
501 geom->calc_tight_bounds(min_point, max_point, found_any,
502 geom->get_animated_vertex_data(
true, current_thread),
503 !next_transform->is_identity(), mat,
507 return next_transform;
528 trav->_geom_nodes_pcollector.add_level(1);
530 if (pgraph_cat.is_spam()) {
532 <<
"Found " << *
this <<
" in state " << *data._state
533 <<
" draw_mask = " << data._draw_mask <<
"\n";
540 int num_geoms = geoms.get_num_geoms();
541 trav->_geoms_pcollector.add_level(num_geoms);
542 CPT(
TransformState) internal_transform = data.get_internal_transform(trav);
544 for (
int i = 0; i < num_geoms; i++) {
545 CPT(
Geom) geom = geoms.get_geom(i);
546 if (geom->is_empty()) {
550 CPT(
RenderState) state = data._state->compose(geoms.get_geom_state(i));
551 if (state->has_cull_callback() && !state->cull_callback(trav, data)) {
561 if (data._view_frustum !=
nullptr) {
563 CPT(
BoundingVolume) geom_volume = geom->get_bounds(current_thread);
567 int result = data._view_frustum->contains(geom_gbv);
568 if (result == BoundingVolume::IF_no_intersection) {
573 if (!data._cull_planes->is_empty()) {
575 CPT(
BoundingVolume) geom_volume = geom->get_bounds(current_thread);
579 data._cull_planes->do_cull(result, state, geom_gbv);
580 if (result == BoundingVolume::IF_no_intersection) {
588 new CullableObject(std::move(geom), std::move(state), internal_transform);
613 nassertv(geom !=
nullptr);
615 nassertv(state !=
nullptr);
618 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
619 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
621 cdata->modify_geoms()->push_back(
GeomEntry(geom, state));
623 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
625 mark_internal_bounds_stale();
635 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
636 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
637 CDStageReader cdata_other(other->_cycler, pipeline_stage, current_thread);
639 GeomList::const_iterator gi;
640 CPT(
GeomList) other_geoms = cdata_other->get_geoms();
641 PT(
GeomList) this_geoms = cdata->modify_geoms();
642 for (gi = other_geoms->begin(); gi != other_geoms->end(); ++gi) {
644 nassertv(entry._geom.get_read_pointer()->check_valid());
645 this_geoms->push_back(entry);
648 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
650 mark_internal_bounds_stale();
664 nassertv(geom !=
nullptr);
668 PT(
GeomList) geoms = cdata->modify_geoms();
669 nassertv(n >= 0 && n < (
int)geoms->size());
670 (*geoms)[n]._geom = geom;
672 mark_internal_bounds_stale();
683 for (
int i = 0; i < num_geoms; i++) {
684 const Geom *geom = get_geom(i);
706 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
707 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
709 GeomList::iterator gi;
710 PT(
GeomList) geoms = cdata->modify_geoms();
711 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
713 nassertv(entry._geom.test_ref_count_integrity());
714 PT(
Geom) geom = entry._geom.get_write_pointer();
715 geom->decompose_in_place();
718 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
740unify(
int max_indices,
bool preserve_order) {
741 bool any_changed =
false;
744 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
745 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
752 GeomList::const_iterator gi;
753 CPT(
GeomList) old_geoms = cdata->get_geoms();
754 for (gi = old_geoms->begin(); gi != old_geoms->end(); ++gi) {
757 bool unified =
false;
760 GeomList::reverse_iterator gj;
761 for (gj = new_geoms->rbegin(); gj != new_geoms->rend() && !unified; ++gj) {
763 if (old_entry._state == new_entry._state) {
765 CPT(
Geom) old_geom = old_entry._geom.get_read_pointer();
766 PT(
Geom) new_geom = new_entry._geom.get_write_pointer();
767 if (new_geom->copy_primitives_from(old_geom)) {
774 if (preserve_order) {
784 new_geoms->push_back(old_entry);
789 cdata->set_geoms(new_geoms);
792 GeomList::iterator wgi;
793 for (wgi = new_geoms->begin(); wgi != new_geoms->end(); ++wgi) {
795 nassertv(entry._geom.test_ref_count_integrity());
796 PT(
Geom) geom = entry._geom.get_write_pointer();
797 geom->unify_in_place(max_indices, preserve_order);
800 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
803 mark_internal_bounds_stale();
811write_geoms(std::ostream &out,
int indent_level)
const {
813 write(out, indent_level);
814 GeomList::const_iterator gi;
815 CPT(
GeomList) geoms = cdata->get_geoms();
816 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
818 indent(out, indent_level + 2)
819 << *entry._geom.get_read_pointer() <<
" " << *entry._state <<
"\n";
829 write(out, indent_level);
830 GeomList::const_iterator gi;
831 CPT(
GeomList) geoms = cdata->get_geoms();
832 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
834 CPT(
Geom) geom = entry._geom.get_read_pointer();
835 indent(out, indent_level + 2)
836 << *geom <<
" " << *entry._state <<
"\n";
837 geom->write(out, indent_level + 4);
845output(std::ostream &out)
const {
851 CDReader cdata(_cycler);
855 GeomList::const_iterator gi;
856 CPT(
RenderState) common = RenderState::make_empty();
858 CPT(GeomList) geoms = cdata->get_geoms();
859 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
860 const GeomEntry &entry = (*gi);
861 common = common->compose(entry._state);
864 PandaNode::output(out);
865 out <<
" (" << geoms->size() <<
" geoms";
867 if (!common->is_empty()) {
868 out <<
": " << *common;
897 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
898 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
900 GeomList::iterator gi;
901 PT(
GeomList) geoms = cdata->modify_geoms();
902 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
904 CPT(
RenderState) geom_state = node_state->compose(entry._state);
905 CPT(
Geom) geom = entry._geom.get_read_pointer();
906 PT(
GeomMunger) munger = gsg->get_geom_munger(geom_state, current_thread);
907 entry._geom = transformer.premunge_geom(geom, munger);
910 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
918r_mark_geom_bounds_stale(
Thread *current_thread) {
919 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
920 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
922 GeomList::iterator gi;
923 PT(GeomList) geoms = cdata->modify_geoms();
924 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
925 GeomEntry &entry = (*gi);
926 entry._geom.get_read_pointer()->mark_bounds_stale();
929 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
930 mark_internal_bounds_stale();
932 PandaNode::r_mark_geom_bounds_stale(current_thread);
942 int &internal_vertices,
944 Thread *current_thread)
const {
945 int num_vertices = 0;
947 CDLockedStageReader cdata(_cycler, pipeline_stage, current_thread);
953 GeomList::const_iterator gi;
954 CPT(GeomList) geoms = cdata->get_geoms();
955 child_volumes.reserve(geoms->size());
956 child_volumes_ref.reserve(geoms->size());
958 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
959 const GeomEntry &entry = (*gi);
960 CPT(
Geom) geom = entry._geom.get_read_pointer();
963 if (!volume->is_empty()) {
964 child_volumes.push_back(volume);
965 child_volumes_ref.push_back(volume);
966 if (!volume->is_exact_type(BoundingBox::get_class_type())) {
970 num_vertices += geom->get_nested_vertices();
976 if (btype == BoundingVolume::BT_default) {
980 if (btype == BoundingVolume::BT_box ||
981 (btype != BoundingVolume::BT_sphere && all_box)) {
990 if (child_volumes.size() > 0) {
992 const BoundingVolume **child_end = child_begin + child_volumes.size();
996 internal_bounds = gbv;
997 internal_vertices = num_vertices;
1035 CPT(
RenderAttrib) vertex_color = ColorAttrib::make_vertex();
1038 OPEN_ITERATE_CURRENT_AND_UPSTREAM(_cycler, current_thread) {
1039 CDStageWriter cdata(_cycler, pipeline_stage, current_thread);
1041 GeomList::iterator gi;
1042 PT(
GeomList) geoms = cdata->modify_geoms();
1043 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
1045 CPT(
Geom) geom = entry._geom.get_read_pointer();
1050 CPT(
GeomVertexData) vdata = geom->get_vertex_data(current_thread);
1052 for (
size_t i = 0; i < vformat->get_num_arrays(); ++i) {
1057 if (vdata->has_column(color) &&
1058 !entry._state->has_attrib(ColorAttrib::get_class_slot())) {
1062 aux_data->_hold_state = entry._state;
1065 entry._state = entry._state->add_attrib(vertex_color, -1);
1069 CLOSE_ITERATE_CURRENT_AND_UPSTREAM(_cycler);
1085 node->fillin(scan, manager);
1100 PandaNode::fillin(scan, manager);
1108CData(
const GeomNode::CData ©) :
1118 return new CData(*
this);
1125void GeomNode::CData::
1127 CPT(GeomList) geoms = _geoms.get_read_pointer();
1128 int num_geoms = geoms->size();
1129 nassertv(num_geoms == (
int)(uint16_t)num_geoms);
1132 GeomList::const_iterator gi;
1133 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
1134 const GeomEntry &entry = (*gi);
1144int GeomNode::CData::
1149 GeomList::iterator gi;
1150 PT(GeomList) geoms = _geoms.get_write_pointer();
1151 for (gi = geoms->begin(); gi != geoms->end(); ++gi) {
1152 GeomEntry &entry = (*gi);
1153 entry._geom = DCAST(
Geom, p_list[pi++]);
1164void GeomNode::CData::
1168 PT(GeomList) geoms =
new GeomList;
1169 geoms->reserve(num_geoms);
1170 for (
int i = 0; i < num_geoms; i++) {
1173 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.
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.
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.