diff --git a/include/nn/g3d/MaterialObj.h b/include/nn/g3d/MaterialObj.h new file mode 100644 index 0000000..44aabfb --- /dev/null +++ b/include/nn/g3d/MaterialObj.h @@ -0,0 +1,30 @@ +#pragma once + +#include "nn/gfx/gfx_Device.h" + +namespace nn::g3d { +class MaterialObj { +public: + struct InitializeArgument { + s32 CalculateMemorySize(); + }; + + void Initialize(const InitializeArgument&, void*, u64); + void InitializeDependPointer(); + void GetBlockBufferAlignment(gfx::TDevice*) const; + void CalculateBlockBufferSize(gfx::TDevice*) const; + void SetupBlockBufferImpl(gfx::TDevice*, + gfx::TMemoryPool*, s64, u64); + void ResetDirtyFlags(); + void SetupBlockBuffer(gfx::TDevice*, + gfx::TMemoryPool*, s64, u64); + void CleanupBlockBuffer(gfx::TDevice*); + void CalculateMaterial(s32); + + template + void ConvertDirtyParams(void*, u32*); + +private: + void* filler[16]; +}; +} // namespace nn::g3d diff --git a/include/nn/g3d/ModelObj.h b/include/nn/g3d/ModelObj.h index cefff39..dacd7e0 100644 --- a/include/nn/g3d/ModelObj.h +++ b/include/nn/g3d/ModelObj.h @@ -2,6 +2,8 @@ #include +#include + namespace nn::g3d { class MaterialObj; @@ -9,13 +11,29 @@ class ResModel; class ShapeObj; class SkeletonObj; +struct Bounds { + f32 x; + f32 y; + f32 z; + f32 unk; + f32 radius; +}; + // TODO class ModelObj { public: + MaterialObj* FindMaterial(const char* materialName); + SkeletonObj* GetSkeleton() const { return m_Skeleton; } s32 GetNumShapes() const { return m_NumShapes; } + u8 GetViewDependentModelFlags() const { return m_ViewDependentModelFlags; } + + MaterialObj* GetMaterial(s32 index) const { return &m_Materials[index]; } + + const Bounds& GetBounds() const { return *m_Bounds; } + s32 get_8c() const { return _8c; } private: @@ -27,7 +45,7 @@ class ModelObj { void* _8; void* _10; u8 _18; - u8 _19; + u8 m_ViewDependentModelFlags; u16 _1a; void* _20; void* _28; @@ -36,7 +54,7 @@ class ModelObj { SkeletonObj* m_Skeleton; ShapeObj* m_Shapes; MaterialObj* m_Materials; - void* _50; + Bounds* m_Bounds; void* m_UserData; void* _60; void* _68;