예제 #1
0
        public static Polygon Get(DatLoader.Entity.Polygon p, CVertexArray v)
        {
            var polygon = new Polygon(p, v);

            if (!Enabled)
            {
                return(polygon);
            }

            return(Get(polygon));
        }
예제 #2
0
파일: GfxObj.cs 프로젝트: PyrealMote/ACE
        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);
        }
예제 #3
0
 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();
 }
예제 #4
0
        /// <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();
        }
예제 #5
0
 /// <summary>
 /// Constructs a new polygon
 /// </summary>
 public ModelPolygon(DatLoader.Entity.Polygon polygon, CVertexArray vertexArray)
 {
     Polygon = polygon;
     LoadVertices(vertexArray);
 }
예제 #6
0
 public static Polygon Get(DatLoader.Entity.Polygon p, CVertexArray v)
 {
     return(Get(new Polygon(p, v)));
 }