metaforce/Runtime/Graphics/CMetroidModelInstance.hpp

50 lines
2.3 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
2015-08-21 00:06:39 +00:00
#include <memory>
#include <unordered_map>
2016-07-26 22:05:59 +00:00
#include <vector>
#include "Graphics/CCubeModel.hpp"
2022-02-26 07:05:59 +00:00
#include "Runtime/RetroTypes.hpp"
#include <zeus/CAABox.hpp>
#include <zeus/CTransform.hpp>
2021-04-10 08:42:06 +00:00
namespace metaforce {
class CCubeSurface;
2015-08-21 00:06:39 +00:00
2018-12-08 05:30:43 +00:00
class CMetroidModelInstance {
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;
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; }
[[nodiscard]] std::vector<CCubeSurface>* GetSurfaces() { return &x50_surfaces; }
[[nodiscard]] const std::vector<CCubeSurface>* GetSurfaces() const { return &x50_surfaces; }
[[nodiscard]] const u8* GetMaterialPointer() const { return x4c_materialData; }
[[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; }
[[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