public void Draw(BaseCamera camera)
        {
            if (model == null)
            {
                return;
            }

            Matrix[] transforms = new Matrix[model.Bones.Count];
            model.CopyAbsoluteBoneTransformsTo(transforms);
            foreach (var mesh in model.Meshes)
            {
                foreach (var effectObject in mesh.Effects)
                {
                    var basicEffect = (BasicEffect)effectObject;

                    basicEffect.EnableDefaultLighting();
                    basicEffect.PreferPerPixelLighting = true;

                    basicEffect.World = Matrix.Identity *
                                        Matrix.CreateRotationY(leftRightRotation) * Matrix.CreateTranslation(Position);
                    basicEffect.View       = camera.ViewSettings.ViewMatrix;
                    basicEffect.Projection = camera.ProjectionMatrix;
                }

                mesh.Draw();
            }
        }
Exemple #2
0
 public Telemetry(
     Game game,
     GraphicsDevice graphicsDevice,
     BaseCamera camera) : base(game)
 {
     this.graphicsDevice = graphicsDevice;
     this.camera         = camera;
 }
Exemple #3
0
        public void Draw(BaseCamera camera)
        {
            foreach (var mesh in model.Meshes)
            {
                foreach (BasicEffect effect in mesh.Effects)
                {
                    effect.EnableDefaultLighting();
                    effect.PreferPerPixelLighting = true;

                    effect.World      = Matrix.CreateWorld(new Vector3(0, 1, 5), Vector3.Forward, Vector3.Up);
                    effect.View       = camera.ViewSettings.ViewMatrix;
                    effect.Projection = camera.ProjectionMatrix;
                }

                mesh.Draw();
            }
        }
Exemple #4
0
 public Player(Game game, Vector3 initialPosition, BaseCamera camera) : base(game)
 {
     this.camera = camera;
     Position    = initialPosition;
 }