-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
Source/Ultraviolet/Shared/Graphics/VertexPositionNormalTexture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
namespace Ultraviolet.Graphics | ||
{ | ||
/// <summary> | ||
/// Represents a vertex containing 3D position, normal, and texture coordinate data. | ||
/// </summary> | ||
public struct VertexPositionNormalTexture : IVertexType | ||
{ | ||
/// <summary> | ||
/// Initializes a new instance of the <see cref="VertexPositionNormalTexture"/> structure. | ||
/// </summary> | ||
/// <param name="position">The vertex position.</param> | ||
/// <param name="normal">The vertex normal.</param> | ||
/// <param name="textureCoordinate">The texture coordinate.</param> | ||
public VertexPositionNormalTexture(Vector3 position, Vector3 normal, Vector2 textureCoordinate) | ||
{ | ||
this.Position = position; | ||
this.Normal = normal; | ||
this.TextureCoordinate = textureCoordinate; | ||
} | ||
|
||
/// <summary> | ||
/// Gets the vertex declaration. | ||
/// </summary> | ||
VertexDeclaration IVertexType.VertexDeclaration | ||
{ | ||
get { return VertexDeclaration; } | ||
} | ||
|
||
/// <summary> | ||
/// The vertex declaration. | ||
/// </summary> | ||
public static readonly VertexDeclaration VertexDeclaration = new VertexDeclaration(new[] { | ||
new VertexElement(0, VertexFormat.Vector3, VertexUsage.Position, 0), | ||
new VertexElement(sizeof(Single) * 3, VertexFormat.Vector3, VertexUsage.Normal, 0), | ||
new VertexElement(sizeof(Single) * 3 + sizeof(Single) * 3, VertexFormat.Vector2, VertexUsage.TextureCoordinate, 0), | ||
}); | ||
|
||
/// <summary> | ||
/// The vertex position. | ||
/// </summary> | ||
public Vector3 Position; | ||
|
||
/// <summary> | ||
/// The vertex normal. | ||
/// </summary> | ||
public Vector3 Normal; | ||
|
||
/// <summary> | ||
/// The texture coordinate. | ||
/// </summary> | ||
public Vector2 TextureCoordinate; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters