Пример #1
0
        protected override void ResizeColorUVVertices(int newNumberOfVertices)
        {
            var newVerticesColorUV = new VertexPosition3DColorUV[newNumberOfVertices];

            Array.Copy(verticesColorUV, newVerticesColorUV, verticesColorUV.Length);
            verticesColorUV = newVerticesColorUV;
        }
Пример #2
0
		public void LerpPositionColorTextured3D()
		{
			var vertex = new VertexPosition3DColorUV(Vector3D.UnitX, Color.White, Vector2D.One);
			var vertex2 = new VertexPosition3DColorUV(Vector2D.UnitY, Color.Black, Vector2D.Zero);
			var lerpedVertex = vertex.Lerp(vertex2, 0.5f);
			Assert.AreEqual(lerpedVertex.Position, new Vector3D(0.5f, 0.5f, 0f));
			Assert.AreEqual(lerpedVertex.Color, new Color(127, 127, 127));
			Assert.AreEqual(lerpedVertex.UV, Vector2D.One);
		}
Пример #3
0
		public void VertexPositionColorTextured3D()
		{
			Assert.AreEqual(VertexPosition3DColorUV.SizeInBytes, 24);
			var vertex = new VertexPosition3DColorUV(Vector3D.UnitX, Color.Red, Vector2D.One);
			Assert.AreEqual(vertex.Format, VertexFormat.Position3DColorUV);
			Assert.AreEqual(vertex.Position, Vector3D.UnitX);
			Assert.AreEqual(vertex.Color, Color.Red);
			Assert.AreEqual(vertex.UV, Vector2D.One);
		}
Пример #4
0
        public void LerpPositionColorTextured3D()
        {
            var vertex       = new VertexPosition3DColorUV(Vector3D.UnitX, Color.White, Vector2D.One);
            var vertex2      = new VertexPosition3DColorUV(Vector2D.UnitY, Color.Black, Vector2D.Zero);
            var lerpedVertex = vertex.Lerp(vertex2, 0.5f);

            Assert.AreEqual(lerpedVertex.Position, new Vector3D(0.5f, 0.5f, 0f));
            Assert.AreEqual(lerpedVertex.Color, new Color(127, 127, 127));
            Assert.AreEqual(lerpedVertex.UV, Vector2D.One);
        }
Пример #5
0
        public void VertexPositionColorTextured3D()
        {
            Assert.AreEqual(VertexPosition3DColorUV.SizeInBytes, 24);
            var vertex = new VertexPosition3DColorUV(Vector3D.UnitX, Color.Red, Vector2D.One);

            Assert.AreEqual(vertex.Format, VertexFormat.Position3DColorUV);
            Assert.AreEqual(vertex.Position, Vector3D.UnitX);
            Assert.AreEqual(vertex.Color, Color.Red);
            Assert.AreEqual(vertex.UV, Vector2D.One);
        }
Пример #6
0
		public Batch3D(Material material, BlendMode blendMode,
			int minimumNumberOfQuads = MinNumberOfQuads)
		{
			Material = material;
			BlendMode = blendMode;
			minimumNumberOfQuads = MathExtensions.Max(minimumNumberOfQuads, MinNumberOfQuads);
			hasUV = ((material.Shader.Flags & ShaderFlags.Textured) != 0);
			hasColor = ((material.Shader.Flags & ShaderFlags.Colored) != 0);
			indices = new short[minimumNumberOfQuads * IndicesPerQuad];
			if (!hasUV)
				verticesColor = new VertexPosition3DColor[minimumNumberOfQuads * VerticesPerQuad]; //ncrunch: no coverage
			else if (hasColor)
				verticesColorUV = new VertexPosition3DColorUV[minimumNumberOfQuads * VerticesPerQuad];
			else
				verticesUV = new VertexPosition3DUV[minimumNumberOfQuads * VerticesPerQuad]; //ncrunch: no coverage
		}
Пример #7
0
 public Batch3D(Material material, BlendMode blendMode,
                int minimumNumberOfQuads = MinNumberOfQuads)
 {
     Material             = material;
     BlendMode            = blendMode;
     minimumNumberOfQuads = MathExtensions.Max(minimumNumberOfQuads, MinNumberOfQuads);
     hasUV    = ((material.Shader.Flags & ShaderFlags.Textured) != 0);
     hasColor = ((material.Shader.Flags & ShaderFlags.Colored) != 0);
     indices  = new short[minimumNumberOfQuads * IndicesPerQuad];
     if (!hasUV)
     {
         verticesColor = new VertexPosition3DColor[minimumNumberOfQuads * VerticesPerQuad];                 //ncrunch: no coverage
     }
     else if (hasColor)
     {
         verticesColorUV = new VertexPosition3DColorUV[minimumNumberOfQuads * VerticesPerQuad];
     }
     else
     {
         verticesUV = new VertexPosition3DUV[minimumNumberOfQuads * VerticesPerQuad];                 //ncrunch: no coverage
     }
 }
Пример #8
0
		protected override void ResizeColorUVVertices(int newNumberOfVertices)
		{
			var newVerticesColorUV = new VertexPosition3DColorUV[newNumberOfVertices];
			Array.Copy(verticesColorUV, newVerticesColorUV, verticesColorUV.Length);
			verticesColorUV = newVerticesColorUV;
		}