From 90df73af901cc511e0e42444516c17d47a4ce8a5 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 11 Oct 2022 23:50:03 -0700 Subject: [PATCH] Match CCubeSurface Former-commit-id: 0787cc17d02415ffeccb283a654e422d2bbeff23 --- include/Kyoto/Graphics/CCubeSurface.hpp | 25 +++++++++++++++++++++++++ src/Kyoto/Graphics/CCubeSurface.cpp | 13 +++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 include/Kyoto/Graphics/CCubeSurface.hpp create mode 100644 src/Kyoto/Graphics/CCubeSurface.cpp diff --git a/include/Kyoto/Graphics/CCubeSurface.hpp b/include/Kyoto/Graphics/CCubeSurface.hpp new file mode 100644 index 00000000..ed472cc0 --- /dev/null +++ b/include/Kyoto/Graphics/CCubeSurface.hpp @@ -0,0 +1,25 @@ +#ifndef _CCUBESURFACE +#define _CCUBESURFACE + +#include "Kyoto/Math/CAABox.hpp" + +class CCubeModel; +class CCubeSurface { + struct SSurfaceData { + CVector3f mCenter; + uint mMaterialIndex; + uint mDisplayListSizeAndNormalHint; + CCubeModel* mParent; + CCubeSurface* mNextSurface; + uint mExtraSize; + CVector3f mNormal; + CAABox mBounds; + }; + + static const CVector3f skDefaultNormal; + const SSurfaceData* x0_data; + + CAABox GetBounds() const; +private: +}; +#endif // _CCUBESURFACE diff --git a/src/Kyoto/Graphics/CCubeSurface.cpp b/src/Kyoto/Graphics/CCubeSurface.cpp new file mode 100644 index 00000000..edaca399 --- /dev/null +++ b/src/Kyoto/Graphics/CCubeSurface.cpp @@ -0,0 +1,13 @@ +#include "Kyoto/Graphics/CCubeSurface.hpp" + + +const CVector3f CCubeSurface::skDefaultNormal(1.f, 0.f, 0.f); + + +CAABox CCubeSurface::GetBounds() const { + if (x0_data->mExtraSize != 0) { + return x0_data->mBounds; + } + + return CAABox(x0_data->mCenter, x0_data->mCenter); +}