Esempio n. 1
0
        }//end draw

#if XBOX == FALSE
        /// <summary>
        /// Draws the model attached into the pick buffer
        /// </summary>
        public override void DrawPick(XPickBuffer pick_buf, XICamera camera)
        {
            // don't draw if we don't have a model
            //null checks are for editor!
            //remove these eventually maybe using a compiler directive for an editorer version of the DLL?
            if (!tree.loaded)
            {
                return;
            }

            //if (!mPickEnabled)
            //    return;

            pick_buf.PushMatrix(MatrixMode.World, this.PhysicsObject.GetWorldMatrix(null, Vector3.Zero));
            pick_buf.PushPickID(this.ComponentID);

            //trunk
            pick_buf.PushVertexBuffer(tree.Trunk.vertexBuffer);
            pick_buf.PushIndexBuffer(tree.Trunk.indexBuffer);

            pick_buf.PushVertexDeclaration(tree.Trunk.vertexDeclaration);

            pick_buf.QueueIndexedPrimitives(Microsoft.Xna.Framework.Graphics.PrimitiveType.TriangleList, 0,
                                            0, 0, tree.Trunk.vertices.Length, 0, tree.Trunk.indices.Length / 3);

            pick_buf.PopVertexDeclaration();
            pick_buf.PopVertexBuffer();
            pick_buf.PopIndexBuffer();



            pick_buf.PopPickID();
            pick_buf.PopMatrix(MatrixMode.World);
        }
Esempio n. 2
0
        /// <summary>
        /// Draws the model attached into the pick buffer
        /// </summary>
        public override void DrawPick(XPickBuffer pick_buf, XICamera camera)
        {
            if (!this.loaded)
            {
                return;
            }

            //if (!mPickEnabled)
            //    return;

            pick_buf.PushMatrix(MatrixMode.World, Matrix.Identity);
            pick_buf.PushPickID(this.ComponentID);

            pick_buf.PushVertexDeclaration(new VertexDeclaration(X.GraphicsDevice, VertexPositionTexture.VertexElements));

            pick_buf.QueueUserPrimitives(PrimitiveType.TriangleList, vertices, 0, 2);

            pick_buf.PopVertexDeclaration();

            pick_buf.PopPickID();
            pick_buf.PopMatrix(MatrixMode.World);
        }
Esempio n. 3
0
        /// <summary>
        /// Draws the model attached into the pick buffer
        /// </summary>
        public override void DrawPick(XPickBuffer pick_buf, XICamera camera)
        {
            // don't draw if we don't have a model
            //null checks are for editor!
            //remove these eventually maybe using a compiler directive for an editorer version of the DLL?
            if (model == null || !model.loaded)
            {
                return;
            }

            //if (!mPickEnabled)
            //    return;

            pick_buf.PushMatrix(MatrixMode.World, this.GetWorldMatrix());
            pick_buf.PushPickID(this.ComponentID);

            foreach (ModelMesh mesh in model.Model.Meshes)
            {
                pick_buf.PushVertexBuffer(mesh.VertexBuffer);
                pick_buf.PushIndexBuffer(mesh.IndexBuffer);

                foreach (ModelMeshPart part in mesh.MeshParts)
                {
                    pick_buf.PushVertexDeclaration(part.VertexDeclaration);

                    pick_buf.QueueIndexedPrimitives(Microsoft.Xna.Framework.Graphics.PrimitiveType.TriangleList, part.StreamOffset,
                                                    part.BaseVertex, 0, part.NumVertices, part.StartIndex, part.PrimitiveCount);

                    pick_buf.PopVertexDeclaration();
                }

                pick_buf.PopVertexBuffer();
                pick_buf.PopIndexBuffer();
            }

            pick_buf.PopPickID();
            pick_buf.PopMatrix(MatrixMode.World);
        }
Esempio n. 4
0
 /// <summary>
 /// Draws the model attached to the model into the pick buffer
 /// </summary>
 public virtual void DrawPick(XPickBuffer pick_buf, XICamera camera)
 {
 }