예제 #1
0
파일: Sol.cs 프로젝트: aniPerezG/barbalpha
        public Sol(Effect efecto)
        {
            posicionSol = new Vector3(0, 1000, 1000);
            sol = new TgcSphere();
            sol.setColor(Color.Yellow);
            sol.Radius = 100;
            sol.BasePoly = TgcSphere.eBasePoly.CUBE;
            sol.Position = posicionSol;
            effect = efecto;
            //sol.Effect = efecto;
            //sol.Technique = "LightTechnique";
            sol.updateValues();

            CameraPos = GuiController.Instance.CurrentCamera.getPosition();
        }
예제 #2
0
파일: Gota.cs 프로젝트: aniPerezG/barbalpha
        public Gota(Vector3 posicion, float anchoGota, float altoGota, Lluvia tremendaLluvia) 
        {
            posicion_inicial = posicion;


            gotita = new TgcSphere();
            gotita.BasePoly = TgcSphere.eBasePoly.CUBE;
            gotita.Radius =  anchoGota / 2;
            gotita.Inflate = false;
            gotita.setColor(Color.AliceBlue);
            gotita.updateValues();

            velocidad_caida.Y = -generador.Next(20);

            lluvia = tremendaLluvia;
        }
예제 #3
0
        public Bala(Vector3 pos, float anguloRotacion, float anguloElevacion, Canion canion, bool soyPlayer, float velBala, float g)
        {
            bullet = new TgcSphere();
            bullet.setColor(Color.Black);
            bullet.Radius = RADIO;
            bullet.Position = pos;
            posicion = pos;
            bullet.LevelOfDetail = 1;
            this.anguloRotacion = anguloRotacion;
            this.anguloElevacion = anguloElevacion;
            this.speed = velBala;
            this.verticalAcceleration = g;
            bullet.updateValues();
            bullet.AutoTransformEnable = false;
            this.canion = canion;
            canion.agregarBalaEnElAire(this);

            sombra = new TgcSphere(RADIO, Color.Black, new Vector3(pos.X, EjemploAlumno.Instance.alturaOla(pos), pos.Z));
            sombra.updateValues();
            sombra.AutoTransformEnable = false;
            sombra.Effect = EjemploAlumno.Instance.efectoSombra;
            sombra.Technique = "SombraBala";
            //sombra.AlphaBlendEnable = true;

            salpicadura = new TgcCylinder(pos, RADIO, 10);
            salpicadura.Color = Color.White;
            salpicadura.UseTexture = true;
            salpicadura.setTexture(TgcTexture.createTexture(GuiController.Instance.AlumnoEjemplosMediaDir + "4141-diffuse.jpg"));//"el-agua-cae-textura-del-fondo-11558332.jpg"));
            salpicadura.updateValues();
            salpicadura.AutoTransformEnable = false;
            salpicadura.Effect = TgcShaders.loadEffect(GuiController.Instance.AlumnoEjemplosMediaDir + "shader agua.fx");
            salpicadura.Technique = "SalpicaduraBala";

            this.soyPlayer = soyPlayer;

            verticalSpeed = speed * (float)Math.Sin(anguloElevacion);
        }
예제 #4
0
        public Misil(Barco barcoDuenio, Barco barcoEnemigo)
        {
            //habria que inyectarlo por parametro
            Microsoft.DirectX.Direct3D.Device d3dDevice = GuiController.Instance.D3dDevice;

            TgcSceneLoader loader = new TgcSceneLoader();
            //TgcScene escena = loader.loadSceneFromFile(GuiController.Instance.ExamplesMediaDir + "MeshCreator\\Meshes\\Objetos\\BarrilPolvora\\BarrilPolvora-TgcScene.xml");
            //this.mesh = escena.Meshes[0];

            mesh = new TgcSphere();
            mesh.BasePoly = TgcSphere.eBasePoly.CUBE;
            mesh.setColor(Color.Black);
            mesh.Radius = 10;
            mesh.Position = new Vector3(0, 2, 0);
            mesh.Inflate = true;
            mesh.LevelOfDetail = 4;
            mesh.updateValues();

            string texturePath = (string)GuiController.Instance.AlumnoEjemplosMediaDir + "\\Textures\\metalOscuro.jpg";
            mesh.setTexture(TgcTexture.createTexture(d3dDevice, texturePath));

            this.barco = barcoDuenio;
            this.enemigo = barcoEnemigo;
        }