public static Polygon Get(DatLoader.Entity.Polygon p, CVertexArray v) { var polygon = new Polygon(p, v); if (!Enabled) { return(polygon); } return(Get(polygon)); }
public static Polygon CreateMutable(DatLoader.Entity.Polygon _polygon) { var polygon = new Polygon(); // clone lists? polygon.NegSurface = _polygon.NegSurface; polygon.NegUVIndices = _polygon.NegUVIndices; polygon.NumPoints = _polygon.NumPts; polygon.PosSurface = _polygon.PosSurface; polygon.PosUVIndices = _polygon.PosUVIndices; polygon.SidesType = (CullMode)_polygon.SidesType; polygon.Stippling = _polygon.Stippling; polygon.VertexIDs = _polygon.VertexIds; // build vertices return(polygon); }
public Polygon(DatLoader.Entity.Polygon polygon, DatLoader.Entity.CVertexArray vertexArray) { NegSurface = polygon.NegSurface; NegUVIndices = polygon.NegUVIndices; NumPoints = polygon.NumPts; PosSurface = polygon.PosSurface; PosUVIndices = polygon.PosUVIndices; SidesType = (CullMode)polygon.SidesType; Stippling = polygon.Stippling; VertexIDs = polygon.VertexIds; Vertices = new List <Vertex>(); foreach (var vertexIdx in VertexIDs) { Vertices.Add(new Vertex(vertexArray.Vertices[(ushort)vertexIdx])); } make_plane(); }
/// <summary> /// Constructs a polygon from the DAT file /// </summary> public Polygon(DatLoader.Entity.Polygon polygon, DatLoader.Entity.CVertexArray vertexArray) { NegSurface = polygon.NegSurface; //NegUVIndices = polygon.NegUVIndices; PosSurface = polygon.PosSurface; //PosUVIndices = polygon.PosUVIndices; SidesType = polygon.SidesType; Stippling = polygon.Stippling; VertexIDs = polygon.VertexIds; Vertices = new List <Vertex>(); foreach (var vertexIdx in VertexIDs) { Vertices.Add(VertexCache.Get(vertexArray.Vertices[(ushort)vertexIdx])); } make_plane(); }
/// <summary> /// Constructs a new polygon /// </summary> public ModelPolygon(DatLoader.Entity.Polygon polygon, CVertexArray vertexArray) { Polygon = polygon; LoadVertices(vertexArray); }
public static Polygon Get(DatLoader.Entity.Polygon p, CVertexArray v) { return(Get(new Polygon(p, v))); }