Panda3D

- Main Page
- Packages
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions

# EggPolygon Class Reference

A single polygon. More...

Inheritance diagram for EggPolygon:

List of all members.

## Public Member Functions
| EggPolygon (EggPolygon const copy)
| EggPolygon (string name)
| EggPolygon ()
bool | calculateNormal (Vec3D result, CoordinateSystem cs)
| Calculates the true polygon normal--the vector pointing out of the front of the polygon--based on the vertices.
bool | calculateNormal (Vec3D result)
| Calculates the true polygon normal--the vector pointing out of the front of the polygon--based on the vertices.
bool | isPlanar ()
| Returns true if all of the polygon's vertices lie within the same plane, false otherwise.
EggPolygon | operator= (EggPolygon const copy)
bool | recomputePolygonNormal ()
| Recalculates the normal according to the order of the vertices, and sets it.
bool | recomputePolygonNormal (CoordinateSystem cs)
| Recalculates the normal according to the order of the vertices, and sets it.
EggPolygon | triangulateInPlace (bool convex_also)
| Subdivides the polygon into triangles and adds those triangles to the parent group node in place of the original polygon.
bool | triangulateInto (EggGroupNode container, bool convex_also)
| Subdivides the polygon into triangles and adds each one to the indicated container.
## Static Public Member Functions
static TypeHandle | getClassType ()

## Detailed Description

A single polygon.

## Constructor & Destructor Documentation

EggPolygon | ( | EggPolygon const | copy | ) |

EggPolygon | ( | string | name | ) |

EggPolygon | ( |  | ) |

## Member Function Documentation

bool calculateNormal | ( | Vec3D | result,
|  | CoordinateSystem | cs
| ) |  |

Calculates the true polygon normal--the vector pointing out of the front of the polygon--based on the vertices.

This does not return or change the polygon's normal as set via set_normal().

The return value is true if the normal is computed correctly, or false if the polygon is degenerate and does not have at least three noncollinear vertices.

bool calculateNormal | ( | Vec3D | result | ) |

Calculates the true polygon normal--the vector pointing out of the front of the polygon--based on the vertices.

This does not return or change the polygon's normal as set via set_normal().

The return value is true if the normal is computed correctly, or false if the polygon is degenerate and does not have at least three noncollinear vertices.

static TypeHandle getClassType | ( |  | ) | `[static]`

Reimplemented from EggPrimitive.

bool isPlanar | ( |  | ) |

Returns true if all of the polygon's vertices lie within the same plane, false otherwise.

EggPolygon operator= | ( | EggPolygon const | copy | ) |

bool recomputePolygonNormal | ( | CoordinateSystem | cs | ) |

Recalculates the normal according to the order of the vertices, and sets it.

Returns true if the normal is computed correctly, or false if the polygon is degenerate and does not have a normal.

bool recomputePolygonNormal | ( |  | ) |

Recalculates the normal according to the order of the vertices, and sets it.

Returns true if the normal is computed correctly, or false if the polygon is degenerate and does not have a normal.

EggPolygon triangulateInPlace | ( | bool | convex_also | ) |

Subdivides the polygon into triangles and adds those triangles to the parent group node in place of the original polygon.

Returns a pointer to the original polygon, which is likely about to be destructed.

If convex_also is true, both concave and convex polygons will be subdivided into triangles; otherwise, only concave polygons will be subdivided, and convex polygons will be copied unchanged into the container.

bool triangulateInto | ( | EggGroupNode | container,
|  | bool | convex_also
| ) |  |

Subdivides the polygon into triangles and adds each one to the indicated container.

If the polygon is already a triangle, adds an exact copy of the polygon to the container. Does not remove the polygon from its existing parent or modify it in any way.

Returns true if the triangulation is successful, or false if there was some error (in which case the container may contain some partial triangulation).

If convex_also is true, both concave and convex polygons will be subdivided into triangles; otherwise, only concave polygons will be subdivided, and convex polygons will be copied unchanged into the container.

All Classes Namespaces Functions Variables Enumerations Enumerator Properties