Example #1
0
 /// <summary>  
 /// Video manager lets you add a video and play and stop and such  
 /// </summary>  
 /// <param name="content">pass in content from game1.cs class</param>  
 /// <param name="videoFileLocation">full string file path</param>  
 /// <param name="Crop">take off time from the end of the vid, if the vid is 13 secs and you put 3 here you get the first 10 seconds of your video</param>  
 /// <param name="Position">position to play video, using 0,0 as origin</param>  
 /// <param name="Scale">scale of the video</param>  
 /// <param name="Loop">bool to tell weather or not to loop the video</param>  
 public RVideoManager(string videoFileLocation, double Crop, R2DVECTOR Position, R2DVECTOR Size, bool Loop)
 {
     video = REngine.Instance._game.Content.Load<Video>(videoFileLocation);
     loop = Loop;
     scale = Size.vector;
     position = Position.vector;
     crop = Crop;
     //vidPlayer = new VideoPlayer();
 }
Example #2
0
 public void Init(int Size, float TextureScale, R2DVECTOR WaveDirection)
 {
     //ocean.Width = Size;
     //ocean.Height = Size;
     //ocean.TextureScale = TextureScale;
     //ocean.BumpMapSpeed = WaveDirection.vector;
     //ocean.Scale = new Vector3(Scale, 1.0f, Scale);
     //ocean.LoadContent();
     water.Initialize();
     water.LoadContent();
 }
Example #3
0
 public void SetParam(string ParamName, R2DVECTOR[] values)
 {
     Vector2[] q = new Vector2[values.Length];
     int index = 0;
     foreach (R2DVECTOR rm in values)
     {
         q[index] = rm.vector;
     }
     effect.Parameters[ParamName].SetValue(q);
     q = null;
 }
Example #4
0
 public void SetParam(string ParamName, R2DVECTOR value)
 {
     effect.Parameters[ParamName].SetValue(value.vector);
 }
Example #5
0
        public void Draw_TextureFont(RFONT font, int X, int Y, string Message, R4DVECTOR color, float Rotation, R2DVECTOR RotationOrigin, R2DVECTOR Scale)
        {
            Color c = new Color(color.vector);

            try
            {
                _instance._spritebatch.Begin();
                _instance._spritebatch.DrawString(font._spriteFont, Message, new Vector2(X, Y), c, Rotation, RotationOrigin.vector, Scale.vector, SpriteEffects.None, 0);
                _instance._spritebatch.End();

            }
            catch (Exception e)
            {
                Console.WriteLine(e.ToString());
                REngine.Instance.AddToLog(e.ToString());
            }
        }
Example #6
0
        public override void Update()
        {
            int X,Y,Wheel;
            bool b1,b2,b3;
            #if !XBOX
            input.GetCenteredMouse(out X, out Y, out Wheel, out b1, out b2, out b3);
            R2DVECTOR mouseMoved = new R2DVECTOR(lastMouseLocation.X - X, lastMouseLocation.Y - Y);
            lastMouseLocation = new R2DVECTOR(X, Y);
            //camera.RotateFirstPerson(X * 0.1f, Y * 0.1f);
            camera.RotateFlight(X*0.1f, Y*0.1f, 0);
            //camera.LevelRoll();

            if (input.IsKeyDown(CONST_REACTOR_KEY.A) && !input.IsKeyDown(CONST_REACTOR_KEY.LeftShift))
            {
                camera.Move(-0.001f * Reactor.AccurateTimeElapsed(), 0f, 0f);
                //camera.RotateY(0.005f * Reactor.AccurateTimeElapsed());
            }
            if (input.IsKeyDown(CONST_REACTOR_KEY.D) && !input.IsKeyDown(CONST_REACTOR_KEY.LeftShift))
            {
                camera.Move(0.001f * Reactor.AccurateTimeElapsed(), 0f, 0f);
                //camera.RotateY(-0.005f * Reactor.AccurateTimeElapsed());
            }
            if (input.IsKeyDown(CONST_REACTOR_KEY.W) && !input.IsKeyDown(CONST_REACTOR_KEY.LeftShift))
            {
                camera.Move(0f, 0f, 0.001f * Reactor.AccurateTimeElapsed());
                //camera.Position = new R3DVECTOR(camera.Position.X, landscape.GetTerrainHeight(camera.Position.X, camera.Position.Z)+2f, camera.Position.Z);

            }
            if (input.IsKeyDown(CONST_REACTOR_KEY.S) && !input.IsKeyDown(CONST_REACTOR_KEY.LeftShift))
            {
                camera.Move(0f, 0f, -0.001f * Reactor.AccurateTimeElapsed());
                //camera.Position = new R3DVECTOR(camera.Position.X, landscape.GetTerrainHeight(camera.Position.X, camera.Position.Z) + 2f, camera.Position.Z);
            }
            if (input.IsKeyDown(CONST_REACTOR_KEY.LeftShift) && input.IsKeyDown(CONST_REACTOR_KEY.W))
                camera.Move(0f, 0f, 0.1f * Reactor.AccurateTimeElapsed());
            if (input.IsKeyDown(CONST_REACTOR_KEY.LeftShift) && input.IsKeyDown(CONST_REACTOR_KEY.S))
                camera.Move(0f, 0f, -0.1f * Reactor.AccurateTimeElapsed());
            if (input.IsKeyDown(CONST_REACTOR_KEY.LeftShift) && input.IsKeyDown(CONST_REACTOR_KEY.A))
                camera.Move(-0.1f * Reactor.AccurateTimeElapsed(), 0f, 0f);
            if (input.IsKeyDown(CONST_REACTOR_KEY.LeftShift) && input.IsKeyDown(CONST_REACTOR_KEY.D))
                camera.Move(0.1f * Reactor.AccurateTimeElapsed(), 0f, 0f);
            if (input.IsKeyDown(CONST_REACTOR_KEY.T))
                landscape.ToggleBoundingBoxDraw();
            if (input.IsKeyDown(CONST_REACTOR_KEY.F))
            {
                if (fog) { fog = false; } else { fog = true; }
                atmosphere.Fog_Enable(fog);
            }

            if (input.IsKeyDown(CONST_REACTOR_KEY.F2))
                scene.SetShadeMode(CONST_REACTOR_FILLMODE.Wireframe);
            if (input.IsKeyDown(CONST_REACTOR_KEY.F3))
                scene.SetShadeMode(CONST_REACTOR_FILLMODE.Solid);

            if (input.IsKeyDown(CONST_REACTOR_KEY.PrintScreen))
                this.Reactor.TakeScreenshot("sshot"+Reactor.GetTicks().ToString());

            if (input.IsKeyDown(CONST_REACTOR_KEY.Left))
                camera.RotateX(0.1f);
            if (input.IsKeyDown(CONST_REACTOR_KEY.Right))
                camera.RotateX(-0.1f);

            if (input.IsKeyDown(CONST_REACTOR_KEY.Space))
                camera.LevelRoll();
            #endif
            #if XBOX
            if (input.GetControllerState(0).IsConnected)
            {
                Microsoft.Xna.Framework.Input.GamePadState state = input.GetControllerState(0);
                camera.Move(state.ThumbSticks.Left.X*5.5f, 0, state.ThumbSticks.Left.Y*5.5f);
                camera.RotateFlight(state.ThumbSticks.Right.X, -state.ThumbSticks.Right.Y, 0.0f);
                //camera.RotateFirstPerson(state.ThumbSticks.Right.X, -state.ThumbSticks.Right.Y);
                if(input.GetControllerState(0).IsButtonDown(Microsoft.Xna.Framework.Input.Buttons.LeftShoulder))
                    camera.LevelRoll();
                if (state.IsButtonDown(Microsoft.Xna.Framework.Input.Buttons.Back))
                    Exit();
            }
            #endif
            atmosphere.Update();
            landscape.Update();
            //float landheight = landscape.GetTerrainHeight(camera.Position.X, camera.Position.Z);

            //if (landheight < water.GetPosition().Y)
            //{
                //landheight = water.GetPosition().Y;
            //}
            //R3DVECTOR ch = new R3DVECTOR(camera.Position.X, landheight + 30, camera.Position.Z);
            //camera.Position = ch;
            //camera.Update();
            //mesh.Move(0f, 0, 0.03995f * Reactor.AccurateTimeElapsed());
            //R3DVECTOR v = mesh.GetPosition();
            //mesh.SetPosition(v.X, landscape.GetTerrainHeight(v.X, v.Z), v.Z);
            //mesh.SetLookAt(new R3DVECTOR(mesh.GetPosition().X - 1, mesh.GetPosition().Y, mesh.GetPosition().Z - 1));
            //R3DVECTOR v = camera.Position;
            //v.Y = landscape.GetTerrainHeight(v.X, v.Z) + 50f;
            //if(fog)
            //camera.Position = v;
            //mesh.Update();
            //camera.Position = v;
            //camera.Update();
            //emitter.SetDirection(R3DVECTOR.Down * 50f);
            //emitter.SetPosition(emitter.GetPosition() * new Random().Next());
            //r = new Random((int)Reactor.GetTicks());
            //float x = (float)r.NextDouble() * (1000f) - 500f;
            //float z = (float)r.NextDouble() * (1000f) - 500f;
            //emitter.SetPosition(new R3DVECTOR(camera.Position.X + x, camera.Position.Y + 200f, camera.Position.Z + z));
            //emitter.Update();
            //R3DVECTOR v = Ball();
            //emitter2.SetPosition(v);
            //emitter2.Update();
            water.Update();
            //landscape.Update();
        }