From 365b5f5d48bc7db431808eff8bb6c1ae3d5155bc Mon Sep 17 00:00:00 2001 From: Thomas Krijnen Date: Mon, 7 Apr 2014 17:59:20 +0000 Subject: [PATCH] Fix product's 4x4 matrix on the IfcGeomServer --- src/ifcgeomserver/IfcGeomServer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ifcgeomserver/IfcGeomServer.cpp b/src/ifcgeomserver/IfcGeomServer.cpp index 37bb6965e2..125b2e9c66 100644 --- a/src/ifcgeomserver/IfcGeomServer.cpp +++ b/src/ifcgeomserver/IfcGeomServer.cpp @@ -195,7 +195,14 @@ protected: swrite(s, geom->name()); swrite(s, geom->type()); swrite(s, geom->parent_id()); - swrite(s, std::string((char*)geom->matrix().data(), 16 * sizeof(float))); + const std::vector& m = geom->matrix(); + const float matrix_array[16] = { + m[0], m[3], m[6], m[ 9], + m[1], m[4], m[7], m[10], + m[2], m[5], m[8], m[11], + 0, 0, 0, 1 + }; + swrite(s, std::string((char*)matrix_array, 16 * sizeof(float))); swrite(s, geom->mesh().id()); swrite(s, std::string((char*)geom->mesh().verts().data(), geom->mesh().verts().size() * sizeof(float))); swrite(s, std::string((char*)geom->mesh().normals().data(), geom->mesh().normals().size() * sizeof(float)));