2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2015-08-21 00:06:39 +00:00
|
|
|
|
2019-09-28 02:53:03 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <unordered_map>
|
2016-07-26 22:05:59 +00:00
|
|
|
#include <vector>
|
2019-09-28 02:53:03 +00:00
|
|
|
|
2022-02-25 07:45:25 +00:00
|
|
|
#include "Graphics/CCubeModel.hpp"
|
2022-02-26 07:05:59 +00:00
|
|
|
#include "Runtime/RetroTypes.hpp"
|
2019-09-28 02:53:03 +00:00
|
|
|
|
|
|
|
#include <zeus/CAABox.hpp>
|
|
|
|
#include <zeus/CTransform.hpp>
|
2022-07-29 20:16:55 +00:00
|
|
|
#include <aurora/math.hpp>
|
2019-09-28 02:53:03 +00:00
|
|
|
|
2021-04-10 08:42:06 +00:00
|
|
|
namespace metaforce {
|
2022-02-25 07:45:25 +00:00
|
|
|
class CCubeSurface;
|
2015-08-21 00:06:39 +00:00
|
|
|
|
2018-12-08 05:30:43 +00:00
|
|
|
class CMetroidModelInstance {
|
2022-02-25 07:45:25 +00:00
|
|
|
u32 x0_visorFlags = 0;
|
|
|
|
zeus::CTransform x4_worldXf;
|
|
|
|
zeus::CAABox x34_worldAABB;
|
|
|
|
const u8* x4c_materialData = nullptr;
|
|
|
|
std::vector<CCubeSurface> x50_surfaces; // was rstl::vector<void*>*
|
|
|
|
std::vector<zeus::CVector3f> x60_positions; // was void*
|
|
|
|
std::vector<zeus::CVector3f> x64_normals; // was void*
|
|
|
|
std::vector<zeus::CColor> x68_colors; // was void*
|
2022-03-08 07:44:46 +00:00
|
|
|
std::vector<aurora::Vec2<float>> x6c_texCoords; // was void*
|
|
|
|
std::vector<aurora::Vec2<float>> x70_packedTexCoords; // was void*
|
2016-07-26 22:05:59 +00:00
|
|
|
|
|
|
|
public:
|
2018-12-08 05:30:43 +00:00
|
|
|
CMetroidModelInstance() = default;
|
2022-02-25 07:45:25 +00:00
|
|
|
CMetroidModelInstance(std::pair<const u8*, u32> modelHeader, const u8* materialData,
|
|
|
|
std::pair<const u8*, u32> positions, std::pair<const u8*, u32> normals,
|
|
|
|
std::pair<const u8*, u32> colors, std::pair<const u8*, u32> texCoords,
|
|
|
|
std::pair<const u8*, u32> packedTexCoords, std::vector<CCubeSurface>&& surfaces);
|
|
|
|
|
|
|
|
[[nodiscard]] u32 GetFlags() const { return x0_visorFlags; }
|
|
|
|
[[nodiscard]] const zeus::CAABox& GetBoundingBox() const { return x34_worldAABB; }
|
2022-03-06 04:50:54 +00:00
|
|
|
[[nodiscard]] std::vector<CCubeSurface>* GetSurfaces() { return &x50_surfaces; }
|
2022-02-25 07:45:25 +00:00
|
|
|
[[nodiscard]] const std::vector<CCubeSurface>* GetSurfaces() const { return &x50_surfaces; }
|
|
|
|
[[nodiscard]] const u8* GetMaterialPointer() const { return x4c_materialData; }
|
2022-03-10 06:33:17 +00:00
|
|
|
[[nodiscard]] TVectorRef GetVertexPointer() { return &x60_positions; }
|
|
|
|
[[nodiscard]] TConstVectorRef GetVertexPointer() const { return &x60_positions; }
|
|
|
|
[[nodiscard]] TVectorRef GetNormalPointer() { return &x64_normals; }
|
|
|
|
[[nodiscard]] TConstVectorRef GetNormalPointer() const { return &x64_normals; }
|
2022-02-25 07:45:25 +00:00
|
|
|
[[nodiscard]] const std::vector<zeus::CColor>* GetColorPointer() const { return &x68_colors; }
|
2022-03-08 07:44:46 +00:00
|
|
|
[[nodiscard]] const std::vector<aurora::Vec2<float>>* GetTCPointer() const { return &x6c_texCoords; }
|
|
|
|
[[nodiscard]] const std::vector<aurora::Vec2<float>>* GetPackedTCPointer() const { return &x70_packedTexCoords; }
|
2015-08-21 00:06:39 +00:00
|
|
|
};
|
2021-04-10 08:42:06 +00:00
|
|
|
} // namespace metaforce
|