diff --git a/engine/inc/math/m4x4.hpp b/engine/inc/math/m4x4.hpp index efb9a74..994e627 100644 --- a/engine/inc/math/m4x4.hpp +++ b/engine/inc/math/m4x4.hpp @@ -12,6 +12,7 @@ #include "math/vec4.hpp" #include "math/math.hpp" +#include namespace Tyra { diff --git a/engine/inc/math/plane.hpp b/engine/inc/math/plane.hpp index a9c802d..68a57c3 100644 --- a/engine/inc/math/plane.hpp +++ b/engine/inc/math/plane.hpp @@ -10,6 +10,8 @@ #pragma once +#include "./vec4.hpp" +#include namespace Tyra { diff --git a/engine/inc/math/vec2.hpp b/engine/inc/math/vec2.hpp index 9f479ae..bace816 100644 --- a/engine/inc/math/vec2.hpp +++ b/engine/inc/math/vec2.hpp @@ -15,7 +15,6 @@ extern "C" { #include } -#include #include #include "math/math.hpp" diff --git a/engine/inc/math/vec4.hpp b/engine/inc/math/vec4.hpp index 35c1df6..673d280 100644 --- a/engine/inc/math/vec4.hpp +++ b/engine/inc/math/vec4.hpp @@ -16,9 +16,6 @@ extern "C" { } #include -#include -#include -#include #include #include "math/math.hpp" diff --git a/engine/inc/renderer/3d/mesh/dynamic/dynamic_mesh.hpp b/engine/inc/renderer/3d/mesh/dynamic/dynamic_mesh.hpp index d373c2e..e0a1f3a 100644 --- a/engine/inc/renderer/3d/mesh/dynamic/dynamic_mesh.hpp +++ b/engine/inc/renderer/3d/mesh/dynamic/dynamic_mesh.hpp @@ -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; }; diff --git a/engine/inc/renderer/3d/mesh/mesh.hpp b/engine/inc/renderer/3d/mesh/mesh.hpp new file mode 100644 index 0000000..5d3834e --- /dev/null +++ b/engine/inc/renderer/3d/mesh/mesh.hpp @@ -0,0 +1,38 @@ +/* +# ______ ____ ___ +# | \/ ____| |___| +# | | | \ | | +#----------------------------------------------------------------------- +# Copyright 2022, tyra - https://github.com/h4570/tyra +# Licenced under Apache License 2.0 +# Sandro Sobczyński +*/ + +#pragma once + +#include "math/m4x4.hpp" +#include + +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 diff --git a/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer.hpp b/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer.hpp index 30b01f1..e1a7e16 100644 --- a/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer.hpp +++ b/engine/inc/renderer/3d/pipeline/static/core/stapip_qbuffer.hpp @@ -12,7 +12,6 @@ #include #include -#include #include "debug/debug.hpp" #include "./bag/packaging/stapip_bag_package.hpp" #include "./bag/stapip_bag.hpp" diff --git a/engine/inc/renderer/core/3d/bbox/core_bbox.hpp b/engine/inc/renderer/core/3d/bbox/core_bbox.hpp index 7e0c4b1..f1e5d23 100644 --- a/engine/inc/renderer/core/3d/bbox/core_bbox.hpp +++ b/engine/inc/renderer/core/3d/bbox/core_bbox.hpp @@ -11,6 +11,7 @@ #pragma once #include +#include #include "./core_bbox_frustum.hpp" #include "math/m4x4.hpp" #include "math/plane.hpp" diff --git a/engine/inc/renderer/core/3d/renderer_3d_frustum_planes.hpp b/engine/inc/renderer/core/3d/renderer_3d_frustum_planes.hpp index 3b4ab6d..94ee7b8 100644 --- a/engine/inc/renderer/core/3d/renderer_3d_frustum_planes.hpp +++ b/engine/inc/renderer/core/3d/renderer_3d_frustum_planes.hpp @@ -10,7 +10,7 @@ #pragma once -#include +#include #include "renderer/renderer_settings.hpp" #include "./camera_info_3d.hpp" #include "math/plane.hpp" diff --git a/engine/src/math/m4x4.cpp b/engine/src/math/m4x4.cpp index bf61b01..d87910e 100644 --- a/engine/src/math/m4x4.cpp +++ b/engine/src/math/m4x4.cpp @@ -9,7 +9,7 @@ */ #include -#include +#include #include #include "math/m4x4.hpp" diff --git a/engine/src/math/plane.cpp b/engine/src/math/plane.cpp index d0b97d8..696d813 100644 --- a/engine/src/math/plane.cpp +++ b/engine/src/math/plane.cpp @@ -8,8 +8,9 @@ # Sandro Sobczyński */ -#include #include "math/vec4.hpp" +#include +#include #include "math/plane.hpp" namespace Tyra { diff --git a/engine/src/math/vec2.cpp b/engine/src/math/vec2.cpp index 68613dc..808180d 100644 --- a/engine/src/math/vec2.cpp +++ b/engine/src/math/vec2.cpp @@ -9,6 +9,7 @@ */ #include "math/vec2.hpp" +#include namespace Tyra { diff --git a/engine/src/math/vec4.cpp b/engine/src/math/vec4.cpp index d53320a..8d7d9ef 100644 --- a/engine/src/math/vec4.cpp +++ b/engine/src/math/vec4.cpp @@ -9,6 +9,9 @@ */ #include "math/vec4.hpp" +#include +#include +#include namespace Tyra { diff --git a/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh.cpp b/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh.cpp index 44fa9a7..e14c030 100644 --- a/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh.cpp +++ b/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh.cpp @@ -16,8 +16,6 @@ namespace Tyra { DynamicMesh::DynamicMesh(const MeshBuilderData& data) { - id = rand() % 1000000; - framesCount = data.framesCount; TYRA_ASSERT(framesCount > 0, "Frames count must be greater than 0"); @@ -42,8 +40,6 @@ DynamicMesh::DynamicMesh(const MeshBuilderData& data) { } DynamicMesh::DynamicMesh(const DynamicMesh& mesh) { - id = rand() % 1000000; - framesCount = mesh.framesCount; materialsCount = mesh.materialsCount; diff --git a/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh_frame.cpp b/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh_frame.cpp index dcc4f0e..b0286d3 100644 --- a/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh_frame.cpp +++ b/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh_frame.cpp @@ -11,6 +11,7 @@ #include "debug/debug.hpp" #include +#include #include #include "math/vec4.hpp" #include "renderer/models/color.hpp" diff --git a/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh_material.cpp b/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh_material.cpp index 4809ac1..e8bec87 100644 --- a/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh_material.cpp +++ b/engine/src/renderer/3d/mesh/dynamic/dynamic_mesh_material.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include "renderer/3d/mesh/dynamic/dynamic_mesh_material.hpp" namespace Tyra { diff --git a/engine/src/renderer/3d/mesh/mesh.cpp b/engine/src/renderer/3d/mesh/mesh.cpp new file mode 100644 index 0000000..395622f --- /dev/null +++ b/engine/src/renderer/3d/mesh/mesh.cpp @@ -0,0 +1,20 @@ + +/* +# ______ ____ ___ +# | \/ ____| |___| +# | | | \ | | +#----------------------------------------------------------------------- +# Copyright 2020, tyra - https://github.com/h4570/tyra +# Licenced under Apache License 2.0 +# Sandro Sobczyński +*/ + +#include "renderer/3d/mesh/mesh.hpp" + +namespace Tyra { + +Mesh::Mesh() { id = rand() % 1000000; } + +Mesh::~Mesh() {} + +} // namespace Tyra diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.cpp index 0d5ebb2..3c9e834 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include "renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_package.hpp" namespace Tyra { diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.cpp index 3629d7a..ec269c4 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include "debug/debug.hpp" #include "renderer/3d/pipeline/static/core/bag/packaging/stapip_bag_packages_bbox.hpp" diff --git a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_bag.cpp b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_bag.cpp index 24230a0..051caf0 100644 --- a/engine/src/renderer/3d/pipeline/static/core/bag/stapip_bag.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/bag/stapip_bag.cpp @@ -8,8 +8,9 @@ # Sandro Sobczyński */ -#include #include "renderer/3d/pipeline/static/core/bag/stapip_bag.hpp" +#include +#include namespace Tyra { diff --git a/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer.cpp b/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer.cpp index 89740ff..a40a9cf 100644 --- a/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer.cpp +++ b/engine/src/renderer/3d/pipeline/static/core/stapip_qbuffer.cpp @@ -9,6 +9,8 @@ */ #include "renderer/3d/pipeline/static/core/stapip_qbuffer.hpp" +#include +#include namespace Tyra { diff --git a/engine/src/renderer/core/3d/bbox/core_bbox.cpp b/engine/src/renderer/core/3d/bbox/core_bbox.cpp index 7341784..35537ab 100644 --- a/engine/src/renderer/core/3d/bbox/core_bbox.cpp +++ b/engine/src/renderer/core/3d/bbox/core_bbox.cpp @@ -10,6 +10,7 @@ #include #include +#include #include "renderer/core/3d/bbox/core_bbox.hpp" namespace Tyra { diff --git a/engine/src/renderer/core/3d/renderer_3d_frustum_planes.cpp b/engine/src/renderer/core/3d/renderer_3d_frustum_planes.cpp index cb6185f..a539dc8 100644 --- a/engine/src/renderer/core/3d/renderer_3d_frustum_planes.cpp +++ b/engine/src/renderer/core/3d/renderer_3d_frustum_planes.cpp @@ -8,8 +8,9 @@ # Sandro Sobczyński */ -#include #include "debug/debug.hpp" +#include +#include #include "renderer/core/3d/renderer_3d_frustum_planes.hpp" namespace Tyra { diff --git a/engine/src/renderer/models/color.cpp b/engine/src/renderer/models/color.cpp index a48ab4d..2eccaeb 100644 --- a/engine/src/renderer/models/color.cpp +++ b/engine/src/renderer/models/color.cpp @@ -9,6 +9,8 @@ */ #include "renderer/models/color.hpp" +#include +#include namespace Tyra {