OGRE-Next: Ogre::Polygon Class Reference

| OGRE-Next 3.0.0 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::Polygon Class Reference
Core » Math

The class represents a polygon in 3D space. More...

`#include <OgrePolygon.h>`

## Public Types
typedef std::pair< Vector3, Vector3 > | Edge
typedef StdMultiMap< Vector3, Vector3 > | EdgeMap
typedef vector< Vector3 >::type | VertexList

## Public Member Functions
| Polygon ()
| Polygon (const Polygon &cpy)
| ~Polygon ()
void | deleteVertex (size_t vertex)
| Deletes a specific vertex.
const Vector3 & | getNormal () const
| Returns the polygon normal.
const Vector3 & | getVertex (size_t vertex) const
| Returns a vertex.
size_t | getVertexCount () const
| Vertex count.
void | insertVertex (const Vector3 &vdata)
| Inserts a vertex at the end of the polygon.
void | insertVertex (const Vector3 &vdata, size_t vertexIndex)
| Inserts a vertex at a specific position.
bool | isPointInside (const Vector3 &point) const
| Determines if a point is inside the polygon.
bool | operator!= (const Polygon &rhs) const
| Determines if the current object is not equal to the compared one.
bool | operator== (const Polygon &rhs) const
| Determines if the current object is equal to the compared one.
void | removeDuplicates ()
| Removes duplicate vertices from a polygon.
void | reset ()
| Resets the object.
void | setVertex (const Vector3 &vdata, size_t vertexIndex)
| Sets a specific vertex of a polygon.
void | storeEdges (EdgeMap *edgeMap) const
| Stores the edges of the polygon in ccw order.

## Detailed Description

The class represents a polygon in 3D space.

Remarks
  It is made up of 3 or more vertices in a single plane, listed in counter-clockwise order.

## Member Typedef Documentation

## ◆ Edge

typedef std::pair<Vector3, Vector3> Ogre::Polygon::Edge

## ◆ EdgeMap

typedef StdMultiMap<Vector3, Vector3> Ogre::Polygon::EdgeMap

## ◆ VertexList

typedef vector<Vector3>::type Ogre::Polygon::VertexList

## Constructor & Destructor Documentation

## ◆ Polygon() [1/2]

Ogre::Polygon::Polygon | ( |  | ) |

Referenced by Polygon(), operator!=(), operator<<, and operator==().

## ◆ ~Polygon()

Ogre::Polygon::~Polygon | ( |  | ) |

## ◆ Polygon() [2/2]

Ogre::Polygon::Polygon | ( | const Polygon & | cpy | ) |

References Polygon().

## Member Function Documentation

## ◆ deleteVertex()

void Ogre::Polygon::deleteVertex | ( | size_t | vertex | ) |

Deletes a specific vertex.

## ◆ getNormal()

const Vector3 & Ogre::Polygon::getNormal | ( |  | ) | const

Returns the polygon normal.

## ◆ getVertex()

const Vector3 & Ogre::Polygon::getVertex | ( | size_t | vertex | ) | const

Returns a vertex.

## ◆ getVertexCount()

size_t Ogre::Polygon::getVertexCount | ( |  | ) | const

Vertex count.

## ◆ insertVertex() [1/2]

void Ogre::Polygon::insertVertex | ( | const Vector3 & | vdata | ) |

Inserts a vertex at the end of the polygon.

Note
  Vertices must be coplanar.

## ◆ insertVertex() [2/2]

void Ogre::Polygon::insertVertex | ( | const Vector3 & | vdata,
|  | size_t | vertexIndex )

Inserts a vertex at a specific position.

Note
  Vertices must be coplanar.

## ◆ isPointInside()

bool Ogre::Polygon::isPointInside | ( | const Vector3 & | point | ) | const

Determines if a point is inside the polygon.

Remarks
  A point is inside a polygon if it is both on the polygon's plane, and within the polygon's bounds. Polygons are assumed to be convex and planar.

## ◆ operator!=()

bool Ogre::Polygon::operator!= | ( | const Polygon & | rhs | ) | const
| inline

Determines if the current object is not equal to the compared one.

References Polygon().

## ◆ operator==()

bool Ogre::Polygon::operator== | ( | const Polygon & | rhs | ) | const

Determines if the current object is equal to the compared one.

References Polygon().

## ◆ removeDuplicates()

void Ogre::Polygon::removeDuplicates | ( |  | ) |

Removes duplicate vertices from a polygon.

## ◆ reset()

void Ogre::Polygon::reset | ( |  | ) |

Resets the object.

## ◆ setVertex()

void Ogre::Polygon::setVertex | ( | const Vector3 & | vdata,
|  | size_t | vertexIndex )

Sets a specific vertex of a polygon.

Note
  Vertices must be coplanar.

## ◆ storeEdges()

void Ogre::Polygon::storeEdges | ( | EdgeMap * | edgeMap | ) | const

Stores the edges of the polygon in ccw order.

The vertices are copied so the user has to take the deletion into account.

The documentation for this class was generated from the following file:

- OgrePolygon.h