From 2f1929b659d857f0e58a7201d3837cbe1351dbdb Mon Sep 17 00:00:00 2001 From: JupiterRider <60042618+JupiterRider@users.noreply.github.com> Date: Fri, 6 Dec 2024 21:19:27 +0100 Subject: [PATCH] VertexBuffer struct updated --- Raylib-cs/types/RenderBatch.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/Raylib-cs/types/RenderBatch.cs b/Raylib-cs/types/RenderBatch.cs index c8e9b8e..cfc1615 100644 --- a/Raylib-cs/types/RenderBatch.cs +++ b/Raylib-cs/types/RenderBatch.cs @@ -61,6 +61,11 @@ public unsafe partial struct VertexBuffer /// public float* TexCoords; + /// + /// Vertex normal (XYZ - 3 components per vertex) (shader-location = 2) + /// + public float* Normals; + /// /// Vertex colors (RGBA - 4 components per vertex) (shader-location = 3) /// @@ -79,9 +84,9 @@ public unsafe partial struct VertexBuffer public uint VaoId; /// - /// OpenGL Vertex Buffer Objects id (4 types of vertex data) + /// OpenGL Vertex Buffer Objects id (5 types of vertex data) /// - public fixed uint VboId[4]; + public fixed uint VboId[5]; /// /// Access @@ -99,6 +104,14 @@ public unsafe partial struct VertexBuffer return new(TexCoords, ElementCount * sizeof(float) / sizeof(T)); } + /// + /// Access + /// + public readonly Span NormalsAs() where T : unmanaged + { + return new(Normals, ElementCount * sizeof(float) / sizeof(T)); + } + /// /// Access ///