Use model-offset in IfcGeom::Kernel and add model-rotation

This commit is contained in:
blocovin
2020-01-31 15:55:04 +01:00
committed by Thomas Krijnen
parent 76e7205692
commit 6e2038c1f5
9 changed files with 97 additions and 47 deletions
-5
View File
@@ -212,11 +212,6 @@ void ColladaSerializer::ColladaExporter::ColladaScene::add(
{ (double)posmatrix[2], (double)posmatrix[5], (double)posmatrix[8], (double)posmatrix[11] },
{ 0, 0, 0, 1 }
};
/// @todo: TFK: Rather than applying this offset to all leafs (which might be undesirable) should this offset be applied to a node higher up in the hierarchy?
matrix_array[0][3] += serializer->settings().offset[0];
matrix_array[1][3] += serializer->settings().offset[1];
matrix_array[2][3] += serializer->settings().offset[2];
delete relative_trsf;
+1 -7
View File
@@ -55,13 +55,7 @@ public:
};
SerializerSettings()
: precision(DEFAULT_PRECISION)
{
memset(offset, 0, sizeof(offset));
}
/// Optional offset that is applied to serialized objects, (0,0,0) by default.
double offset[3];
: precision(DEFAULT_PRECISION) { }
/// Sets the precision used to format floating-point values, 15 by default.
/// Use a negative value to use the system's default precision (should be 6 typically).
+3 -3
View File
@@ -93,9 +93,9 @@ void WaveFrontOBJSerializer::write(const IfcGeom::TriangulationElement<real_t>*
const int vcount = (int)mesh.verts().size() / 3;
for ( std::vector<real_t>::const_iterator it = mesh.verts().begin(); it != mesh.verts().end(); ) {
const real_t x = *(it++) + (real_t)settings().offset[0];
const real_t y = *(it++) + (real_t)settings().offset[1];
const real_t z = *(it++) + (real_t)settings().offset[2];
const real_t x = *(it++);
const real_t y = *(it++);
const real_t z = *(it++);
obj_stream << "v " << x << " " << y << " " << z << "\n";
}