2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-14 01:51:22 +00:00
Luke Street 9ca1a38171 Use UTF-8 exclusively internally
This removes SystemString, SystemChar, etc.
All filepaths and log strings are assumed to be UTF-8,
with conversions to UTF-16 for Windows APIs as appropriate.

Updates amuse, athena, boo, kabufua and nod
2021-06-30 14:20:45 -04:00

32 lines
1.1 KiB
C++

#include "Platform.hpp"
#include "hecl/Blender/Connection.hpp"
namespace DataSpec::DNAMP1 {
zeus::CAABox Platform::getVISIAABB(hecl::blender::Token& btok) const {
hecl::blender::Connection& conn = btok.getBlenderConnection();
zeus::CAABox aabbOut;
if (model.isValid()) {
hecl::ProjectPath path = UniqueIDBridge::TranslatePakIdToPath(model);
conn.openBlend(path);
hecl::blender::DataStream ds = conn.beginData();
auto aabb = ds.getMeshAABB();
aabbOut = zeus::CAABox(aabb.first, aabb.second);
} else if (animationParameters.animationCharacterSet.isValid()) {
hecl::ProjectPath path = UniqueIDBridge::TranslatePakIdToPath(animationParameters.animationCharacterSet);
conn.openBlend(path.getWithExtension(".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);
}
} // namespace DataSpec::DNAMP1