public static void ClampRotationZ(TgcMesh rotando)
 {
     if (rotando.Rotation.Z > (FastMath.PI * 2))
     {
         rotando.RotateZ(-(FastMath.PI * 2));
     }
     if (rotando.Rotation.Z < 0)
     {
         rotando.RotateZ((FastMath.PI * 2));
     }
 }
        public Girasol(TGCVector3 posicion, GameLogic logica, Plataforma plataforma)
        {
            base.Init(logica, plataforma);

            #region configurarObjeto

            float factorEscalado = 30.0f;
            girasol          = new TgcSceneLoader().loadSceneFromFile(GameModel.mediaDir + "modelos\\Girasol-TgcScene.xml").Meshes[0];
            girasol.Scale    = new TGCVector3(factorEscalado, factorEscalado, factorEscalado);
            girasol.Position = new TGCVector3(posicion.X - 8, posicion.Y + 35, posicion.Z - 10);
            girasol.RotateX(60);
            girasol.RotateY(90);
            girasol.RotateZ(90);
            girasol.Effect    = efecto;
            girasol.Technique = "RenderScene";

            tallo           = new TgcSceneLoader().loadSceneFromFile(GameModel.mediaDir + "modelos\\PlantaFinal-TgcScene.xml").Meshes[0];
            tallo.Scale     = new TGCVector3(factorEscalado * 0.5f, factorEscalado * 0.5f, factorEscalado * 0.5f);
            tallo.Position  = new TGCVector3(posicion.X, posicion.Y - 50, posicion.Z);  // new TGCVector3(500f, 200f, 1500f);
            tallo.Effect    = efecto;
            tallo.Technique = "RenderScene";

            #endregion

            #region manejarTiempo
            time           = new Timer(INTERVALO);
            time.Elapsed  += OnTimedEvent;
            time.AutoReset = true;
            time.Enabled   = true;
            #endregion

            PostProcess.agregarPostProcessObject(this);
        }
        public Nuez(TGCVector3 posicion, GameLogic logica, Plataforma plataforma)
        {
            base.Init(logica, plataforma);

            #region configurarObjeto

            float factorEscalado = 160.0f;

            nuez          = new TgcSceneLoader().loadSceneFromFile(GameModel.mediaDir + "modelos\\nuez-TgcScene.xml").Meshes[0];
            nuez.Scale    = new TGCVector3(factorEscalado * 0.5f, factorEscalado * 0.5f, factorEscalado * 0.5f);
            nuez.Position = new TGCVector3(posicion.X, posicion.Y + 60, posicion.Z + 5);
            nuez.RotateZ(1.5f);
            nuez.RotateY(90);
            nuez.Effect    = efecto;
            nuez.Technique = "RenderScene";

            #endregion

            nivelResistencia = 10000;
            PostProcess.agregarPostProcessObject(this);
        }
        public ParedFondo(GameLogic logica, Play play)
        {
            #region configurarEfecto
            efecto = TgcShaders.loadEffect(GameModel.shadersDir + "shaderPlanta.fx");
            #endregion

            #region configurarObjeto
            tag           = new TgcSceneLoader().loadSceneFromFile(GameModel.mediaDir + "modelos\\Tag-TgcScene.xml").Meshes[0];
            tag.Scale     = new TGCVector3(500, 500, 500);
            tag.Effect    = efecto;
            tag.Technique = "RenderScene";
            tag.Position  = new TGCVector3(100f, 340f, -3300f);
            tag.RotateZ(90.1f);

            objetos.Add(tag);

            body     = FactoryBody.crearBodyPared(new TGCVector3(4000, 5, 1), new TGCVector3(0f, 215f, -3300f));
            callback = new CollisionCallbackFinal(logica, play);
            logica.addBulletObject(this);
            #endregion

            PostProcess.agregarPostProcessObject(this);
        }
        public Pared(GameLogic logica, float x)
        {
            #region configurarEfecto
            efecto = TgcShaders.loadEffect(GameModel.shadersDir + "shaderPlanta.fx");
            #endregion

            #region configurarObjeto
            tag           = new TgcSceneLoader().loadSceneFromFile(GameModel.mediaDir + "modelos\\Tag-TgcScene.xml").Meshes[0];
            tag.Scale     = new TGCVector3(100, 100, 100);
            tag.Effect    = efecto;
            tag.Technique = "RenderScene";
            tag.Position  = new TGCVector3(x, 440f, -3300f);
            tag.RotateZ(90.1f);

            objetos.Add(tag);

            //x = -850, -150, 550, 1250
            body     = FactoryBody.crearBodyPared(new TGCVector3(150, 50, 50), new TGCVector3(x, 215f, -3300));//new TGCVector3(320, 5, 3300), new TGCVector3(x, 215f, 0));
            callback = new CollisionCallbackWall(logica);
            logica.addBulletObject(this);
            #endregion

            PostProcess.agregarPostProcessObject(this);
        }
 public override void Update()
 {
     rotador += 0.01f;
     tag.RotateZ(rotador);
 }