Esempio n. 1
0
        public Plane(Game3DPlatformer game, float x, float y, float z, float width, float length)
            : base(game)
        {
            this.game = game;

            if (vertexTemplate == null)
            {
                vertexTemplate = new VertexBuffer(game.GraphicsDevice, typeof(VertexPositionNormalTexture), 4, BufferUsage.WriteOnly);
                vertexTemplate.SetData(vertices);

                test = new Texture2D(GraphicsDevice, 3, 2);
                test.SetData <Color>(new Color[] { Color.Red, Color.Blue, Color.Cyan, Color.Green, Color.Yellow, Color.Magenta });
            }

            this.x      = x;
            this.y      = y;
            this.z      = z;
            this.width  = width;
            this.length = length;
        }
Esempio n. 2
0
        public Cuboid(Game3DPlatformer game, float x, float y, float z, float width, float height, float length)
            : base(game)
        {
            if (vertexTemplate == null)
            {
                vertexTemplate = new VertexBuffer(GraphicsDevice, typeof(VertexPositionNormalTexture), vertices.Length, BufferUsage.WriteOnly);
                vertexTemplate.SetData(vertices);

                boundingIndicesTemplate = new IndexBuffer(GraphicsDevice, typeof(short), 24, BufferUsage.WriteOnly);
                boundingIndicesTemplate.SetData(boundingIndices);

                test = new Texture2D(GraphicsDevice, 12, 2);
                test.SetData <Color>(new Color[] { Color.Red, Color.Red, Color.Blue, Color.Blue, Color.Cyan, Color.Cyan, Color.Green, Color.Green, Color.Yellow, Color.Yellow, Color.Magenta, Color.Magenta,
                                                   Color.Red, Color.Red, Color.Blue, Color.Blue, Color.Cyan, Color.Cyan, Color.Green, Color.Green, Color.Yellow, Color.Yellow, Color.Magenta, Color.Magenta });
            }

            this.game     = game;
            this.Position = new Vector3(x, y, z);
            this.Size     = new Vector3(width, height, length);
        }