32 for (oi = _objects.begin(); oi != _objects.end(); ++oi) {
44 return new CullBinFixed(name, gsg, draw_region_pcollector);
52 int draw_order =
object->_state->get_draw_order();
53 _objects.push_back(ObjectData(
object, draw_order));
63 PStatTimer timer(_cull_this_pcollector, current_thread);
64 std::stable_sort(_objects.begin(), _objects.end());
72 PStatTimer timer(_draw_this_pcollector, current_thread);
74 Objects::const_iterator oi;
75 for (oi = _objects.begin(); oi != _objects.end(); ++oi) {
78 if (object->_draw_callback ==
nullptr) {
79 nassertd(object->_geom !=
nullptr)
continue;
81 _gsg->set_state_and_transform(object->_state, object->_internal_transform);
85 data_reader.check_array_readers();
86 geom_reader.
draw(_gsg, &data_reader, force);
89 object->draw_callback(_gsg, force, current_thread);
100fill_result_graph(CullBin::ResultGraphBuilder &builder) {
101 Objects::const_iterator oi;
102 for (oi = _objects.begin(); oi != _objects.end(); ++oi) {
104 builder.add_object(
object);
A specific kind of CullBin that sorts geometry in the order specified by the user-specified draw_orde...
virtual void add_object(CullableObject *object, Thread *current_thread)
Adds a geom, along with its associated state, to the bin for rendering.
virtual void finish_cull(SceneSetup *scene_setup, Thread *current_thread)
Called after all the geoms have been added, this indicates that the cull process is finished for this...
static CullBin * make_bin(const std::string &name, GraphicsStateGuardianBase *gsg, const PStatCollector &draw_region_pcollector)
Factory constructor for passing to the CullBinManager.
virtual void draw(bool force, Thread *current_thread)
Draws all the geoms in the bin, in the appropriate order.
A collection of Geoms and their associated state, for a particular scene.
The smallest atom of cull.
Encapsulates the data from a Geom, pre-fetched for one stage of the pipeline.
bool draw(GraphicsStateGuardianBase *gsg, const GeomVertexDataPipelineReader *data_reader, bool force) const
The implementation of Geom::draw().
Encapsulates the data from a GeomVertexData, pre-fetched for one stage of the pipeline.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
A lightweight class that represents a single element that may be timed and/or counted via stats.
A lightweight class that can be used to automatically start and stop a PStatCollector around a sectio...
This object holds the camera position, etc., and other general setup information for rendering a part...
A thread; that is, a lightweight process.
TypeHandle is the identifier used to differentiate C++ class types.
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.