Fix computing contact point in edge-edge case in cg::separation
This commit is contained in:
parent
663f7bc5f4
commit
bede9c95f9
1 changed files with 1 additions and 1 deletions
|
|
@ -226,7 +226,7 @@ namespace psemek::cg
|
|||
auto m = geom::cross(result.direction, vs2[e2[1]] - vs2[e2[0]]);
|
||||
auto v = geom::dot(geom::homogeneous(vs2[e2[0]]), geom::homogeneous(m));
|
||||
auto t = (v - geom::dot(geom::homogeneous(vs1[e1[0]]), geom::homogeneous(m))) / geom::dot(geom::homogeneous(vs1[e1[1]] - vs1[e1[0]]), geom::homogeneous(m));
|
||||
result.contact_point = geom::lerp(vs1[e1[0]], vs1[e2[1]], geom::clamp(t, geom::interval(scalar_type(0), scalar_type(1))));
|
||||
result.contact_point = geom::lerp(vs1[e1[0]], vs1[e1[1]], geom::clamp(t, geom::interval(scalar_type(0), scalar_type(1))));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue