mirror of https://github.com/AxioDL/metaforce.git
30 lines
866 B
C++
30 lines
866 B
C++
|
#include "DoorArea.hpp"
|
||
|
#include "hecl/Blender/Connection.hpp"
|
||
|
|
||
|
namespace DataSpec::DNAMP1
|
||
|
{
|
||
|
|
||
|
zeus::CAABox DoorArea::getVISIAABB(hecl::blender::Token& btok) const
|
||
|
{
|
||
|
hecl::blender::Connection& conn = btok.getBlenderConnection();
|
||
|
zeus::CAABox aabbOut;
|
||
|
|
||
|
if (animationParameters.animationCharacterSet)
|
||
|
{
|
||
|
hecl::ProjectPath path = UniqueIDBridge::TranslatePakIdToPath(
|
||
|
animationParameters.animationCharacterSet);
|
||
|
conn.openBlend(path.getWithExtension(_S(".blend"), true));
|
||
|
hecl::blender::DataStream ds = conn.beginData();
|
||
|
auto aabb = ds.getMeshAABB();
|
||
|
aabbOut = zeus::CAABox(aabb.first, aabb.second);
|
||
|
}
|
||
|
|
||
|
if (aabbOut.min.x > aabbOut.max.x)
|
||
|
return {};
|
||
|
|
||
|
zeus::CTransform xf = ConvertEditorEulerToTransform4f(scale, orientation, location);
|
||
|
return aabbOut.getTransformedAABox(xf);
|
||
|
}
|
||
|
|
||
|
}
|