27 return _polygons.size();
35 nassertr(n >= 0 && n < (
int)_polygons.size(),
nullptr);
53 _polygon_type = lin->
get_id();
57 int num_vertices = nf & PF_numverts_mask;
60 poly->_flags = nf & ~PF_numverts_mask;
61 poly->_surface_index = -1;
63 for (
int i = 0; i < num_vertices; i++) {
64 int vindex = lin->
get_vx();
65 poly->_vertices.push_back(vindex);
68 _polygons.push_back(poly);
74 _polygon_type =
IffId(
"FACE");
83 for (
int i = 0; i < num_vertices; i++) {
84 int vindex = lin->
get_vx();
85 poly->_vertices.push_back(vindex);
93 poly->_flags |= PF_decal;
103 poly->_surface_index = surface - 1;
105 _polygons.push_back(poly);
116 write(std::ostream &out,
int indent_level)
const {
118 <<
get_id() <<
" { polygon_type = " << _polygon_type
119 <<
", " << _polygons.size() <<
" polygons }\n";
int get_num_polygons() const
Returns the number of polygons of this group.
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.
Polygon * get_polygon(int n) const
Returns the nth polygon of this group.
TypeHandle is the identifier used to differentiate C++ class types.
A four-byte chunk ID appearing in an "IFF" file.
IffId get_id() const
Returns the ID associated with this chunk.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.