mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-16 10:19:18 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
36 lines
890 B
C#
36 lines
890 B
C#
using System.Runtime.InteropServices;
|
|
|
|
namespace Sandbox;
|
|
|
|
[StructLayout( LayoutKind.Sequential )]
|
|
public struct SimpleVertex
|
|
{
|
|
public SimpleVertex( Vector3 position, Vector3 normal, Vector3 tangent, Vector2 texcoord )
|
|
{
|
|
this.position = position;
|
|
this.normal = normal;
|
|
this.tangent = tangent;
|
|
this.texcoord = texcoord;
|
|
}
|
|
|
|
[VertexLayout.Position]
|
|
public Vector3 position;
|
|
|
|
[VertexLayout.Normal]
|
|
public Vector3 normal;
|
|
|
|
[VertexLayout.Tangent]
|
|
public Vector3 tangent;
|
|
|
|
[VertexLayout.TexCoord]
|
|
public Vector2 texcoord;
|
|
|
|
public static readonly VertexAttribute[] Layout =
|
|
{
|
|
new ( VertexAttributeType.Position, VertexAttributeFormat.Float32, 3 ),
|
|
new ( VertexAttributeType.Normal, VertexAttributeFormat.Float32, 3 ),
|
|
new ( VertexAttributeType.Tangent, VertexAttributeFormat.Float32, 3 ),
|
|
new ( VertexAttributeType.TexCoord, VertexAttributeFormat.Float32, 2 )
|
|
};
|
|
}
|