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

Implement CParticleGenInfoGeneric

This commit is contained in:
2017-01-20 22:03:37 -08:00
parent 00247ca53e
commit 362fb6b00d
32 changed files with 268 additions and 146 deletions

View File

@@ -1152,41 +1152,41 @@ void CElementGen::BuildParticleSystemBounds()
for (std::unique_ptr<CElementGen>& ch : x234_activePartChildren)
{
std::pair<zeus::CAABox, bool> chBounds = ch->GetBounds();
if (chBounds.second)
auto chBounds = ch->GetBounds();
if (chBounds)
{
accumulated = true;
aabb.accumulateBounds(chBounds.first);
aabb.accumulateBounds(chBounds.value());
}
}
for (std::unique_ptr<CElementGen>& ch : x248_finishPartChildren)
{
std::pair<zeus::CAABox, bool> chBounds = ch->GetBounds();
if (chBounds.second)
auto chBounds = ch->GetBounds();
if (chBounds)
{
accumulated = true;
aabb.accumulateBounds(chBounds.first);
aabb.accumulateBounds(chBounds.value());
}
}
for (std::unique_ptr<CParticleSwoosh>& ch : x260_swhcChildren)
{
std::pair<zeus::CAABox, bool> chBounds = ch->GetBounds();
if (chBounds.second)
auto chBounds = ch->GetBounds();
if (chBounds)
{
accumulated = true;
aabb.accumulateBounds(chBounds.first);
aabb.accumulateBounds(chBounds.value());
}
}
for (std::unique_ptr<CParticleElectric>& ch : x280_elscChildren)
{
std::pair<zeus::CAABox, bool> chBounds = ch->GetBounds();
if (chBounds.second)
auto chBounds = ch->GetBounds();
if (chBounds)
{
accumulated = true;
aabb.accumulateBounds(chBounds.first);
aabb.accumulateBounds(chBounds.value());
}
}
@@ -2245,12 +2245,12 @@ bool CElementGen::IsSystemDeletable() const
return false;
}
std::pair<zeus::CAABox, bool> CElementGen::GetBounds() const
rstl::optional_object<zeus::CAABox> CElementGen::GetBounds() const
{
if (GetParticleCountAll() == 0)
return {zeus::CAABox(), false};
return {zeus::CAABox()};
else
return {x2c4_systemBounds, true};
return {x2c4_systemBounds};
}
u32 CElementGen::GetParticleCount() const