Exemplo n.º 1
0
 public Face(Face f)
 {
     normal = f.normal;
     center = f.center;
     blocks = new List<Block>();
     doodads = new List<Doodad>();
     monsters = new List<Monster>();
     vertices = new Vector3[f.vertices.Length];
     for (int i = 0; i < f.vertices.Length; i++)
     {
         vertices[i] = f.vertices[i];
     }
     foreach (Monster m in f.monsters)
     {
         monsters.Add(new Monster(m));
     }
     foreach (Doodad d in f.doodads)
     {
         doodads.Add(new Doodad(d));
     }
     foreach (Block b in f.blocks)
     {
         blocks.Add(new Block(b));
     }
 }
Exemplo n.º 2
0
 public Room(Room r)
 {
     id = r.id;
     name = r.name;
     centerX = r.centerX;
     centerY = r.centerY;
     centerZ = r.centerZ;
     sizeX = r.sizeX;
     sizeY = r.sizeY;
     sizeZ = r.sizeZ;
     color = r.color;
     faceList = new Face[6];
     for (int i = 0; i < 6; i++)
     {
         faceList[i] = new Face(r.faceList[i]);
     }
 }
Exemplo n.º 3
0
        public Room()
        {
            name = "Room";
            id = IDControl.GetID();
            centerX = 0;
            centerY = 0;
            centerZ = 0;
            sizeX = 10;
            sizeY = 10;
            sizeZ = 10;
            color = Color.GreenYellow;

            faceList = new Face[6];
            faceList[0] = new Face(new Vector3(1, 0, 0), new Vector3[]{
                new Vector3(centerX + sizeX / 2, centerY - sizeY / 2, centerZ - sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY - sizeY/2, centerZ+sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY + sizeZ/2, centerZ+sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY + sizeZ/2, centerZ-sizeZ/2),});
            faceList[1] = new Face(new Vector3(-1, 0, 0), new Vector3[]{
                new Vector3(centerX - sizeX / 2, centerY - sizeY / 2, centerZ - sizeZ/2),
                new Vector3(centerX - sizeX / 2, centerY - sizeY/2, centerZ+sizeZ/2),
                new Vector3(centerX - sizeX / 2, centerY + sizeZ/2, centerZ+sizeZ/2),
                new Vector3(centerX - sizeX / 2, centerY + sizeZ/2, centerZ-sizeZ/2),});
            faceList[2] = new Face(new Vector3(0, 1, 0), new Vector3[]{
                new Vector3(centerX - sizeX / 2, centerY + sizeY / 2, centerZ - sizeZ/2),
                new Vector3(centerX - sizeX / 2, centerY + sizeY/2, centerZ+sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY + sizeZ/2, centerZ+sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY + sizeZ/2, centerZ-sizeZ/2),});
            faceList[3] = new Face(new Vector3(0, -1, 0), new Vector3[]{
                new Vector3(centerX - sizeX / 2, centerY - sizeY / 2, centerZ - sizeZ/2),
                new Vector3(centerX - sizeX / 2, centerY - sizeY/2, centerZ+sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY - sizeZ/2, centerZ+sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY - sizeZ/2, centerZ-sizeZ/2),});
            faceList[4] = new Face(new Vector3(0, 0, 1), new Vector3[]{
                new Vector3(centerX - sizeX / 2, centerY - sizeY / 2, centerZ + sizeZ/2),
                new Vector3(centerX - sizeX / 2, centerY + sizeY/2, centerZ+sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY + sizeZ/2, centerZ+sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY - sizeZ/2, centerZ+sizeZ/2),});
            faceList[5] = new Face(new Vector3(0, 0, -1), new Vector3[]{
                new Vector3(centerX - sizeX / 2, centerY - sizeY / 2, centerZ - sizeZ/2),
                new Vector3(centerX - sizeX / 2, centerY + sizeY/2, centerZ-sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY + sizeZ/2, centerZ-sizeZ/2),
                new Vector3(centerX + sizeX / 2, centerY - sizeZ/2, centerZ-sizeZ/2),});
        }