using System.Collections.Generic; using ACE.DatLoader.Entity; namespace ACE.Server.Entity { /// /// Represents a polygon in local model space /// public class ModelPolygon { /// /// The list of vertices /// public List Vertices; /// /// The polygon in AC data formats /// public DatLoader.Entity.Polygon Polygon; /// /// Constructs a new polygon /// public ModelPolygon(DatLoader.Entity.Polygon polygon, CVertexArray vertexArray) { Polygon = polygon; LoadVertices(vertexArray); } /// /// Loads the vertices for a polygon /// public void LoadVertices(CVertexArray vertexArray) { Vertices = new List(); foreach (var id in Polygon.VertexIds) Vertices.Add(vertexArray.Vertices[(ushort)id]); } } }