public override void Draw(Sim.Interface.Camera cam, Sim.Environment.World world, GraphicsDevice g)
 {
     base.Draw(cam, world, g);
     if (waypoints != null)
     {
     }
 }
        public override void Draw(Sim.Interface.Camera cam, Sim.Environment.World world, Microsoft.Xna.Framework.Graphics.GraphicsDevice g)
        {
            // rotate the bird
            rotMat = Matrix.Identity;
            Vector3 rotAxis = Vector3.Cross(direction, -Vector3.UnitX);

            if (rotAxis != Vector3.Zero)
            {
                rotAxis.Normalize();
                float angle = (float)Math.Acos(Vector3.Dot(direction, Vector3.UnitX)) + MathHelper.Pi;
                rotMat = Matrix.CreateFromAxisAngle(rotAxis, angle);
            }

            base.Draw(cam, world, g);
        }
Ejemplo n.º 3
0
        public virtual void Draw(Sim.Interface.Camera cam, World world, GraphicsDevice g)
        {
            SetRenderStates(g);

            Matrix[] transforms = new Matrix[model.Bones.Count];
            model.CopyAbsoluteBoneTransformsTo(transforms);

            foreach (ModelMesh mesh in model.Meshes)
            {
                g.Indices = mesh.IndexBuffer;

                for (int i = 0; i < mesh.MeshParts.Count; i++)
                {
                    ModelMeshPart meshPart = mesh.MeshParts[i];

                    g.Vertices[0].SetSource(mesh.VertexBuffer, meshPart.StreamOffset, meshPart.VertexStride);
                    g.VertexDeclaration = meshPart.VertexDeclaration;

                    BasicEffect effect = meshPart.Effect as BasicEffect;



                    SetEffectParameters(effect, world);

                    effect.World =
                        transforms[mesh.ParentBone.Index] *
                        Matrix.CreateScale(scale) *
                        rotMat *
                        Matrix.CreateTranslation(position);
                    effect.View       = cam.View;
                    effect.Projection = cam.Projection;
                }
                mesh.Draw();
            }

            ResetRenderStates(g);
        }
 public abstract void Draw(GraphicsDevice g, float worldTime, Sim.Interface.Camera cam, Vector3 color);