예제 #1
0
        public override void Draw(GraphicsDevice device, camera camera)
        {
            world = Matrix.CreateRotationX(MathHelper.Pi / -2) * Matrix.CreateTranslation(position);

            device.SamplerStates[0] = SamplerState.LinearWrap;
            base.Draw(device, camera);
        }
예제 #2
0
파일: Tank.cs 프로젝트: Mechgun/BattleTank
 public override void Draw(GraphicsDevice device, camera camera)
 {
     world = scale * rotation * Matrix.CreateTranslation(position);
     //soundEffect = ((Game1)Game).soundFx.CreateInstance();
     device.SamplerStates[0] = SamplerState.LinearWrap;
     base.Draw(device, camera);
 }
예제 #3
0
파일: Wall.cs 프로젝트: Mechgun/BattleTank
        public override void Draw(GraphicsDevice device, camera camera)
        {
            world = Matrix.CreateRotationX(MathHelper.Pi / -2) * Matrix.CreateTranslation(position);

            device.SamplerStates[0] = SamplerState.LinearWrap;
            base.Draw(device, camera);
        }
예제 #4
0
파일: Enemy.cs 프로젝트: Mechgun/BattleTank
 public Enemy(Model model, Vector3 Position, float Speed, GraphicsDevice device, camera camera, ModelManager modelManager)
     : base(model)
 {
     this.modelmanager = modelManager;
     world =  Matrix.CreateTranslation(Position);
     position = Position;
     speed = Speed;
 }
예제 #5
0
 public override void Draw(GraphicsDevice device, camera camera)
 {
     position   = modelmanager.GettankPosition();
     position.Y = 0;
     world      = scale * Matrix.CreateTranslation(position);
     device.SamplerStates[0] = SamplerState.LinearWrap;
     base.Draw(device, camera);
 }
예제 #6
0
 public override void Draw(GraphicsDevice device, camera camera)
 {
     position = modelmanager.GettankPosition();
     position.Y = 0;
     world =scale* Matrix.CreateTranslation(position);
     device.SamplerStates[0] = SamplerState.LinearWrap;
     base.Draw(device, camera);
 }
예제 #7
0
파일: Tank.cs 프로젝트: Mechgun/BattleTank
 //SoundEffect soundFx;
 //SoundEffectInstance music;
 //SoundEffectInstance soundEffect;
 public Tank(Model model, GraphicsDevice device, camera camera)
     : base(model)
 {
     MousePick = new MousePick(device, camera);
     turretBone = model.Bones["turret_geo"];
     rightFrontWheel = model.Bones["r_front_wheel_geo"];
     leftFrontWheel = model.Bones["l_front_wheel_geo"];
     rightRearWheel = model.Bones["r_back_wheel_geo"];
     leftRearWheel = model.Bones["l_back_wheel_geo"];
 }
예제 #8
0
파일: Tank.cs 프로젝트: Mechgun/BattleTank
        //SoundEffect soundFx;
        //SoundEffectInstance music;
        //SoundEffectInstance soundEffect;



        public Tank(Model model, GraphicsDevice device, camera camera)
            : base(model)
        {
            MousePick       = new MousePick(device, camera);
            turretBone      = model.Bones["turret_geo"];
            rightFrontWheel = model.Bones["r_front_wheel_geo"];
            leftFrontWheel  = model.Bones["l_front_wheel_geo"];
            rightRearWheel  = model.Bones["r_back_wheel_geo"];
            leftRearWheel   = model.Bones["l_back_wheel_geo"];
        }
예제 #9
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            camera = new camera(this, new Vector3(0, 50, 200), new Vector3(0, 0, 0), Vector3.Up);
            Components.Add(camera);

            ModelManager = new ModelManager(this);
            Components.Add(ModelManager);
            this.IsMouseVisible = true;

            base.Initialize();
        }
예제 #10
0
파일: Enemy.cs 프로젝트: Mechgun/BattleTank
        public override void Draw(GraphicsDevice device, camera camera)
        {
            scale = Matrix.CreateScale(.03f);
            direction = modelmanager.GettankPosition() - position;
            direction.Normalize();

            position += direction * speed * timeSincelastFrame;
            rotation = Matrix.CreateRotationY((float)Math.Atan2(direction.X, direction.Z));
            world = scale * rotation * Matrix.CreateTranslation(position);

            device.SamplerStates[0] = SamplerState.LinearWrap;
            base.Draw(device, camera);
        }
예제 #11
0
        public override void Draw(GraphicsDevice device, camera camera)
        {
            scale     = Matrix.CreateScale(.03f);
            direction = modelmanager.GettankPosition() - position;
            direction.Normalize();

            position += direction * speed * timeSincelastFrame;
            rotation  = Matrix.CreateRotationY((float)Math.Atan2(direction.X, direction.Z));
            world     = scale * rotation * Matrix.CreateTranslation(position);



            device.SamplerStates[0] = SamplerState.LinearWrap;
            base.Draw(device, camera);
        }
예제 #12
0
        public virtual void Draw(GraphicsDevice device, camera camera)
        {
            transforms = new Matrix[model.Bones.Count];
            model.CopyAbsoluteBoneTransformsTo(transforms);

            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.World          = transforms[mesh.ParentBone.Index] * world;
                    effect.View           = camera.view;
                    effect.Projection     = camera.projection;
                    effect.TextureEnabled = true;
                    effect.Alpha          = 1;
                    //effect.EnableDefaultLighting();
                }
                mesh.Draw();
            }
        }
예제 #13
0
        public virtual void Draw(GraphicsDevice device, camera camera)
        {
            transforms = new Matrix[model.Bones.Count];
            model.CopyAbsoluteBoneTransformsTo(transforms);

            foreach (ModelMesh mesh in model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.World = transforms[mesh.ParentBone.Index] * world;
                    effect.View = camera.view;
                    effect.Projection = camera.projection;
                    effect.TextureEnabled = true;
                    effect.Alpha = 1;
                    //effect.EnableDefaultLighting();
                }
                mesh.Draw();
            }
        }
예제 #14
0
파일: Game1.cs 프로젝트: Mechgun/BattleTank
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here
            camera = new camera(this, new Vector3(0, 50, 200), new Vector3(0, 0, 0), Vector3.Up);
            Components.Add(camera);

            ModelManager = new ModelManager(this);
            Components.Add(ModelManager);
            this.IsMouseVisible = true;

            base.Initialize();
        }
예제 #15
0
 public MousePick(GraphicsDevice device, camera camera)
 {
     this.device = device;
     this.camera = camera;
 }
예제 #16
0
 public MousePick(GraphicsDevice device, camera camera)
 {
     this.device = device;
     this.camera = camera;
 }
예제 #17
0
        public override void Draw(GraphicsDevice device, camera camera)
        {
            device.SamplerStates[0] = SamplerState.LinearWrap;

            base.Draw(device, camera);
        }
예제 #18
0
파일: Wall.cs 프로젝트: Mechgun/BattleTank
 public Wall(Model model, Vector3 Position, GraphicsDevice device, camera camera)
     : base(model)
 {
     world = Matrix.CreateTranslation(Position);
     position = Position;
 }
예제 #19
0
        public override void Draw(GraphicsDevice device, camera camera)
        {
            device.SamplerStates[0] = SamplerState.LinearWrap;

            base.Draw(device, camera);
        }
예제 #20
0
 public Enemy(Model model, Vector3 Position, float Speed, GraphicsDevice device, camera camera, ModelManager modelManager)
     : base(model)
 {
     this.modelmanager = modelManager;
     world             = Matrix.CreateTranslation(Position);
     position          = Position;
     speed             = Speed;
 }
예제 #21
0
파일: Tank.cs 프로젝트: Mechgun/BattleTank
 public override void Draw(GraphicsDevice device, camera camera)
 {
     world = scale * rotation * Matrix.CreateTranslation(position);
     //soundEffect = ((Game1)Game).soundFx.CreateInstance();
     device.SamplerStates[0] = SamplerState.LinearWrap;
     base.Draw(device, camera);
 }
예제 #22
0
 public Wall(Model model, Vector3 Position, GraphicsDevice device, camera camera)
     : base(model)
 {
     world    = Matrix.CreateTranslation(Position);
     position = Position;
 }