15 #include "triangulator3.h" 48 int index = (int)_vertices3.size();
49 _vertices3.push_back(point);
65 if (_polygon.size() < 3) {
78 size_t num_verts = _polygon.size();
79 for (
size_t i = 0; i < num_verts; i++) {
81 int i1 = _polygon[(i + 1) % num_verts];;;;
82 nassertv(i0 >= 0 && i0 < (
int)_vertices3.size() &&
83 i1 >= 0 && i1 < (int)_vertices3.size());
86 normal[0] += p0[1] * p1[2] - p0[2] * p1[1];
87 normal[1] += p0[2] * p1[0] - p0[0] * p1[2];
88 normal[2] += p0[0] * p1[1] - p0[1] * p1[0];
98 _plane = LPlaned(normal, _vertices3[0]);
103 heads_up(mat, _vertices3[1] - _vertices3[2], normal, CS_zup_right);
108 for (
size_t i = 0; i < _vertices3.size(); i++) {
110 _vertices.push_back(
LPoint2d(p[0], p[1]));
This is a 4-by-4 transform matrix.
void triangulate()
Does the work of triangulating the specified polygon.
void clear()
Removes all vertices and polygon specifications from the Triangulator, and prepares it to start over...
This is a two-component point in space.
void triangulate()
Does the work of triangulating the specified polygon.
static const LVector3d & zero()
Returns a zero-length vector.
void set_row(int row, const LVecBase4d &v)
Replaces the indicated row of the matrix.
bool normalize()
Normalizes the vector in place.
int add_vertex(const LPoint3d &point)
Adds a new vertex to the vertex pool.
bool invert_in_place()
Inverts the current matrix.
void clear()
Removes all vertices and polygon specifications from the Triangulator, and prepares it to start over...
This is a three-component vector distance (as opposed to a three-component point, which represents a ...
This is a three-component point in space (as opposed to a three-component vector, which represents a ...