24class EXPCL_PANDA_EGG EggPolygon :
public EggPrimitive {
26 INLINE
explicit EggPolygon(
const std::string &name =
"");
27 INLINE EggPolygon(
const EggPolygon ©);
28 INLINE EggPolygon &operator = (
const EggPolygon ©);
30 virtual EggPolygon *
make_copy()
const override;
32 virtual bool cleanup()
override;
34 bool calculate_normal(LNormald &result, CoordinateSystem cs = CS_default)
const;
39 INLINE
bool triangulate_into(EggGroupNode *container,
bool convex_also)
const;
40 PT(EggPolygon) triangulate_in_place(
bool convex_also);
42 virtual void write(std::ostream &out,
int indent_level)
const override;
45 bool decomp_concave(EggGroupNode *container,
int asum,
int x,
int y)
const;
46 bool triangulate_poly(EggGroupNode *container,
bool convex_also);
53 static void init_type() {
54 EggPrimitive::init_type();
56 EggPrimitive::get_class_type());
59 return get_class_type();
61 virtual TypeHandle force_init_type()
override {
63 return get_class_type();
bool is_planar() const
Returns true if all of the polygon's vertices lie within the same plane, false otherwise.
bool calculate_normal(LNormald &result, CoordinateSystem cs=CS_default) const
Calculates the true polygon normal–the vector pointing out of the front of the polygon–based on the v...
virtual void write(std::ostream &out, int indent_level) const override
Writes the polygon to the indicated output stream in Egg format.
virtual EggPolygon * make_copy() const override
Makes a copy of this object.
bool triangulate_into(EggGroupNode *container, bool convex_also) const
Subdivides the polygon into triangles and adds each one to the indicated container.
bool recompute_polygon_normal(CoordinateSystem cs=CS_default)
Recalculates the normal according to the order of the vertices, and sets it.
virtual bool cleanup()
Cleans up modeling errors in whatever context this makes sense.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...