Exemple #1
0
        public WindowedWall(Point3D from, Point3D to, double bottom, double height, Window window) : base(from, to, bottom, height)
        {
            this.ventana = window;
            Point3D dir = (to - from).Normalized;

            ventana.Angle = GlUtils.VectorAngle2D(dir);
            double  dist = (to - from).Norm;
            Point3D d    = dir.Scaled((dist - ventana.Width) / 2);

            izq         = new SolidWall(from, from + d, bottom, height);
            der         = new SolidWall(to - d, to, bottom, height);
            up          = new SolidWall(from + d.Scaled(.9), to - d.Scaled(.9), bottom, windowBase);
            down        = new SolidWall(from + d.Scaled(.9), to - d.Scaled(.9), windowBase + this.ventana.Height, (height - windowBase - ventana.Height));
            izq.after   = to;
            up.after    = to;
            down.after  = to;
            der.before  = from;
            up.before   = from;
            down.before = from;
            Point3D wstart = from + d;

            this.ventana.Location = new Point3D(wstart.X, windowBase, wstart.Z);
            izq.CloseTo(false);
            der.CloseFrom(false);
            up.CloseFrom(false);
            up.CloseTo(false);
            down.CloseFrom(false);
            down.CloseTo(false);
        }
        public static Wall BuildWall(Point3D from, Point3D to, double bottom, double height, string type)
        {
            Wall res;

            switch (type)
            {
            case "glass":
                res = new GlassWall(from, to, bottom, height);
                break;

            case "windowed":
                res = new WindowedWall(from, to, bottom, height);
                break;

            case "woden":
                res = new WindowedWall(from, to, bottom, height, new WodenWindow());
                break;

            case "woden glass":
                res = new WindowedWall(from, to, bottom, height, new WindowArray(new WodenWindow(), new GlassWindow()));
                break;

            case "woden glass woden":
                res = new WindowedWall(from, to, bottom, height, new WindowArray(new WodenWindow(), new GlassWindow(), new WodenWindow()));
                break;

            case "glass woden":
                res = new WindowedWall(from, to, bottom, height, new WindowArray(new GlassWindow(), new WodenWindow()));
                break;

            case "woden woden":
                res = new WindowedWall(from, to, bottom, height, new WindowArray(new WodenWindow(), new WodenWindow()));
                break;

            case "door":
                res = new DoorWall(from, to, bottom, height);
                break;

            case "reversed door":
                res = new DoorWall(from, to, bottom, height, false, true, true);
                break;

            case "closed door":
                res = new DoorWall(from, to, bottom, height, false, false, false);
                break;

            case "closed reversed door":
                res = new DoorWall(from, to, bottom, height, false, true, false);
                break;

            case "passage":
                res = new DoorWall(from, to, bottom, height, true, false, true);
                break;

            default:
                res = new SolidWall(from, to, bottom, height);
                break;
            }
            return(res);
        }
Exemple #3
0
        public GlassWall(Point3D from, Point3D to, double bottom, double height) : base(from, to, bottom, height)
        {
            divTexture = GlUtils.Texture("WOOD1");
            double len = (to - from).Norm;

            this.glasshStep = len / Math.Floor(len / glasshStep);
            baseHeight      = height - glassvStep * Math.Floor(height / glassvStep);
            if (baseHeight < glassvStep)
            {
                baseHeight += glassvStep;
            }
            muro = new SolidWall(from, to, bottom, baseHeight);
            muro.CloseUp(true);
            cristalId = Gl.glGenLists(1);
            Gl.glNewList(cristalId, Gl.GL_COMPILE);
            pintaCristal();
            Gl.glEndList();
        }
Exemple #4
0
        public DoorWall(Point3D from, Point3D to, double bottom, double height, bool soloMarco, bool reversed, bool opened) : base(from, to, bottom, height)
        {
            Point3D dir = (to - from);

            puerta          = new Puerta();
            puerta.Angle    = GlUtils.VectorAngle2D(dir);
            puerta.reversed = reversed;
            if (opened)
            {
                puerta.Apertura = 85;
            }
            else
            {
                puerta.Apertura = 0;
            }

            //puerta.Width = dir.Norm;
            double dist = dir.Norm;

            if (dist <= puerta.Width)
            {
                puerta.Location = from;
                puerta.Width    = dist;
            }
            else
            {
                Point3D d = dir.Normalized.Scaled((dist - puerta.Width) / 2);
                left            = new SolidWall(from, from + d, bottom, bottom + puerta.Height * 1.1);
                right           = new SolidWall(to - d, to, bottom, bottom + puerta.Height * 1.1);
                left.after      = to;
                right.before    = from;
                puerta.Location = from + d;
            }
            up = new SolidWall(from, to, puerta.Height, height - puerta.Height);
            puerta.SoloMarco = soloMarco;
        }