예제 #1
0
        public override void Draw(Camera camera)
        {
            Matrix[] modelTransforms = new Matrix[Model.Bones.Count];
            Model.CopyAbsoluteBoneTransformsTo(modelTransforms);

            foreach (ModelMesh mesh in Model.Meshes) {
                Matrix localWorld = modelTransforms[mesh.ParentBone.Index] * _world;
                foreach (ModelMeshPart meshPart in mesh.MeshParts) {
                    Effect effect = meshPart.Effect;
                    if (effect is BasicEffect) {
                        ((BasicEffect)effect).World = localWorld;
                        ((BasicEffect)effect).View = camera.View;
                        ((BasicEffect)effect).Projection = camera.Projection;
                        ((BasicEffect)effect).EnableDefaultLighting();
                    } else {
                        SetEffectParameter(effect, "World", localWorld);
                        SetEffectParameter(effect, "View", camera.View);
                        SetEffectParameter(effect, "Projection", camera.Projection);
                        SetEffectParameter(effect, "CameraPosition", camera.Position);
                        //setEffectParameter(effect, "TextureEnabled", true);// どうやらデフォルトでtrueらしい
                        //setEffectParameter(effect, "ProjectorEnabled", true);
                    }
                    if (Material is CubeMapReflectMaterial) {//ProjectedTextureMaterial) {
                        int d = 0;
                    }
                    if (Material != null) {
                        //Material.SetEffectParameters(effect);// light mapだけの時は消すべきかも
                    }
                }
                mesh.Draw();
            }

            if (RenderBoudingSphere) DrawBoundingSphere();
        }
예제 #2
0
        public PauseMenu(Level privousScene)
            : base(privousScene)
        {
            sceneTitle = "Pause";
            drawBackGround = false;
            menuString = new string[] {
                "Resume",
            };
            buttonNum = menuString.Length;
            button = new Button[buttonNum];
            for (int i = 0; i < buttonNum; i++) {
                button[i].color = Color.Blue;
                button[i].name = menuString[i];
            }
            //SoundControl.Pause();
            this.camera = privousScene.camera;

            Load();
        }
예제 #3
0
 public override void Draw(Camera camera)
 {
     //base.Draw(camera);
     this.Draw(camera.View, camera.Projection, camera.Up, camera.Right, camera.Position);
 }
예제 #4
0
 public override void Draw(Camera camera)
 {
     Renderer.Draw(camera.View, camera.Projection, camera.Position);
     billboardStrip.Draw(camera.View, camera.Projection, camera.Up, camera.Right, camera.Position);
 }
예제 #5
0
        /*public override void Draw(GameTime gameTime, Matrix View, Matrix Projection, Vector3 CameraPosition, Vector3 CameraDirection, Vector3 Up, Vector3 Right)
        {
            eps.Draw(View, Projection, Up, Right);
        }*/
        public override void Draw(GameTime gameTime, Camera camera)
        {
            base.Draw(gameTime, camera);
             //explosion.Draw(camera.View, camera.Projection, camera.Up, camera.Right);
             foreach (ExplosionParticleEmitter e in emitters) {
                 e.Draw(camera.View, camera.Projection, camera.Position, camera.Up, camera.Right);
             }
            if (shockWaveEffect != null) {
                //shockWaveEffect.Draw(gameTime, camera.View, camera.Projection, camera.Direction, camera.Up, camera.Right);
            }

            // Draw BoundingBox for debug
            if (renderBoundingSphere) {
                int size = 25;
                BoundingBoxRenderer.Render(new BoundingBox(new Vector3(-size / 2.0f, -size / 2.0f, -size / 2.0f) + Position, new Vector3(size / 2.0f, size / 2.0f, size / 2.0f) + Position)
                    , graphicsDevice, camera.View, camera.Projection, Color.White);
            }
        }
예제 #6
0
 public override void Draw(Camera camera)
 {
     //base.Draw(camera);
     laserRenderer.Draw(camera);
 }
예제 #7
0
 /*public void Draw(GameTime gameTime, Matrix View, Matrix Projection, Vector3 CameraPosition, Vector3 CameraDirection, Vector3 Up, Vector3 Right)
 {
 }*/
 public virtual void Draw(GameTime gameTime, Camera camera)
 {
 }
예제 #8
0
 /*public virtual void Draw(Matrix View, Matrix Projection, Vector3 CameraPosition)
 {
 }
 public virtual void Draw(Matrix View, Matrix Projection, Vector3 Up, Vector3 Right)
 {
 }*/
 public virtual void Draw(Camera camera)
 {
 }
예제 #9
0
 public override void Draw(Camera camera)
 {
     base.Draw(camera.View, camera.Projection, camera.Up, camera.Right);
 }
예제 #10
0
 public void Draw(GameTime gameTime, Camera camera)
 {
     foreach (SpecialEffect e in Effects) {
         e.Draw(gameTime, camera);
     }
 }