using System; using System.Numerics; 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 { /// /// 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; /// /// Vertex texture coordinates (UV - 2 components per vertex) (shader-location = 1) /// public float* texcoords; /// /// Vertex second texture coordinates (useful for lightmaps) (shader-location = 5) /// public float* texcoords2; /// /// Vertex normals (XYZ - 3 components per vertex) (shader-location = 2) /// public float* normals; /// /// Vertex tangents (XYZW - 4 components per vertex) (shader-location = 4) /// public float* tangents; /// /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) /// public byte* colors; /// /// Vertex indices (in case vertex data comes indexed) /// public ushort* indices; #endregion #region Animation vertex data /// /// Animated vertex positions (after bones transformations) /// public float* animVertices; /// /// Animated normals (after bones transformations) /// public float* animNormals; /// /// Vertex bone ids, up to 4 bones influence by vertex (skinning) /// public byte* boneIds; /// /// Vertex bone weight, up to 4 bones influence by vertex (skinning) /// public float* boneWeights; #endregion #region OpenGL identifiers /// /// OpenGL Vertex Array Object id /// public uint vaoId; /// /// OpenGL Vertex Buffer Objects id (default vertex data, uint[]) /// public uint* vboId; #endregion } }