Fixed an libligl AABB assignment operator: memory aligned structures

shall not be passed as "by value" parameters. This is explicitely
warned against in the Eigen manual:
https://eigen.tuxfamily.org/dox/group__TopicPassingByValue.html
This commit is contained in:
bubnikv 2018-11-26 15:57:58 +01:00
parent 52c9dd3252
commit f55ddbb1e3

View File

@ -68,10 +68,13 @@ public:
//swap(first.m_low_sqr_d,second.m_low_sqr_d);
//swap(first.m_depth,second.m_depth);
}
// Pass-by-value (aka copy)
AABB& operator=(AABB other)
AABB& operator=(const AABB &other)
{
swap(*this,other);
this->deinit();
m_left = other.m_left ? new AABB(*other.m_left) : NULL;
m_right = other.m_right ? new AABB(*other.m_right) : NULL;
m_box = other.m_box;
m_primitive = other.m_primitive;
return *this;
}
AABB(AABB&& other):