mesh base

This commit is contained in:
h4570
2022-07-18 20:08:57 +02:00
parent ecfaef1b85
commit c56c3d76db
24 changed files with 86 additions and 27 deletions
@@ -14,26 +14,16 @@
#include "./dynamic_mesh_frame.hpp"
#include "./dynamic_mesh_material_frame.hpp"
#include "./dynamic_mesh_anim_state.hpp"
#include "../mesh.hpp"
namespace Tyra {
class DynamicMesh {
class DynamicMesh : public Mesh {
public:
explicit DynamicMesh(const MeshBuilderData& data);
explicit DynamicMesh(const DynamicMesh& mesh);
~DynamicMesh();
/** Translation matrix */
M4x4 translation;
/** Rotation matrix */
M4x4 rotation;
/** Scale matrix */
M4x4 scale;
const u32& getId() const { return id; }
const u8& isMother() const { return _isMother; }
/** Get position from translation matrix */
@@ -113,7 +103,7 @@ class DynamicMesh {
void initMesh();
DynamicMeshAnimState animState;
u8 _isMother;
u32 id, framesCount, materialsCount;
u32 framesCount, materialsCount;
DynamicMeshFrame** frames;
DynamicMeshMaterial** materials;
};
+38
View File
@@ -0,0 +1,38 @@
/*
# ______ ____ ___
# | \/ ____| |___|
# | | | \ | |
#-----------------------------------------------------------------------
# Copyright 2022, tyra - https://github.com/h4570/tyra
# Licenced under Apache License 2.0
# Sandro Sobczyński <sandro.sobczynski@gmail.com>
*/
#pragma once
#include "math/m4x4.hpp"
#include <tamtypes.h>
namespace Tyra {
class Mesh {
public:
explicit Mesh();
~Mesh();
/** Translation matrix */
M4x4 translation;
/** Rotation matrix */
M4x4 rotation;
/** Scale matrix */
M4x4 scale;
const u32& getId() const { return id; }
protected:
u32 id;
};
} // namespace Tyra