mesh refactor 3

This commit is contained in:
h4570
2022-08-10 21:58:32 +02:00
parent 10e0f52d44
commit 0a2d19b2d0
26 changed files with 321 additions and 356 deletions
+5 -18
View File
@@ -23,17 +23,14 @@ class Mesh {
explicit Mesh(const Mesh& mesh);
~Mesh();
/** Translation matrix */
M4x4 translation;
u8 isMother;
/** Rotation matrix */
M4x4 rotation;
u32 id;
/** Scale matrix */
M4x4 scale;
M4x4 translation, rotation, scale;
std::vector<MeshMaterial*> materials;
inline const u32& getId() const { return id; }
inline const u8& isMother() const { return _isMother; }
M4x4 getModelMatrix() const;
/** Get position from translation matrix */
@@ -43,18 +40,8 @@ class Mesh {
void setPosition(const Vec4& v);
/** Returns material, which is a mesh "subgroup". */
MeshMaterial* getMaterial(const u32& i) const { return materials[i]; }
MeshMaterial** getMaterials() { return materials; }
const u32& getMaterialsCount() const { return materialsCount; }
protected:
void init();
u8 _isMother;
u32 id, materialsCount;
MeshMaterial** materials;
};
} // namespace Tyra