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

CActorContraption fixes, better CMake dependency handling

This commit is contained in:
Jack Andersen
2019-06-11 16:05:17 -10:00
parent 77d0ef942d
commit e218b8aeb5
295 changed files with 942 additions and 2219 deletions

View File

@@ -1498,7 +1498,7 @@ void CStateManager::ProcessRadiusDamage(const CActor& damager, CActor& damagee,
void CStateManager::ApplyRadiusDamage(const CActor& a1, const zeus::CVector3f& pos, CActor& a2,
const CDamageInfo& info) {
zeus::CVector3f delta = a2.GetTranslation() - pos;
rstl::optional<zeus::CAABox> bounds;
std::optional<zeus::CAABox> bounds;
if (delta.magSquared() < info.GetRadius() * info.GetRadius() ||
((bounds = a2.GetTouchBounds()) &&
CCollidableSphere::Sphere_AABox_Bool(zeus::CSphere{pos, info.GetRadius()}, *bounds))) {
@@ -1548,7 +1548,7 @@ bool CStateManager::TestRayDamage(const zeus::CVector3f& pos, const CActor& dama
EMaterialTypes::Occluder, EMaterialTypes::Character);
static const CMaterialFilter filter(incList, exList, CMaterialFilter::EFilterType::IncludeExclude);
rstl::optional<zeus::CAABox> bounds = damagee.GetTouchBounds();
std::optional<zeus::CAABox> bounds = damagee.GetTouchBounds();
if (!bounds)
return false;
@@ -2052,7 +2052,7 @@ void CStateManager::CrossTouchActors() {
CActor& actor = static_cast<CActor&>(*ent);
if (!actor.GetActive() || !actor.GetCallTouch())
continue;
rstl::optional<zeus::CAABox> touchAABB = actor.GetTouchBounds();
std::optional<zeus::CAABox> touchAABB = actor.GetTouchBounds();
if (!touchAABB)
continue;
@@ -2068,7 +2068,7 @@ void CStateManager::CrossTouchActors() {
if (!ent2)
continue;
rstl::optional<zeus::CAABox> touchAABB2 = ent2->GetTouchBounds();
std::optional<zeus::CAABox> touchAABB2 = ent2->GetTouchBounds();
if (!ent2->GetActive() || !touchAABB2)
continue;
@@ -2339,7 +2339,7 @@ void CStateManager::UpdateActorInSortedLists(CActor& act) {
if (!act.GetUseInSortedLists() || !act.xe4_27_notInSortedLists)
return;
rstl::optional<zeus::CAABox> aabb = CalculateObjectBounds(act);
std::optional<zeus::CAABox> aabb = CalculateObjectBounds(act);
bool actorInLists = x874_sortedListManager->ActorInLists(&act);
if (actorInLists || aabb) {
act.xe4_27_notInSortedLists = false;
@@ -2362,8 +2362,8 @@ void CStateManager::UpdateSortedLists() {
UpdateActorInSortedLists(static_cast<CActor&>(*actor));
}
rstl::optional<zeus::CAABox> CStateManager::CalculateObjectBounds(const CActor& actor) {
rstl::optional<zeus::CAABox> bounds = actor.GetTouchBounds();
std::optional<zeus::CAABox> CStateManager::CalculateObjectBounds(const CActor& actor) {
std::optional<zeus::CAABox> bounds = actor.GetTouchBounds();
if (bounds) {
zeus::CAABox aabb;
aabb.accumulateBounds(bounds->min);