summaryrefslogtreecommitdiff
path: root/src/csgterm.cc
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2011-10-04 19:06:40 (GMT)
committerMarius Kintel <marius@kintel.net>2011-10-04 19:06:40 (GMT)
commit799ca1d1b3f2e9142460ab3ce895a0641f54dfda (patch)
tree6c168de6d55cb92b94b0ddeb54c668bd4946c10d /src/csgterm.cc
parent9259d57659f61e9e56942bb36125f605f8f3c338 (diff)
parentf5e0f3a531b0c8806e4ebc62cd91ca31275ae481 (diff)
Merge branch 'master' into visitortests
Conflicts: src/polyset.h
Diffstat (limited to 'src/csgterm.cc')
-rw-r--r--src/csgterm.cc12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/csgterm.cc b/src/csgterm.cc
index 5bccff8..0f56b82 100644
--- a/src/csgterm.cc
+++ b/src/csgterm.cc
@@ -47,10 +47,10 @@
*/
-CSGTerm::CSGTerm(const shared_ptr<PolySet> &polyset, const double matrix[16], const double color[4], const std::string &label)
+CSGTerm::CSGTerm(const shared_ptr<PolySet> &polyset, const Transform3d &matrix, const double color[4], const std::string &label)
: type(TYPE_PRIMITIVE), polyset(polyset), label(label), left(NULL), right(NULL)
{
- for (int i = 0; i < 16; i++) this->m[i] = matrix[i];
+ this->m = matrix;
for (int i = 0; i < 4; i++) this->color[i] = color[i];
refcounter = 1;
}
@@ -188,7 +188,7 @@ CSGChain::CSGChain()
{
}
-void CSGChain::add(const shared_ptr<PolySet> &polyset, double *m, double *color, CSGTerm::type_e type, std::string label)
+void CSGChain::add(const shared_ptr<PolySet> &polyset, const Transform3d &m, double *color, CSGTerm::type_e type, std::string label)
{
polysets.push_back(polyset);
matrices.push_back(m);
@@ -256,11 +256,7 @@ BoundingBox CSGChain::getBoundingBox() const
if (!psbox.isNull()) {
Eigen::Transform3d t;
// Column-major vs. Row-major
- t.matrix() <<
- matrices[i][0], matrices[i][4], matrices[i][8], matrices[i][12],
- matrices[i][1], matrices[i][5], matrices[i][9], matrices[i][13],
- matrices[i][2], matrices[i][6], matrices[i][10], matrices[i][14],
- matrices[i][3], matrices[i][7], matrices[i][11], matrices[i][15];
+ t = matrices[i];
bbox.extend(t * psbox.min());
bbox.extend(t * psbox.max());
}
contact: Jan Huwald // Impressum