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:
parent
52c9dd3252
commit
f55ddbb1e3
1 changed files with 6 additions and 3 deletions
|
@ -68,10 +68,13 @@ public:
|
||||||
//swap(first.m_low_sqr_d,second.m_low_sqr_d);
|
//swap(first.m_low_sqr_d,second.m_low_sqr_d);
|
||||||
//swap(first.m_depth,second.m_depth);
|
//swap(first.m_depth,second.m_depth);
|
||||||
}
|
}
|
||||||
// Pass-by-value (aka copy)
|
AABB& operator=(const AABB &other)
|
||||||
AABB& operator=(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;
|
return *this;
|
||||||
}
|
}
|
||||||
AABB(AABB&& other):
|
AABB(AABB&& other):
|
||||||
|
|
Loading…
Reference in a new issue