A 3D polygon. More...
#include <frz_obj3d.hpp>
Public Member Functions | |
| Poly (int _a=-1, int _b=-1, int _c=-1, int _d=-1, int _color=0xffffff) | |
| Constructor. | |
| bool | operator== (const Poly &p) |
| Compares two polygons. | |
| void | write (std::ostream &out) |
| Writes a polygon into an output stream. | |
| void | read (std::istream &in) |
| Reads a polygon from an input stream. | |
Public Attributes | |
| union { | |
| struct { | |
| int a | |
| First vertex index. | |
| int b | |
| Second vertex index. | |
| int c | |
| Third vertex index. | |
| int d | |
| Fourth vertex index. | |
| } | |
| int v [4] | |
| An array containing the vertex indices. | |
| }; | |
| uint32_t | color |
| The color for the polygon. | |
| bool | triangle |
| An indicator containing true if the polygon is a triangle, and false if it is a quad. | |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const Poly &q) |
| Displays a polygon in human-readable fashion. | |
A 3D polygon.
A Poly object either stores a triangle or a quad. The polygon is defined by a list of indices in an object's vertex list.
| Frz::Object3d::Poly::Poly | ( | int | _a = -1, |
|
| int | _b = -1, |
|||
| int | _c = -1, |
|||
| int | _d = -1, |
|||
| int | _color = 0xffffff | |||
| ) |
Constructor.
| _a | First vertex index | |
| _b | Second vertex index | |
| _c | Third vertex index | |
| _d | Fourth vertex index (set to -1 if the poly is a triangle) | |
| _color | Polygon color in ARGB binary format |
| bool Frz::Object3d::Poly::operator== | ( | const Poly & | p | ) | [inline] |
Compares two polygons.
All possible rotations are tested for equality comparison.
| void Frz::Object3d::Poly::read | ( | std::istream & | in | ) | [inline] |
Reads a polygon from an input stream.
| in | a reference to the input stream |
| void Frz::Object3d::Poly::write | ( | std::ostream & | out | ) | [inline] |
Writes a polygon into an output stream.
| out | a reference to the output stream |
| std::ostream& operator<< | ( | std::ostream & | out, | |
| const Poly & | q | |||
| ) | [friend] |
Displays a polygon in human-readable fashion.
| out | a reference to the output stream | |
| q | a reference to the polygon to be displayed |
1.6.3