mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-14 22:06:10 +00:00
CCollisionSurface: Return std::array by reference from GetVerts()
Same behavior, facilitates better static analysis for out-of-bounds accesses, and also even allows size querying if necessary.
This commit is contained in:
@@ -9,7 +9,11 @@
|
||||
|
||||
namespace urde {
|
||||
class CCollisionSurface {
|
||||
std::array<zeus::CVector3f, 3> x0_data;
|
||||
public:
|
||||
using Vertices = std::array<zeus::CVector3f, 3>;
|
||||
|
||||
private:
|
||||
Vertices x0_data;
|
||||
u32 x24_flags;
|
||||
|
||||
public:
|
||||
@@ -17,7 +21,7 @@ public:
|
||||
|
||||
zeus::CVector3f GetNormal() const;
|
||||
const zeus::CVector3f& GetVert(s32 idx) const { return x0_data[idx]; }
|
||||
const zeus::CVector3f* GetVerts() const { return x0_data.data(); }
|
||||
const Vertices& GetVerts() const { return x0_data; }
|
||||
zeus::CPlane GetPlane() const;
|
||||
u32 GetSurfaceFlags() const { return x24_flags; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user