Fixed all errors.

This commit is contained in:
2023-12-18 02:13:20 -08:00
parent 3acb78f247
commit 0a6f5533ee
37 changed files with 950 additions and 1090 deletions

View File

@@ -3,6 +3,7 @@
#include "EHS.h"
#include "Array.h"
#include "Vertex.h"
#include "BaseObj.h"
namespace ehs
{
@@ -38,15 +39,13 @@ namespace ehs
1
});
class Mesh : public Resource
class Mesh final : public BaseObj
{
protected:
UInt_64 hashId;
Str_8 id;
Array<Vertex_f> vertices;
Array<UInt_32> indices;
GpuBuffer srcVertBuffer;
GpuBuffer dstVertBuffer;
GpuBuffer srcIndBuffer;
GpuBuffer dstIndBuffer;
public:
Mesh();
@@ -55,8 +54,6 @@ namespace ehs
Mesh(Str_8 id, Array<Vertex_f> vertices);
Mesh(Str_8 id);
Mesh(Mesh&& mesh) noexcept;
Mesh(const Mesh& mesh);
@@ -65,19 +62,13 @@ namespace ehs
Mesh& operator=(const Mesh& mesh);
bool UploadToGpu(GpuCmdBuffer* cmdBuffer) override;
void Release();
bool PostGpuUpload() override;
UInt_64 GetHashId() const;
bool HasPostGpuUploaded() const override;
void SetId(Str_8 newId);
bool ReleaseFromGpu() override;
bool IsUploaded() const override;
void Bind(GpuCmdBuffer* cmdBuffer);
void Draw(GpuCmdBuffer* cmdBuffer, const UInt_32 instances = 1);
Str_8 GetId() const;
void SetVertices(const Array<Vertex_f>& newVertices);

View File

@@ -14,9 +14,11 @@ namespace ehs
EHM
};
class Model : public Resource
class Model : public BaseObj
{
protected:
UInt_64 hashId;
Str_8 id;
Array<Mesh> meshes;
Bone skeleton;
Array<Animation> animations;
@@ -40,29 +42,27 @@ namespace ehs
Model& operator=(const Model& model) = default;
bool UploadToGpu(GpuCmdBuffer* cmdBuffer) override;
void Release();
bool PostGpuUpload() override;
UInt_64 GetHashId() const;
bool ReleaseFromGpu() override;
void SetId(Str_8 newId);
bool IsUploaded() const override;
void Draw(GpuCmdBuffer* cmdBuffer, const UInt_32 instances = 1);
Str_8 GetId() const;
Array<Mesh> GetMeshes() const;
Array<Mesh>& GetMeshes();
Mesh* GetMesh(const UInt_64 hashId);
Mesh* GetMesh(UInt_64 inHashId);
Mesh* GetMesh(const Str_8& id);
Mesh* GetMesh(const Str_8& inId);
Bone GetSkeleton() const;
Bone& GetSkeleton();
Animation* GetAnimation(const UInt_64 hashId);
Animation* GetAnimation(UInt_64 inHashId);
Array<Animation> GetAnimations() const;
@@ -70,7 +70,7 @@ namespace ehs
void Calculate();
void Export(const Str_8& filePath, const ModelEncoding encoding);
void Export(const Str_8& filePath, ModelEncoding encoding);
private:
void ToEHM(File& file);

View File

@@ -1,6 +1,7 @@
#pragma once
#include "EHS.h"
#include "Vec4.h"
#include "Vec3.h"
#include "Vec2.h"
#include "Color4.h"