mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-09 05:07:43 +00:00
Implement CStateManager::Update
This commit is contained in:
@@ -3,23 +3,24 @@
|
||||
|
||||
#include "RetroTypes.hpp"
|
||||
#include "zeus/CAABox.hpp"
|
||||
#include "Collision/CMaterialFilter.hpp"
|
||||
|
||||
namespace urde
|
||||
{
|
||||
enum ESortedList
|
||||
{
|
||||
Zero,
|
||||
One,
|
||||
Two,
|
||||
Three,
|
||||
Four,
|
||||
Five
|
||||
MinX,
|
||||
MinY,
|
||||
MinZ,
|
||||
MaxX,
|
||||
MaxY,
|
||||
MaxZ
|
||||
};
|
||||
|
||||
struct SSortedList
|
||||
{
|
||||
TUniqueId x0_ids[1024];
|
||||
u32 x800_;
|
||||
u32 x800_size;
|
||||
void Reset() {std::fill(std::begin(x0_ids), std::end(x0_ids), kInvalidUniqueId);}
|
||||
SSortedList() {Reset();}
|
||||
};
|
||||
@@ -29,24 +30,38 @@ class CSortedListManager
|
||||
{
|
||||
struct SNode
|
||||
{
|
||||
u32 x0_ = 0;
|
||||
const CActor* x0_actor = nullptr;
|
||||
zeus::CAABox x4_box = zeus::CAABox::skNullBox;
|
||||
u16 x1c_;
|
||||
u16 x1e_;
|
||||
u16 x20_;
|
||||
u16 x22_;
|
||||
u16 x24_;
|
||||
u16 x26_;
|
||||
u16 x28_ = -1;
|
||||
bool x2a_full = false;
|
||||
u16 x1c_selfIdxs[6] = {-1, -1, -1, -1, -1, -1};
|
||||
TUniqueId x28_next = kInvalidUniqueId;
|
||||
bool x2a_populated = false;
|
||||
SNode() = default;
|
||||
SNode(const CActor* act, const zeus::CAABox& aabb)
|
||||
: x0_actor(act), x4_box(aabb), x2a_populated(true) {}
|
||||
};
|
||||
SNode x0_nodes[1024];
|
||||
SSortedList xb000_sortedLists[6];
|
||||
void Reset();
|
||||
void AddToLinkedList(TUniqueId a, TUniqueId& b, TUniqueId& c) const;
|
||||
void RemoveFromList(ESortedList, s16);
|
||||
void MoveInList(ESortedList, s16);
|
||||
void InsertInList(ESortedList, SNode& node);
|
||||
s16 FindInListUpper(ESortedList, float) const;
|
||||
s16 FindInListLower(ESortedList, float) const;
|
||||
TUniqueId ConstructIntersectionArray(const zeus::CAABox&);
|
||||
TUniqueId CalculateIntersections(ESortedList, ESortedList, s16, s16, s16, s16,
|
||||
ESortedList, ESortedList, ESortedList, ESortedList, const zeus::CAABox&);
|
||||
public:
|
||||
CSortedListManager();
|
||||
void Reset();
|
||||
void RemoveFromList(ESortedList, s16);
|
||||
void BuildNearList(rstl::reserved_vector<TUniqueId, 1024>&, const zeus::CVector3f&, const zeus::CVector3f&,
|
||||
float, const CMaterialFilter&, const CActor*) const;
|
||||
void BuildNearList(rstl::reserved_vector<TUniqueId, 1024>&, const CActor&, const zeus::CAABox&) const;
|
||||
void BuildNearList(rstl::reserved_vector<TUniqueId, 1024>&, const zeus::CAABox&,
|
||||
const CMaterialFilter&, const CActor*) const;
|
||||
void Remove(const CActor*);
|
||||
void Move(const CActor* act, const zeus::CAABox& aabb);
|
||||
void Insert(const CActor* act, const zeus::CAABox& aabb);
|
||||
bool ActorInLists(const CActor* act) const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user