mirror of
https://github.com/zeldaret/botw
synced 2026-05-30 00:46:35 -04:00
ksys/phys: ContactPointInfoEx -> ContactLayerContactPointInfo
Turns out it's the equivalent to ContactLayerCollisionInfo.
This commit is contained in:
@@ -113,8 +113,8 @@ target_sources(uking PRIVATE
|
||||
System/physContactMgr.h
|
||||
System/physContactPointInfo.cpp
|
||||
System/physContactPointInfo.h
|
||||
System/physContactPointInfoEx.cpp
|
||||
System/physContactPointInfoEx.h
|
||||
System/physLayerContactPointInfo.cpp
|
||||
System/physLayerContactPointInfo.h
|
||||
System/physEntityGroupFilter.cpp
|
||||
System/physEntityGroupFilter.h
|
||||
System/physGroupFilter.cpp
|
||||
|
||||
@@ -27,7 +27,7 @@ RigidBodyRequestMgr::~RigidBodyRequestMgr() {
|
||||
mMotionAccessors.freeBuffer();
|
||||
|
||||
if (mContactPoints) {
|
||||
ksys::phys::ContactPointInfoEx::free(mContactPoints);
|
||||
ksys::phys::LayerContactPointInfo::free(mContactPoints);
|
||||
mContactPoints = nullptr;
|
||||
}
|
||||
}
|
||||
@@ -62,7 +62,7 @@ void RigidBodyRequestMgr::init(sead::Heap* heap) {
|
||||
mNumEntitiesInWorld = 0;
|
||||
|
||||
mContactPoints =
|
||||
ContactPointInfoEx::make(heap, 0x1000, 11, "RigidBodyRequestMgr::Water", 0, 0, 0);
|
||||
LayerContactPointInfo::make(heap, 0x1000, 11, "RigidBodyRequestMgr::Water", 0, 0, 0);
|
||||
|
||||
mContactPoints->setCallback(&mCallback);
|
||||
mContactPoints->set30(1);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
#include <prim/seadDelegate.h>
|
||||
#include <thread/seadAtomic.h>
|
||||
#include <thread/seadCriticalSection.h>
|
||||
#include "KingSystem/Physics/System/physContactPointInfoEx.h"
|
||||
#include "KingSystem/Physics/System/physLayerContactPointInfo.h"
|
||||
#include "KingSystem/Physics/physDefines.h"
|
||||
#include "KingSystem/Utils/Container/LockFreeQueue.h"
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
@@ -84,7 +84,7 @@ private:
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(Unk6, 0x48);
|
||||
|
||||
struct PointCallback : ContactPointInfoEx::Callback {
|
||||
struct PointCallback : LayerContactPointInfo::Callback {
|
||||
explicit PointCallback(RigidBodyRequestMgr* mgr_) : mgr(mgr_) {}
|
||||
void invoke(void* arg) override { mgr->someFunction2(arg); }
|
||||
|
||||
@@ -112,7 +112,7 @@ private:
|
||||
sead::Atomic<u32> _130;
|
||||
sead::Buffer<Unk4> _138;
|
||||
u32 mNumEntitiesInWorld{};
|
||||
ContactPointInfoEx* mContactPoints{};
|
||||
LayerContactPointInfo* mContactPoints{};
|
||||
sead::SafeArray<sead::CriticalSection, NumRigidBodyBuffers> mCriticalSections;
|
||||
sead::CriticalSection mCS;
|
||||
float _218 = 1.0;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
+20
-17
@@ -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()) {}
|
||||
|
||||
+7
-7
@@ -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
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user