diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-05 01:59:16 +0000 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-03-05 01:59:16 +0000 |
commit | d4c073a18adaed73973f34c6c39fc15664d9211d (patch) | |
tree | 44536af3af0284ab75eae79ef81a5e4452019269 /assetFactory/asset.h | |
parent | Add helper operator to perform vec3*mat4 and perspective divide (diff) | |
parent | Remove old hard coded asset factory test, run entirely from XML load and rend... (diff) | |
download | ilt-d4c073a18adaed73973f34c6c39fc15664d9211d.tar.bz2 ilt-d4c073a18adaed73973f34c6c39fc15664d9211d.tar.xz ilt-d4c073a18adaed73973f34c6c39fc15664d9211d.zip |
Merge branch 'model-factory'
Diffstat (limited to 'assetFactory/asset.h')
-rw-r--r-- | assetFactory/asset.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/assetFactory/asset.h b/assetFactory/asset.h new file mode 100644 index 0000000..e3318e4 --- /dev/null +++ b/assetFactory/asset.h @@ -0,0 +1,37 @@ +#pragma once + +#include "factoryMesh.h" +#include "persistence.h" +#include <stdTypeDefs.hpp> + +class Asset : public Persistence::Persistable, public StdTypeDefs<Asset> { +public: + std::string id; + std::string name; + +protected: + struct MeshConstruct : public Persistence::SelectionPtrBase<FactoryMesh::Ptr> { + using Persistence::SelectionPtrBase<FactoryMesh::Ptr>::setValue; + + MeshConstruct(Mesh::Ptr & m); + + void endObject(Persistence::Stack & stk) override; + + FactoryMesh::Ptr fmesh; + Mesh::Ptr & out; + }; + + struct MeshArrayConstruct : public Persistence::SelectionPtrBase<FactoryMesh::Ptr> { + using Persistence::SelectionPtrBase<FactoryMesh::Ptr>::setValue; + + MeshArrayConstruct(std::span<Mesh::Ptr> m); + + void endObject(Persistence::Stack & stk) override; + + FactoryMesh::Ptr fmesh; + std::span<Mesh::Ptr> out; + }; + + friend Persistence::SelectionPtrBase<std::shared_ptr<Asset>>; + bool persist(Persistence::PersistenceStore & store) override; +}; |