metaforce/Runtime/Collision/CCollisionInfoList.hpp

37 lines
1.2 KiB
C++
Raw Normal View History

2018-10-07 03:42:33 +00:00
#pragma once
#include "Runtime/RetroTypes.hpp"
#include "Runtime/rstl.hpp"
#include "Runtime/Collision/CCollisionInfo.hpp"
2018-12-08 05:30:43 +00:00
namespace urde {
class CCollisionInfoList {
rstl::reserved_vector<CCollisionInfo, 32> x0_list;
public:
2018-12-08 05:30:43 +00:00
CCollisionInfoList() = default;
2018-12-08 05:30:43 +00:00
void GetAverageLeftNormal() const;
void GetAveragePoint() const;
void GetUnionOfAllLeftMaterials() const;
size_t GetCount() const { return x0_list.size(); }
void Swap(s32);
2018-12-08 05:30:43 +00:00
void Add(const CCollisionInfo& info, bool swap) {
if (x0_list.size() == 32)
return;
if (!swap)
x0_list.push_back(info);
else
x0_list.push_back(info.GetSwapped());
}
void Clear() { x0_list.clear(); }
const CCollisionInfo& Front() const { return x0_list.front(); }
const CCollisionInfo& GetItem(int i) const { return x0_list[i]; }
rstl::reserved_vector<CCollisionInfo, 32>::iterator end() { return x0_list.end(); }
rstl::reserved_vector<CCollisionInfo, 32>::const_iterator end() const { return x0_list.end(); }
rstl::reserved_vector<CCollisionInfo, 32>::iterator begin() { return x0_list.begin(); }
rstl::reserved_vector<CCollisionInfo, 32>::const_iterator begin() const { return x0_list.begin(); }
};
2018-12-08 05:30:43 +00:00
} // namespace urde