VertexFormatTests VertexPosition3DUVSkinned Method Delta Engine Documentation

Namespace: DeltaEngine.Graphics.Tests
Assembly: DeltaEngine.Graphics.Tests (in DeltaEngine.Graphics.Tests.dll) Version: 1.1.1.0 (1.1.1)
Syntax

public void VertexPosition3DUVSkinned()
Examples

[Test]
public void VertexFormatVertexPosition3DUVSkinned()
{
    var format = VertexFormat.Position3DUVSkinned;
    Assert.AreEqual(36, format.Stride);
    Assert.AreEqual(0, format.Elements[0].Offset);
    Assert.AreEqual(12, format.Elements[1].Offset);
    Assert.AreEqual(20, format.Elements[2].Offset);
    Assert.AreEqual(28, format.Elements[3].Offset);
}
[Test]
public void VertexPosition3DUVSkinned()
{
    var skinning = new SkinningData(0, 0, 0.0f, 0.0f);
    var vertex = new VertexPosition3DUVSkinned(Vector3D.UnitX, Vector2D.One, skinning);
    Assert.AreEqual(vertex.Format, VertexFormat.Position3DUVSkinned);
    Assert.AreEqual(Vector3D.UnitX, vertex.Position);
    Assert.AreEqual(Vector2D.One, vertex.UV);
    Assert.AreEqual(skinning, vertex.Skinning);
}
[Test]
public void LerpVertexPosition3DUVSkinned()
{
    var vertex = new VertexPosition3DUVSkinned(Vector3D.UnitX, Vector2D.Zero,
        new SkinningData(0, 1, 1.0f, 1.0f));
    var vertex2 = new VertexPosition3DUVSkinned(Vector2D.UnitY, Vector2D.One,
        new SkinningData(0, 1, 0.0f, 0.0f));
    var lerpedVertex = vertex.Lerp(vertex2, 0.5f);
    Assert.AreEqual(lerpedVertex.Position, new Vector3D(0.5f, 0.5f, 0f));
    Assert.AreEqual(lerpedVertex.UV, Vector2D.Half);
    Assert.AreEqual(lerpedVertex.Skinning, new SkinningData(0, 1, 0.5f, 0.5f));
}
See Also