2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 19:07:44 +00:00

Initial CBabygoth imps

This commit is contained in:
2018-12-31 00:37:52 -08:00
parent 147a9396c4
commit 4f3c8daf27
22 changed files with 604 additions and 94 deletions

View File

@@ -186,4 +186,23 @@ zeus::CTransform CCollisionActorManager::GetWRLocatorTransform(const CAnimData&
return locXf;
}
std::optional<zeus::CVector3f> CCollisionActorManager::GetDeviation(const CStateManager& mgr, CSegId seg) {
for (const CJointCollisionDescription& desc : x0_jointDescriptions) {
if (desc.GetPivotId() != seg)
continue;
if (TCastToConstPtr<CActor> act = mgr.GetObjectById(x10_ownerId)) {
if (TCastToConstPtr<CCollisionActor> colAct = mgr.GetObjectById(desc.GetCollisionActorId())) {
zeus::CTransform xf = GetWRLocatorTransform(*act->GetModelData()->GetAnimationData(), desc.GetPivotId(),
act->GetTransform(),
zeus::CTransform::Scale(act->GetModelData()->GetScale()));
return {colAct->GetTranslation() - xf.origin};
}
}
}
return {};
}
} // namespace urde