geometry: handle collisions of null shapes

This commit is contained in:
Tomasz Wlostowski 2020-09-01 22:05:18 +02:00
parent fc58c4a20e
commit eb6e1c4f90
1 changed files with 20 additions and 0 deletions

View File

@ -452,6 +452,8 @@ static bool collideSingleShapes( const SHAPE* aA, const SHAPE* aB, int aClearanc
switch( aA->Type() )
{
case SH_NULL:
return false;
case SH_RECT:
switch( aB->Type() )
{
@ -473,6 +475,9 @@ static bool collideSingleShapes( const SHAPE* aA, const SHAPE* aB, int aClearanc
case SH_ARC:
return CollCaseReversed<SHAPE_RECT, SHAPE_ARC>( aA, aB, aClearance, aActual, aMTV );
case SH_NULL:
return false;
default:
break;
}
@ -498,6 +503,9 @@ static bool collideSingleShapes( const SHAPE* aA, const SHAPE* aB, int aClearanc
case SH_ARC:
return CollCaseReversed<SHAPE_CIRCLE, SHAPE_ARC>( aA, aB, aClearance, aActual, aMTV );
case SH_NULL:
return false;
default:
break;
@ -525,6 +533,9 @@ static bool collideSingleShapes( const SHAPE* aA, const SHAPE* aB, int aClearanc
case SH_ARC:
return CollCaseReversed<SHAPE_LINE_CHAIN, SHAPE_ARC>( aA, aB, aClearance, aActual, aMTV );
case SH_NULL:
return false;
default:
break;
}
@ -551,6 +562,9 @@ static bool collideSingleShapes( const SHAPE* aA, const SHAPE* aB, int aClearanc
case SH_ARC:
return CollCaseReversed<SHAPE_SEGMENT, SHAPE_ARC>( aA, aB, aClearance, aActual, aMTV );
case SH_NULL:
return false;
default:
break;
}
@ -577,6 +591,9 @@ static bool collideSingleShapes( const SHAPE* aA, const SHAPE* aB, int aClearanc
case SH_ARC:
return CollCaseReversed<SHAPE_SIMPLE, SHAPE_ARC>( aA, aB, aClearance, aActual, aMTV );
case SH_NULL:
return false;
default:
break;
}
@ -603,6 +620,9 @@ static bool collideSingleShapes( const SHAPE* aA, const SHAPE* aB, int aClearanc
case SH_ARC:
return CollCase<SHAPE_ARC, SHAPE_ARC>( aA, aB, aClearance, aActual, aMTV );
case SH_NULL:
return false;
default:
break;
}