40 if (node->
is_of_type(EggPrimitive::get_class_type())) {
43 render_state->fill_state(egg_prim);
52 get_bin_number(
const EggNode *node) {
53 if (node->
is_of_type(EggNurbsSurface::get_class_type())) {
54 return (
int)BN_nurbs_surface;
56 }
else if (node->
is_of_type(EggNurbsCurve::get_class_type())) {
57 return (
int)BN_nurbs_curve;
59 }
else if (node->
is_of_type(EggPatch::get_class_type())) {
60 return (
int)BN_patches;
62 }
else if (node->
is_of_type(EggPrimitive::get_class_type())) {
63 return (
int)BN_polyset;
65 }
else if (node->
is_of_type(EggGroup::get_class_type())) {
67 if (group->has_lod()) {
81 if (bin_number == BN_polyset || bin_number == BN_patches) {
98 DCAST_INTO_R(pa, a,
false);
99 DCAST_INTO_R(pb, b,
false);
103 DCAST_INTO_R(rsa, pa->
get_user_data(EggRenderState::get_class_type()),
false);
104 DCAST_INTO_R(rsb, pb->
get_user_data(EggRenderState::get_class_type()),
false);
107 return (compare < 0);
110 if (bin_number == BN_patches) {
113 DCAST_INTO_R(patch_a, a,
false);
114 DCAST_INTO_R(patch_b, b,
false);
115 if (patch_a->size() != patch_b->size()) {
116 return patch_a->size() < patch_b->size();
140 return (swda._center.compare_to(swdb._center) < 0);
143 case BN_nurbs_surface:
A base class for any of a number of kinds of geometry primitives: polygons, point lights,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool sorts_less(int bin_number, const EggNode *a, const EggNode *b)
May be overridden in derived classes to create additional bins within a particular bin number,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual std::string get_bin_name(int bin_number, const EggNode *child)
May be overridden in derived classes to define a name for each new bin, based on its bin number,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is used within this package only to record the render state that should be assigned to eac...
The main glue of the egg hierarchy, this corresponds to the <Group>, <Instance>, and <Joint> type nod...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A single "patch", a special primitive to be rendered only with a tessellation shader.
EggUserData * get_user_data() const
Returns the user data pointer most recently stored on this object, or NULL if nothing was previously ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void set_user_data(EggUserData *user_data)
Sets the user data associated with this object.
virtual void prepare_node(EggNode *node)
May be overridden in derived classes to perform some setup work as each node is encountered.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A base class for things that may be directly added into the egg hierarchy.
get_sort_name
Returns the name of the primitive for the purposes of sorting primitives into different groups,...
bool is_of_type(TypeHandle handle) const
Returns true if the current object is or derives from the indicated type.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This corresponds to a <SwitchCondition> entry within a group.
A SwitchCondition that switches the levels-of-detail based on distance from the camera's eyepoint.
Converts an egg data structure, possibly read from an egg file but not necessarily,...
int compare_to(const EggRenderState &other) const
Provides a unique ordering for different EggRenderState objects, so that primitives of similar state ...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.