35 _properties = properties;
42 get_bin_number(
const EggNode *node) {
43 if (node->
is_of_type(EggPolygon::get_class_type())) {
44 return (
int)BN_polyset;
56 nassertr((BinNumber)bin_number == BN_polyset,
false);
61 if ((_properties & (P_has_texture | P_texture)) != 0) {
64 if (a_has_texture != b_has_texture) {
65 return ((
int)a_has_texture < (int)b_has_texture);
68 if ((_properties & (P_texture)) != 0) {
70 for (
int i = 0; i < num_textures; i++) {
73 if (a_texture != b_texture) {
74 return (a_texture->
sorts_less_than(*b_texture, ~EggTexture::E_tref_name));
81 if ((_properties & (P_has_material | P_material)) != 0) {
86 if ((_properties & (P_material)) != 0) {
91 if ((_properties & (P_has_poly_color)) != 0) {
92 if (pa->has_color() != pb->has_color()) {
93 return ((
int)pa->has_color() < (
int)pb->has_color());
96 if ((_properties & (P_poly_color)) != 0) {
101 if ((_properties & (P_has_poly_normal)) != 0) {
102 if (pa->has_normal() != pb->has_normal()) {
103 return ((
int)pa->has_normal() < (
int)pb->has_normal());
106 if ((_properties & (P_has_vertex_normal)) != 0) {
109 if (pa_has_normal != pb_has_normal) {
110 return ((
int)pa_has_normal < (
int)pb_has_normal);
113 if ((_properties & (P_has_vertex_color)) != 0) {
116 if (pa_has_color != pb_has_color) {
117 return ((
int)pa_has_color < (
int)pb_has_color);
120 if ((_properties & (P_bface)) != 0) {
LColor get_color() const
Returns the color set on this particular attribute.
A base class for things that may be directly added into the egg hierarchy.
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,...
void set_properties(int properties)
Sets the set of properties that determines which polygons are allowed to be grouped together into a s...
get_material
Returns a pointer to the applied material, or NULL if there is no material applied.
bool has_vertex_normal() const
Returns true if any vertex on the primitive has a specific normal set, false otherwise.
get_bface_flag
Retrieves the backfacing flag of the polygon.
get_num_textures
Returns the number of textures applied to the primitive.
bool has_vertex_color() const
Returns true if any vertex on the primitive has a specific color set, false otherwise.
get_texture
Returns the first texture on the primitive, if any, or NULL if there are no textures on the primitive...
has_material
Returns true if the primitive is materiald (and get_material() will return a real pointer),...
Defines a texture map that may be applied to geometry.
bool sorts_less_than(const EggTexture &other, int eq) const
An ordering operator to compare two textures for sorting order.
TypeHandle is the identifier used to differentiate C++ class types.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.