summaryrefslogtreecommitdiff
path: root/src/KingSystem/Physics/System
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2022-03-02 01:18:25 +0100
committerLéo Lam <leo@leolam.fr>2022-03-02 01:25:11 +0100
commitb2a66ca8586d435dc417d0d9aa65e6b445fe9855 (patch)
treeef64560ad069e99e7773ab905671222b3b8ea163 /src/KingSystem/Physics/System
parent220cb534689303a2ef4df51a41b6142cfe9b7ee2 (diff)
ksys/phys: ContactPointInfoEx -> ContactLayerContactPointInfo
Turns out it's the equivalent to ContactLayerCollisionInfo.
Diffstat (limited to 'src/KingSystem/Physics/System')
-rw-r--r--src/KingSystem/Physics/System/physContactMgr.cpp10
-rw-r--r--src/KingSystem/Physics/System/physContactMgr.h6
-rw-r--r--src/KingSystem/Physics/System/physLayerContactPointInfo.cpp (renamed from src/KingSystem/Physics/System/physContactPointInfoEx.cpp)37
-rw-r--r--src/KingSystem/Physics/System/physLayerContactPointInfo.h (renamed from src/KingSystem/Physics/System/physContactPointInfoEx.h)14
-rw-r--r--src/KingSystem/Physics/System/physSystem.cpp6
-rw-r--r--src/KingSystem/Physics/System/physSystem.h12
6 files changed, 44 insertions, 41 deletions
diff --git a/src/KingSystem/Physics/System/physContactMgr.cpp b/src/KingSystem/Physics/System/physContactMgr.cpp
index 43735edd..02b76086 100644
--- a/src/KingSystem/Physics/System/physContactMgr.cpp
+++ b/src/KingSystem/Physics/System/physContactMgr.cpp
@@ -1,9 +1,9 @@
#include "KingSystem/Physics/System/physContactMgr.h"
#include <prim/seadScopedLock.h>
#include "KingSystem/Physics/System/physContactPointInfo.h"
-#include "KingSystem/Physics/System/physContactPointInfoEx.h"
#include "KingSystem/Physics/System/physEntityGroupFilter.h"
#include "KingSystem/Physics/System/physGroupFilter.h"
+#include "KingSystem/Physics/System/physLayerContactPointInfo.h"
#include "KingSystem/Physics/System/physSystem.h"
namespace ksys::phys {
@@ -84,10 +84,10 @@ ContactPointInfo* ContactMgr::allocContactPoints(sead::Heap* heap, int num,
return points;
}
-ContactPointInfoEx* ContactMgr::allocContactPointsEx(sead::Heap* heap, int num, int num2,
- const sead::SafeString& name, int a, int b,
- int c) {
- auto* points = new (heap) ContactPointInfoEx(name, a, b, c);
+LayerContactPointInfo* ContactMgr::allocContactPointsEx(sead::Heap* heap, int num, int num2,
+ const sead::SafeString& name, int a, int b,
+ int c) {
+ auto* points = new (heap) LayerContactPointInfo(name, a, b, c);
points->allocPoints(heap, num, num2);
registerContactPointInfo(points);
return points;
diff --git a/src/KingSystem/Physics/System/physContactMgr.h b/src/KingSystem/Physics/System/physContactMgr.h
index 04b107dd..02e0c88c 100644
--- a/src/KingSystem/Physics/System/physContactMgr.h
+++ b/src/KingSystem/Physics/System/physContactMgr.h
@@ -27,7 +27,7 @@ enum class IsIndoorStage;
class ContactPointInfoBase;
class RigidBody;
class ContactPointInfo;
-class ContactPointInfoEx;
+class LayerContactPointInfo;
struct ContactInfoTable {
struct Receiver : agl::utl::ParameterObj {
@@ -83,8 +83,8 @@ public:
ContactPointInfo* allocContactPoints(sead::Heap* heap, int num, const sead::SafeString& name,
int a, int b, int c);
- ContactPointInfoEx* allocContactPointsEx(sead::Heap* heap, int num, int num2,
- const sead::SafeString& name, int a, int b, int c);
+ LayerContactPointInfo* allocContactPointsEx(sead::Heap* heap, int num, int num2,
+ const sead::SafeString& name, int a, int b, int c);
void registerContactPointInfo(ContactPointInfoBase* info);
void freeContactPointInfo(ContactPointInfoBase* info);
diff --git a/src/KingSystem/Physics/System/physContactPointInfoEx.cpp b/src/KingSystem/Physics/System/physLayerContactPointInfo.cpp
index 2f1851b4..881b4d08 100644
--- a/src/KingSystem/Physics/System/physContactPointInfoEx.cpp
+++ b/src/KingSystem/Physics/System/physLayerContactPointInfo.cpp
@@ -1,19 +1,21 @@
-#include "KingSystem/Physics/System/physContactPointInfoEx.h"
+#include "KingSystem/Physics/System/physLayerContactPointInfo.h"
#include "KingSystem/Physics/System/physContactMgr.h"
#include "KingSystem/Physics/System/physSystem.h"
namespace ksys::phys {
-ContactPointInfoEx* ContactPointInfoEx::make(sead::Heap* heap, int num, int num2,
- const sead::SafeString& name, int a, int b, int c) {
- return System::instance()->allocContactPointsEx(heap, num, num2, name, a, b, c);
+LayerContactPointInfo* LayerContactPointInfo::make(sead::Heap* heap, int num, int num2,
+ const sead::SafeString& name, int a, int b,
+ int c) {
+ return System::instance()->allocLayerContactPointInfo(heap, num, num2, name, a, b, c);
}
-void ContactPointInfoEx::free(ContactPointInfoEx* instance) {
- System::instance()->freeContactPointInfoEx(instance);
+void LayerContactPointInfo::free(LayerContactPointInfo* instance) {
+ System::instance()->freeLayerContactPointInfo(instance);
}
-bool ContactPointInfoEx::registerLayerPair(ContactLayer layer1, ContactLayer layer2, bool enabled) {
+bool LayerContactPointInfo::registerLayerPair(ContactLayer layer1, ContactLayer layer2,
+ bool enabled) {
if (mLayerType == ContactLayerType::Invalid)
mLayerType = getContactLayerType(layer1);
@@ -32,7 +34,7 @@ bool ContactPointInfoEx::registerLayerPair(ContactLayer layer1, ContactLayer lay
return true;
}
-bool ContactPointInfoEx::isPairUnknown(ContactLayer layer1, ContactLayer layer2) const {
+bool LayerContactPointInfo::isPairUnknown(ContactLayer layer1, ContactLayer layer2) const {
for (int i = 0; i < mLayerEntries.size(); ++i) {
const auto* entry = mLayerEntries[i];
if (int(layer1) == entry->layer1 && int(layer2) == entry->layer2)
@@ -43,23 +45,23 @@ bool ContactPointInfoEx::isPairUnknown(ContactLayer layer1, ContactLayer layer2)
return true;
}
-ContactPointInfoEx::ContactPointInfoEx(const sead::SafeString& name, int a, int b, int c)
+LayerContactPointInfo::LayerContactPointInfo(const sead::SafeString& name, int a, int b, int c)
: ContactPointInfoBase(name, a, b, c) {}
-ContactPointInfoEx::~ContactPointInfoEx() = default;
+LayerContactPointInfo::~LayerContactPointInfo() = default;
-void ContactPointInfoEx::allocPoints(sead::Heap* heap, int num, int num2) {
+void LayerContactPointInfo::allocPoints(sead::Heap* heap, int num, int num2) {
mPoints.allocBufferAssert(num, heap);
mLayerEntries.allocBuffer(num2, heap);
}
-void ContactPointInfoEx::freePoints() {
+void LayerContactPointInfo::freePoints() {
mPoints.freeBuffer();
mLayerEntries.freeBuffer();
}
-void ContactPointInfoEx::Iterator::getData(sead::Vector3f* out,
- ContactPointInfoEx::Iterator::Mode mode) const {
+void LayerContactPointInfo::Iterator::getData(sead::Vector3f* out,
+ LayerContactPointInfo::Iterator::Mode mode) const {
const float scale = getPoint()->scale;
out->e = getPoint()->_10.e;
@@ -87,13 +89,13 @@ void ContactPointInfoEx::Iterator::getData(sead::Vector3f* out,
}
sead::Vector3f
-ContactPointInfoEx::Iterator::getData(ContactPointInfoEx::Iterator::Mode mode) const {
+LayerContactPointInfo::Iterator::getData(LayerContactPointInfo::Iterator::Mode mode) const {
sead::Vector3f out;
getData(&out, mode);
return out;
}
-ContactPointInfoEx::Iterator::Iterator(const ContactPointInfoEx::Points& points, int count)
+LayerContactPointInfo::Iterator::Iterator(const LayerContactPointInfo::Points& points, int count)
: mPoints(points.getBufferPtr()), mPointsNum(count), mPointsStart(points.getBufferPtr()) {
for (int i = 0; i != count; ++i) {
if (!mPoints[i]->flags.isOn(ContactPoint::Flag::_1))
@@ -102,7 +104,8 @@ ContactPointInfoEx::Iterator::Iterator(const ContactPointInfoEx::Points& points,
}
}
-ContactPointInfoEx::IteratorEnd::IteratorEnd(const ContactPointInfoEx::Points& points, int count)
+LayerContactPointInfo::IteratorEnd::IteratorEnd(const LayerContactPointInfo::Points& points,
+ int count)
: mIdx(count), mPoints(points.getBufferPtr()), mPointsNum(count),
mPointsStart(points.getBufferPtr()) {}
diff --git a/src/KingSystem/Physics/System/physContactPointInfoEx.h b/src/KingSystem/Physics/System/physLayerContactPointInfo.h
index 42f2b4e5..953458f6 100644
--- a/src/KingSystem/Physics/System/physContactPointInfoEx.h
+++ b/src/KingSystem/Physics/System/physLayerContactPointInfo.h
@@ -12,7 +12,7 @@ namespace ksys::phys {
struct ContactPoint;
-class ContactPointInfoEx : public ContactPointInfoBase {
+class LayerContactPointInfo : public ContactPointInfoBase {
public:
using Points = sead::Buffer<ContactPoint*>;
@@ -83,12 +83,12 @@ public:
// FIXME: figure out the types
using Callback = sead::IDelegate1<void*>;
- static ContactPointInfoEx* make(sead::Heap* heap, int num, int num2,
- const sead::SafeString& name, int a, int b, int c);
- static void free(ContactPointInfoEx* instance);
+ static LayerContactPointInfo* make(sead::Heap* heap, int num, int num2,
+ const sead::SafeString& name, int a, int b, int c);
+ static void free(LayerContactPointInfo* instance);
- ContactPointInfoEx(const sead::SafeString& name, int a, int b, int c);
- ~ContactPointInfoEx() override;
+ LayerContactPointInfo(const sead::SafeString& name, int a, int b, int c);
+ ~LayerContactPointInfo() override;
void freePoints() override;
virtual void allocPoints(sead::Heap* heap, int num, int num2);
@@ -112,6 +112,6 @@ private:
ContactLayerType mLayerType = ContactLayerType::Invalid;
Callback* mCallback = nullptr;
};
-KSYS_CHECK_SIZE_NX150(ContactPointInfoEx, 0x88);
+KSYS_CHECK_SIZE_NX150(LayerContactPointInfo, 0x88);
} // namespace ksys::phys
diff --git a/src/KingSystem/Physics/System/physSystem.cpp b/src/KingSystem/Physics/System/physSystem.cpp
index 0ef11465..2efa20ae 100644
--- a/src/KingSystem/Physics/System/physSystem.cpp
+++ b/src/KingSystem/Physics/System/physSystem.cpp
@@ -57,9 +57,9 @@ void System::freeContactPointInfo(ContactPointInfo* info) const {
mContactMgr->freeContactPointInfo(info);
}
-ContactPointInfoEx* System::allocContactPointsEx(sead::Heap* heap, int num, int num2,
- const sead::SafeString& name, int a, int b,
- int c) const {
+LayerContactPointInfo* System::allocLayerContactPointInfo(sead::Heap* heap, int num, int num2,
+ const sead::SafeString& name, int a, int b,
+ int c) const {
return mContactMgr->allocContactPointsEx(heap, num, num2, name, a, b, c);
}
diff --git a/src/KingSystem/Physics/System/physSystem.h b/src/KingSystem/Physics/System/physSystem.h
index 12339455..9ad2a173 100644
--- a/src/KingSystem/Physics/System/physSystem.h
+++ b/src/KingSystem/Physics/System/physSystem.h
@@ -16,7 +16,7 @@ class MaterialTable;
class RigidBody;
class RigidBodyRequestMgr;
class ContactPointInfo;
-class ContactPointInfoEx;
+class LayerContactPointInfo;
class SystemData;
class SystemGroupHandler;
@@ -47,16 +47,16 @@ public:
int a, int b, int c) const;
void freeContactPointInfo(ContactPointInfo* info) const;
- ContactPointInfoEx* allocContactPointsEx(sead::Heap* heap, int num, int num2,
- const sead::SafeString& name, int a, int b,
- int c) const;
- void freeContactPointInfoEx(ContactPointInfoEx* info) const;
+ LayerContactPointInfo* allocLayerContactPointInfo(sead::Heap* heap, int num, int num2,
+ const sead::SafeString& name, int a, int b,
+ int c) const;
+ void freeLayerContactPointInfo(LayerContactPointInfo* info) const;
void registerContactPointInfo(ContactPointInfo* info) const;
// 0x000000710121696c
void registerCollisionInfo(CollisionInfo* info) const;
// 0x0000007101216974
- void registerContactPointLayerPair(ContactPointInfoEx* info, ContactLayer layer1,
+ void registerContactPointLayerPair(LayerContactPointInfo* info, ContactLayer layer1,
ContactLayer layer2, bool enabled);
// 0x00000071012169a4