Files
Seele/src/Engine/Graphics/StaticMeshVertexData.h
T

36 lines
1.1 KiB
C++
Raw Normal View History

2023-10-29 09:20:23 +01:00
#pragma once
2023-10-07 19:29:53 +02:00
#include "VertexData.h"
namespace Seele
{
class StaticMeshVertexData : public VertexData
{
public:
2023-10-31 16:16:23 +01:00
StaticMeshVertexData();
2023-10-07 19:29:53 +02:00
virtual ~StaticMeshVertexData();
2023-10-31 16:16:23 +01:00
static StaticMeshVertexData* getInstance();
2023-10-29 09:20:23 +01:00
virtual MeshId allocateVertexData(uint64 numVertices) override;
2023-10-31 16:16:23 +01:00
void loadPositions(MeshId id, const Array<Vector>& data);
void loadTexCoords(MeshId id, const Array<Vector2>& data);
void loadNormals(MeshId id, const Array<Vector>& data);
void loadTangents(MeshId id, const Array<Vector>& data);
void loadBiTangents(MeshId id, const Array<Vector>& data);
virtual void init(Gfx::PGraphics graphics) override;
2023-10-07 19:29:53 +02:00
private:
2023-10-31 16:16:23 +01:00
virtual void updateBuffers() override;
2023-10-29 09:20:23 +01:00
Gfx::PShaderBuffer positions;
2023-10-31 16:16:23 +01:00
Array<Vector> positionData;
2023-10-29 09:20:23 +01:00
Gfx::PShaderBuffer texCoords;
2023-10-31 16:16:23 +01:00
Array<Vector2> texCoordsData;
2023-10-29 09:20:23 +01:00
Gfx::PShaderBuffer normals;
2023-10-31 16:16:23 +01:00
Array<Vector> normalData;
2023-10-29 09:20:23 +01:00
Gfx::PShaderBuffer tangents;
2023-10-31 16:16:23 +01:00
Array<Vector> tangentData;
2023-10-29 09:20:23 +01:00
Gfx::PShaderBuffer biTangents;
2023-10-31 16:16:23 +01:00
Array<Vector> biTangentData;
2023-10-29 09:20:23 +01:00
Map<MeshId, uint64_t> meshOffsets;
2023-10-31 16:16:23 +01:00
uint64 head;
uint64 verticesAllocated;
2023-10-07 19:29:53 +02:00
};
2023-10-29 09:20:23 +01:00
}