コード例 #1
0
        public static AABBSide GetOppositeSide(AABBSide side)
        {
            switch (side)
            {
            case AABBSide.enTop:
                return(AABBSide.enBottom);

            case AABBSide.enBottom:
                return(AABBSide.enTop);

            case AABBSide.enLeft:
                return(AABBSide.enRight);

            case AABBSide.enRight:
                return(AABBSide.enLeft);
            }
            //Should never get here.
            throw new Exception("Side does not have an opposite!");
        }
コード例 #2
0
ファイル: AABB.cs プロジェクト: Nimgoble/CollisionTests
 public static AABBSide GetOppositeSide(AABBSide side)
 {
     switch (side)
     {
         case AABBSide.enTop:
             return AABBSide.enBottom;
         case AABBSide.enBottom:
             return AABBSide.enTop;
         case AABBSide.enLeft:
             return AABBSide.enRight;
         case AABBSide.enRight:
             return AABBSide.enLeft;
     }
     //Should never get here.
     throw new Exception("Side does not have an opposite!");
 }