Changing the internal representation of Point / Pointf / Point3 / Pointf3 to Eigen Matrix types, first step

This commit is contained in:
bubnikv 2018-08-14 18:33:26 +02:00
parent 077680b806
commit 86da661097
60 changed files with 1228 additions and 1206 deletions

View file

@ -120,7 +120,7 @@ public:
}
inline void push_geometry(const Pointf3& p, const Vectorf3& n) {
push_geometry(p.x, p.y, p.z, n.x, n.y, n.z);
push_geometry(p.x(), p.y(), p.z(), n.x(), n.y(), n.z());
}
inline void push_triangle(int idx1, int idx2, int idx3) {
@ -176,17 +176,17 @@ public:
BoundingBoxf3 bbox;
if (! this->vertices_and_normals_interleaved.empty()) {
bbox.defined = true;
bbox.min.x = bbox.max.x = this->vertices_and_normals_interleaved[3];
bbox.min.y = bbox.max.y = this->vertices_and_normals_interleaved[4];
bbox.min.z = bbox.max.z = this->vertices_and_normals_interleaved[5];
bbox.min.x() = bbox.max.x() = this->vertices_and_normals_interleaved[3];
bbox.min.y() = bbox.max.y() = this->vertices_and_normals_interleaved[4];
bbox.min.z() = bbox.max.z() = this->vertices_and_normals_interleaved[5];
for (size_t i = 9; i < this->vertices_and_normals_interleaved.size(); i += 6) {
const float *verts = this->vertices_and_normals_interleaved.data() + i;
bbox.min.x = std::min<coordf_t>(bbox.min.x, verts[0]);
bbox.min.y = std::min<coordf_t>(bbox.min.y, verts[1]);
bbox.min.z = std::min<coordf_t>(bbox.min.z, verts[2]);
bbox.max.x = std::max<coordf_t>(bbox.max.x, verts[0]);
bbox.max.y = std::max<coordf_t>(bbox.max.y, verts[1]);
bbox.max.z = std::max<coordf_t>(bbox.max.z, verts[2]);
bbox.min.x() = std::min<coordf_t>(bbox.min.x(), verts[0]);
bbox.min.y() = std::min<coordf_t>(bbox.min.y(), verts[1]);
bbox.min.z() = std::min<coordf_t>(bbox.min.z(), verts[2]);
bbox.max.x() = std::max<coordf_t>(bbox.max.x(), verts[0]);
bbox.max.y() = std::max<coordf_t>(bbox.max.y(), verts[1]);
bbox.max.z() = std::max<coordf_t>(bbox.max.z(), verts[2]);
}
}
return bbox;