2017-12-29 08:08:12 +00:00
|
|
|
#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);
|
2018-10-14 20:16:21 +00:00
|
|
|
conn.openBlend(path.getWithExtension(_SYS_STR(".blend"), true));
|
2017-12-29 08:08:12 +00:00
|
|
|
hecl::blender::DataStream ds = conn.beginData();
|
|
|
|
auto aabb = ds.getMeshAABB();
|
|
|
|
aabbOut = zeus::CAABox(aabb.first, aabb.second);
|
|
|
|
}
|
|
|
|
|
2018-12-08 01:49:15 +00:00
|
|
|
if (aabbOut.min.x() > aabbOut.max.x())
|
2017-12-29 08:08:12 +00:00
|
|
|
return {};
|
|
|
|
|
|
|
|
zeus::CTransform xf = ConvertEditorEulerToTransform4f(scale, orientation, location);
|
|
|
|
return aabbOut.getTransformedAABox(xf);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|