Пример #1
0
 public QHullTrianglePlanePoints(Vector3 a, Vector3 b, Vector3 c)
 {
     mPointsList      = new List <Vector3>();
     mTrianglePlane   = new QHullTrianglePlane(a, b, c);
     mFathestPoint    = Vector3.zero;
     mFathestDistance = -1e20f;
     mIsDelete        = false;
 }
Пример #2
0
        public List <Vector3> GetTriangles()
        {
            List <Vector3> points        = new List <Vector3>();
            int            triangleCount = mTrianglePlanePoints.Count;

            for (int i = 0; i < triangleCount; ++i)
            {
                QHullTrianglePlane plane = mTrianglePlanePoints[i].mTrianglePlane;
                points.AddRange(plane.mVertexPoints);
            }
            return(points);
        }
Пример #3
0
        private void CalcHullVertexes()
        {
            int            triangleCount = mTrianglePlanePoints.Count;
            List <Vector3> vertes        = new List <Vector3>();
            List <int>     indices       = new List <int>();

            for (int i = 0; i < triangleCount; ++i)
            {
                QHullTrianglePlane plane = mTrianglePlanePoints[i].mTrianglePlane;
                for (int j = 0; j < 3; ++j)
                {
                    int index = vertes.FindIndex(delegate(Vector3 v) { return(v == plane.mVertexPoints[j]); });
                    if (index == -1)
                    {
                        indices.Add(vertes.Count);
                        vertes.Add(plane.mVertexPoints[j]);
                    }
                    else
                    {
                        indices.Add(index);
                    }
                }
            }
        }