Пример #1
0
        /// <summary>
        /// Crea una caja en base al punto minimo y maximo, con el color especificado
        /// </summary>
        /// <param name="pMin">Punto mínimo</param>
        /// <param name="pMax">Punto máximo</param>
        /// <param name="texture">Textura de la caja</param>
        /// <returns>Caja creada</returns>
        public static TgcBox fromExtremes(Vector3 pMin, Vector3 pMax, TgcTexture texture)
        {
            TgcBox box = TgcBox.fromExtremes(pMin, pMax);

            box.setTexture(texture);
            return(box);
        }
Пример #2
0
        /// <summary>
        /// Crea una caja con el centro y tamaño especificado, con la textura especificada
        /// </summary>
        /// <param name="center">Centro de la caja</param>
        /// <param name="size">Tamaño de la caja</param>
        /// <param name="texture">Textura de la caja</param>
        /// <returns>Caja creada</returns>
        public static TgcBox fromSize(Vector3 center, Vector3 size, TgcTexture texture)
        {
            TgcBox box = TgcBox.fromSize(center, size);

            box.setTexture(texture);
            return(box);
        }
Пример #3
0
        public EscenarioManager()
        {
            EscenarioManager.Instance = this;

            sonido = SoundManager.getInstance();
            arboles = new List<TgcMesh>();
            pasto = new List<TgcMesh>();
            barriles = new List<Barril>();
            loader = new TgcSceneLoader();

            casillasPorEje = 50;
            divisionesPiso = new Vector3[2500];
            _random = new Random();

            piso = new TgcBox();
            piso.UVTiling = new Vector2(300, 300);
            pisoSize = (int) tamanio;
            piso.setPositionSize(new Vector3(0, 0, 0), new Vector3(pisoSize*2, 0, pisoSize*2));
            piso.updateValues();

            piso.setTexture(TgcTexture.createTexture(GuiController.Instance.D3dDevice, GuiController.Instance.AlumnoEjemplosMediaDir + "\\RenderMan\\texturas\\nieve.png"));

            generarSkyBox();

            colisionables = new List<TgcBoundingCylinder>();

            limites = new TgcBoundingBox(new Vector3(-tamanio, 0, -tamanio), new Vector3(tamanio, 5000, tamanio));

            GuiController.Instance.Modifiers.addInt("Viento en X", 0, 30, 5);
            GuiController.Instance.Modifiers.addInt("Viento en Z", 0, 30, 5);
        }
        public Cuadro(Vector3 ubicacion, Vector3 tamanio)
        {
            Vector3 center = ubicacion;
            Vector3 size = tamanio;
            TgcTexture texture = TgcTexture.createTexture(GuiController.Instance.AlumnoEjemplosMediaDir + "Textures\\palermoFranchescoli.jpg");

            box = TgcBox.fromSize(center, size);

            box.setTexture(texture);
        }
Пример #5
0
        /// <summary>
        /// Crear un nuevo TgcBox igual a este
        /// </summary>
        /// <returns>Box clonado</returns>
        public TgcBox clone()
        {
            TgcBox cloneBox = new TgcBox();

            cloneBox.setPositionSize(this.translation, this.size);
            cloneBox.color = this.color;
            if (this.texture != null)
            {
                cloneBox.setTexture(this.texture.clone());
            }
            cloneBox.autoTransformEnable = this.autoTransformEnable;
            cloneBox.transform           = this.transform;
            cloneBox.rotation            = this.rotation;
            cloneBox.alphaBlendEnable    = this.alphaBlendEnable;
            cloneBox.uvOffset            = this.uvOffset;
            cloneBox.uvTiling            = this.uvTiling;

            cloneBox.updateValues();
            return(cloneBox);
        }
Пример #6
0
        public Humo(Vector3 position)
        {
            a = 255f;
            box1 = new TgcBox();
            box1.UVTiling = new Vector2(1, 1);
            box1.setPositionSize(position, new Vector3(200, 0, 200));
            box1.setTexture(getTexture());
            box1.AlphaBlendEnable = true;
            box1.updateValues();

            box2 = new TgcBox();
            box2.UVTiling = new Vector2(1, 1);
            box2.setPositionSize(position, new Vector3(200, 0, 200));
            box2.setTexture(getTexture());
            box2.AlphaBlendEnable = true;
            box2.updateValues();

            box3 = new TgcBox();
            box3.UVTiling = new Vector2(1, 1);
            box3.setPositionSize(position, new Vector3(200, 0, 200));
            box3.setTexture(getTexture());
            box3.AlphaBlendEnable = true;
            box3.updateValues();
        }
Пример #7
0
        /// <summary>
        /// Crear un nuevo TgcBox igual a este
        /// </summary>
        /// <returns>Box clonado</returns>
        public TgcBox clone()
        {
            TgcBox cloneBox = new TgcBox();
            cloneBox.setPositionSize(this.translation, this.size);
            cloneBox.color = this.color;
            if (this.texture != null)
            {
                cloneBox.setTexture(this.texture.clone());
            }
            cloneBox.autoTransformEnable = this.autoTransformEnable;
            cloneBox.transform = this.transform;
            cloneBox.rotation = this.rotation;
            cloneBox.alphaBlendEnable = this.alphaBlendEnable;
            cloneBox.uvOffset = this.uvOffset;
            cloneBox.uvTiling = this.uvTiling;

            cloneBox.updateValues();
            return cloneBox;
        }
 private void changeBoxTexure(Device d3dDevice, TgcBox box, string texturePath)
 {
     TgcTexture t = TgcTexture.createTexture(d3dDevice, texturePath);
     box.setTexture(t);
 }