2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 17:47:42 +00:00

Add trigger visualization to inspecter

This commit is contained in:
2021-05-27 01:30:40 -07:00
committed by Luke Street
parent acb827a3b5
commit 0a76ee1ae2
5 changed files with 39 additions and 4 deletions

View File

@@ -30,7 +30,8 @@ CScriptTrigger::CScriptTrigger(TUniqueId uid, std::string_view name, const CEnti
// FIXME: HACK This fixes the HotE softlock, definitely need to look into the morphball's collision codepath and
// FIXME: determine the proper fix
if (GetEditorId() == 0x0034004B) {
Log.report(logvisor::Warning, FMT_STRING("BUG THIS!: Overriding forceField.x() for trigger {} in area {}"), GetEditorId(), GetAreaIdAlways());
Log.report(logvisor::Warning, FMT_STRING("BUG THIS!: Overriding forceField.x() for trigger {} in area {}"),
GetEditorId(), GetAreaIdAlways());
x11c_forceField.x() = 0.f;
}
#endif
@@ -307,4 +308,11 @@ void CScriptTrigger::Touch(CActor& act, CStateManager& mgr) {
zeus::CAABox CScriptTrigger::GetTriggerBoundsWR() const {
return {x130_bounds.min + x34_transform.origin, x130_bounds.max + x34_transform.origin};
}
void CScriptTrigger::DebugDraw() {
if (m_debugSelected || m_debugHovered) {
m_debugBox.setAABB(GetTriggerBoundsWR());
m_debugBox.draw(m_debugAddColor);
}
}
} // namespace metaforce