2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 11:47:43 +00:00

New code style refactor

This commit is contained in:
Jack Andersen
2018-12-07 19:30:43 -10:00
parent 41ae32be31
commit 636c82a568
1451 changed files with 171430 additions and 203303 deletions

View File

@@ -1,37 +1,31 @@
#include "Platform.hpp"
#include "hecl/Blender/Connection.hpp"
namespace DataSpec::DNAMP1
{
namespace DataSpec::DNAMP1 {
zeus::CAABox Platform::getVISIAABB(hecl::blender::Token& btok) const
{
hecl::blender::Connection& conn = btok.getBlenderConnection();
zeus::CAABox aabbOut;
zeus::CAABox Platform::getVISIAABB(hecl::blender::Token& btok) const {
hecl::blender::Connection& conn = btok.getBlenderConnection();
zeus::CAABox aabbOut;
if (model)
{
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)
{
hecl::ProjectPath path = UniqueIDBridge::TranslatePakIdToPath(
animationParameters.animationCharacterSet);
conn.openBlend(path.getWithExtension(_SYS_STR(".blend"), true));
hecl::blender::DataStream ds = conn.beginData();
auto aabb = ds.getMeshAABB();
aabbOut = zeus::CAABox(aabb.first, aabb.second);
}
if (model) {
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) {
hecl::ProjectPath path = UniqueIDBridge::TranslatePakIdToPath(animationParameters.animationCharacterSet);
conn.openBlend(path.getWithExtension(_SYS_STR(".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 {};
if (aabbOut.min.x() > aabbOut.max.x())
return {};
zeus::CTransform xf = ConvertEditorEulerToTransform4f(scale, orientation, location);
return aabbOut.getTransformedAABox(xf);
zeus::CTransform xf = ConvertEditorEulerToTransform4f(scale, orientation, location);
return aabbOut.getTransformedAABox(xf);
}
}
} // namespace DataSpec::DNAMP1