/// <summary> /// Init the hull if Vertices.Length == Dimension. /// </summary> void InitSingle() { var vertices = new int[Dimension]; for (int i = 0; i < Vertices.Length; i++) { vertices[i] = i; ConvexHull.Add(i); } var newFace = FacePool[ObjectManager.GetFace()]; newFace.Vertices = vertices; Array.Sort(vertices); MathHelper.CalculateFacePlane(newFace, Center); // Make sure the normal point downwards in case this is used for triangulation if (newFace.Normal[Dimension - 1] >= 0.0) { for (int i = 0; i < Dimension; i++) { newFace.Normal[i] *= -1.0; } newFace.Offset = -newFace.Offset; newFace.IsNormalFlipped = !newFace.IsNormalFlipped; } ConvexFaces.Add(newFace.Index); }
void InitSmall() { for (int i = 0; i < Vertices.Length; i++) { ConvexHull.Add(i); } }