using System.Runtime.InteropServices; namespace Raylib_cs; /// /// Vertex data definning a mesh
/// NOTE: Data stored in CPU memory (and GPU) ///
[StructLayout(LayoutKind.Sequential)] public unsafe partial struct Mesh { /// /// Creates a mesh ready for default vertex data allocation /// public Mesh(int vertexCount, int triangleCount) { VertexCount = vertexCount; TriangleCount = triangleCount; } /// /// Number of vertices stored in arrays /// public int VertexCount; /// /// Number of triangles stored (indexed or not) /// public int TriangleCount; #region Default vertex data /// /// Vertex position (XYZ - 3 components per vertex) (shader-location = 0) /// public float* Vertices = default; /// /// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) /// public float* TexCoords = default; /// /// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) /// public float* TexCoords2 = default; /// /// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) /// public float* Normals = default; /// /// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) /// public float* Tangents = default; /// /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) /// public byte* Colors = default; /// /// Vertex indices (in case vertex data comes indexed) /// public ushort* Indices = default; #endregion #region Animation vertex data /// /// Animated vertex positions (after bones transformations) /// public float* AnimVertices = default; /// /// Animated normals (after bones transformations) /// public float* AnimNormals = default; /// /// Vertex bone ids, up to 4 bones influence by vertex (skinning) /// public byte* BoneIds = default; /// /// Vertex bone weight, up to 4 bones influence by vertex (skinning) /// public float* BoneWeights = default; #endregion #region OpenGL identifiers /// /// OpenGL Vertex Array Object id /// public uint VaoId = default; /// /// OpenGL Vertex Buffer Objects id (default vertex data, uint[]) /// public uint* VboId = default; #endregion }