Commit 175bc9ea authored by Joseph Mirabel's avatar Joseph Mirabel Committed by Joseph Mirabel
Browse files

Minor optimizations

parent c65ce967
......@@ -562,7 +562,7 @@ bool OBB::overlap(const OBB& other) const
bool OBB::contain(const Vec3f& p) const
{
Vec3f local_p = p - To;
Vec3f local_p (p - To);
FCL_REAL proj = local_p.dot(axes.col(0));
if((proj > extent[0]) || (proj < -extent[0]))
return false;
......@@ -581,7 +581,7 @@ bool OBB::contain(const Vec3f& p) const
OBB& OBB::operator += (const Vec3f& p)
{
OBB bvp;
bvp.To.noalias() = p;
bvp.To = p;
bvp.axes.noalias() = axes;
bvp.extent.setZero();
......
......@@ -183,7 +183,7 @@ bool overlap(const Matrix3f& R0, const Vec3f& T0, const kIOS& b1, const kIOS& b2
b2_temp.obb.To = R0 * b2_temp.obb.To + T0;
b2_temp.obb.axes = R0 * b2_temp.obb.axes;
b2_temp.obb.axes.applyOnTheLeft(R0);
return b1.overlap(b2_temp);
}
......
......@@ -890,7 +890,8 @@ void BVHModel<OBB>::makeParentRelativeRecurse(int bv_id, Matrix3f& parent_axes,
}
// make self parent relative
obb.axes = parent_axes.transpose() * obb.axes;
// obb.axes = parent_axes.transpose() * obb.axes;
obb.axes.applyOnTheLeft(parent_axes.transpose());
Vec3f t (obb.To - parent_c);
obb.To.noalias() = parent_axes.transpose() * t;
......@@ -908,7 +909,8 @@ void BVHModel<RSS>::makeParentRelativeRecurse(int bv_id, Matrix3f& parent_axes,
}
// make self parent relative
rss.axes = parent_axes.transpose() * rss.axes;
// rss.axes = parent_axes.transpose() * rss.axes;
rss.axes.applyOnTheLeft(parent_axes.transpose());
Vec3f t (rss.Tr - parent_c);
rss.Tr.noalias() = parent_axes.transpose() * t;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment