add normals to CustomGeometry interface

This commit is contained in:
Nick Fisher
2024-09-11 18:08:35 +08:00
parent 7a6e9cd598
commit 3b5c91b15c

View File

@@ -19,18 +19,26 @@ namespace thermion_filament
// CustomGeometry.h // CustomGeometry.h
class CustomGeometry { class CustomGeometry {
public: public:
CustomGeometry(float* vertices, uint32_t numVertices, uint16_t* indices, uint32_t numIndices, RenderableManager::PrimitiveType primitiveType, Engine* engine); CustomGeometry(
float* vertices,
uint32_t numVertices,
float* normals,
uint32_t numNormals,
uint16_t* indices,
uint32_t numIndices,
RenderableManager::PrimitiveType primitiveType,
Engine* engine);
~CustomGeometry(); ~CustomGeometry();
void computeBoundingBox(); VertexBuffer* vertexBuffer() const;
VertexBuffer* vertexBuffer(); IndexBuffer* indexBuffer() const;
IndexBuffer* indexBuffer();
Box getBoundingBox() const; Box getBoundingBox() const;
float* vertices; float* vertices = nullptr;
uint32_t numVertices; float* normals = nullptr;
uint16_t* indices; uint32_t numVertices = 0;
uint32_t numIndices; uint16_t* indices = 0;
uint32_t numIndices = 0;
Box boundingBox; Box boundingBox;
RenderableManager::PrimitiveType primitiveType; RenderableManager::PrimitiveType primitiveType;
@@ -39,6 +47,8 @@ private:
bool _vertexBufferFreed = false; bool _vertexBufferFreed = false;
bool _indexBufferFreed = false; bool _indexBufferFreed = false;
void computeBoundingBox();
}; };