Example #1
0
        private static bool IsOnCutSide(BumperEntityPoly bumpRef, RopeEntityPoly ropeEntityPoly,
                                        List <List <BumperEntityPoly> > groups)
        {
            var posRope = ropeEntityPoly.PositionXNACenter2D;
            var posBump = bumpRef.PositionXNACenter2D;

            foreach (List <BumperEntityPoly> group in groups)
            {
                if (posRope.X < posBump.X)
                {
                    if (bumpRef == group[group.Count - 1])
                    {
                        return(true);
                    }
                }
                else
                {
                    if (bumpRef == group[0])
                    {
                        return(true);
                    }
                }
            }
            return(false);
        }
Example #2
0
        private static BumperEntityPoly FindCutSideBumper(BumperEntityPoly bumpRef, RopeEntityPoly ropeEntityPoly,
                                                          List <List <BumperEntityPoly> > groups)
        {
            var posRope = ropeEntityPoly.PositionXNACenter2D;
            var posBump = bumpRef.PositionXNACenter2D;

            foreach (List <BumperEntityPoly> group in groups)
            {
                if (group.Contains(bumpRef))
                {
                    if (posRope.X < posBump.X)
                    {
                        return(group[group.Count - 1]);
                    }
                    else
                    {
                        return(group[0]);
                    }
                }
            }
            return(null);
        }