Moved InitFromFile() from Geometry to MeshLoader, added MeshLoader function for USD files, added tinyusdz library
This commit is contained in:
@@ -9,14 +9,11 @@
|
||||
#include "Base/ICloseable.hpp"
|
||||
#include "Math/AABB.hpp"
|
||||
#include "Base/Utils.hpp"
|
||||
#include "Vertex.hpp"
|
||||
#include <string>
|
||||
|
||||
class aiMesh;
|
||||
|
||||
namespace OpenVulkano
|
||||
{
|
||||
struct Vertex;
|
||||
|
||||
namespace Scene
|
||||
{
|
||||
enum class VertexIndexType
|
||||
@@ -26,6 +23,7 @@ namespace OpenVulkano
|
||||
|
||||
class Geometry : public ICloseable
|
||||
{
|
||||
friend class MeshLoader;
|
||||
public:
|
||||
uint32_t vertexCount = 0, indexCount = 0;
|
||||
Vertex* vertices = nullptr;
|
||||
@@ -42,15 +40,6 @@ namespace OpenVulkano
|
||||
Geometry& operator=(Geometry&& other) noexcept;
|
||||
~Geometry();
|
||||
|
||||
static Geometry* LoadFromFile(const std::string& file)
|
||||
{
|
||||
Geometry* mesh = new Geometry();
|
||||
mesh->InitFromFile(file);
|
||||
return mesh;
|
||||
}
|
||||
|
||||
void InitFromFile(const std::string& file);
|
||||
|
||||
/**
|
||||
* \brief Creates the arrays for the vertices and indices. They will not be filled!
|
||||
* \param vertexCount The amount of vertices that will be used
|
||||
@@ -58,8 +47,6 @@ namespace OpenVulkano
|
||||
*/
|
||||
void Init(uint32_t vertexCount, uint32_t indexCount);
|
||||
|
||||
void Init(aiMesh* mesh);
|
||||
|
||||
void SetIndices(const uint32_t* data, uint32_t size, uint32_t dstOffset = 0) const;
|
||||
|
||||
void Close() override;
|
||||
|
||||
Reference in New Issue
Block a user