Change logic for calculating whether there was an intersection
This commit is contained in:
parent
1d7d66a1de
commit
af308cb187
@ -56,14 +56,14 @@ namespace PolyVox
|
||||
|
||||
edge.fraction = static_cast<float>(vA - threshold) / static_cast<float>(vA - vB);
|
||||
|
||||
if(edge.fraction > 1.0 || edge.fraction < 0.0)
|
||||
if(std::min(vA,vB) <= threshold && std::max(vA,vB) > threshold)
|
||||
{
|
||||
edge.intersects = false;
|
||||
return edge;
|
||||
edge.intersects = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
edge.intersects = true;
|
||||
edge.intersects = false;
|
||||
return edge;
|
||||
}
|
||||
|
||||
edge.normal = (gA * edge.fraction + gB * (1.0f-edge.fraction));
|
||||
|
Loading…
x
Reference in New Issue
Block a user