示例#1
0
        public void loadEnviroment(float elapsedTime)
        {
            totalTime += elapsedTime;
            if (oceanMovimientoLateral < 100000)
            {
                oceanPosition.Z = oceanPosition.Z + 0.001f;
                oceanMovimientoLateral++;
            }
            else if (oceanMovimientoLateral < 200000 && oceanMovimientoLateral >= 100000)
            {
                oceanPosition.Z = oceanPosition.Z - 0.001f;
                oceanMovimientoLateral++;
            }
            else if (oceanMovimientoLateral == 200000)
            {
                oceanMovimientoLateral = 0;
            }


            ocean.Position = oceanPosition;
            ocean.setVerticesY(TgcEditableLand.SELECTION_CENTER, (float)Math.Cos(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_INTERIOR_RING, (float)Math.Sin(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_EXTERIOR_RING, (float)Math.Sin(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_TOP_SIDE, (float)Math.Sin(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_LEFT_SIDE, (float)Math.Sin(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_RIGHT_SIDE, (float)Math.Sin(totalTime));
            ocean.setVerticesY(TgcEditableLand.SELECTION_BOTTOM_SIDE, (float)Math.Sin(totalTime));
            ocean.updateValues();
            sun.rotateX(0.00001f);
            skyBox.Radius   = (int)GuiController.Instance.Modifiers["skyRadius"];
            skyBox.Position = (Vector3)GuiController.Instance.Modifiers["skyPosition"];
            //oceanPosition = (Vector3)GuiController.Instance.Modifiers["oceanPosition"];

            ocean.render();
            sun.render();
            skyBox.render();
        }