//ncrunch: no coverage start protected override void ResizeColorVertices(int newNumberOfVertices) { var newVerticesColor = new VertexPosition3DColor[newNumberOfVertices]; Array.Copy(verticesColor, newVerticesColor, verticesColor.Length); verticesColor = newVerticesColor; }
public void LerpPositionColor3D() { var vertex = new VertexPosition3DColor(Vector3D.UnitX, Color.White); var vertex2 = new VertexPosition3DColor(Vector2D.UnitY, Color.Black); 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)); }
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 }
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 } }