Example #1
0
        static public bool PointHide(Point3DF point, List <Object> World)
        {
            Line LinePoint = new Line(point, new Point3DF(0, 0, 0), true);

            for (int NumObj = 0; NumObj < World.Count; NumObj++)
            {
                for (int NumPoligon = 0; NumPoligon < World[NumObj].Poligons.Count; NumPoligon++)
                {
                    double[] ABCD = Poligon.ABCDFound(World[NumObj].Poligons[NumPoligon], true);
                    double   t    = Line.PeresechPoint(ABCD, LinePoint);
                    if (Math.Round(t, 5) <= 0 || t > 1)
                    {
                        continue;
                    }
                    else
                    {
                        Point3DF PointPeresch = Line.PointF(LinePoint, t);
                        if (Poligon.InArea(World[NumObj].Poligons[NumPoligon], PointPeresch))
                        {
                            return(false);
                        }
                    }
                }
            }
            m1 :;
            return(true);
        }
Example #2
0
        static public object[] LuchPointF(Line luch, List <Object> World)
        {
            double Lambda  = -1;
            bool   First   = true;
            int    numobjr = 0;
            int    numpolr = 0;

            for (int numobj = 0; numobj < World.Count; numobj++)
            {
                for (int numpol = 0; numpol < World[numobj].Poligons.Count; numpol++)
                {
                    double[] ABCD = Poligon.ABCDFound(World[numobj].Poligons[numpol], true);
                    double   L    = Line.PeresechPoint(ABCD, luch);
                    if (L > 0 && Poligon.InArea(World[numobj].Poligons[numpol], Line.PointF(luch, L)))
                    {
                        if (First)
                        {
                            First   = false;
                            numobjr = numobj;
                            numpolr = numpol;
                            Lambda  = L;
                        }
                        else if (L > 0)
                        {
                            if (Lambda >= L)
                            {
                                numobjr = numobj;
                                numpolr = numpol;
                            }
                            Lambda = Math.Min(Lambda, L);
                        }
                    }
                }
            }
            return(new object[3] {
                Lambda, numobjr, numpolr
            });
        }