ksys/phys: Add 3 easy RigidBody functions and fix some types

This commit is contained in:
Léo Lam 2022-01-11 19:25:09 +01:00
parent 51c3397965
commit 88921dbd7a
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
4 changed files with 81 additions and 9 deletions

View File

@ -82967,14 +82967,14 @@ Address,Quality,Size,Name
0x0000007100f8ca50,U,000584,
0x0000007100f8cc98,U,000172,phys::RigidBody::x_0
0x0000007100f8cd44,U,000552,phys::RigidBody::initMotion
0x0000007100f8cf6c,U,000052,phys::RigidBody::x
0x0000007100f8cf6c,O,000052,_ZNK4ksys4phys9RigidBody7getNameEv
0x0000007100f8cfa0,U,000424,
0x0000007100f8d148,O,000144,_ZN4ksys4phys9RigidBody13setMotionFlagENS1_10MotionFlagE
0x0000007100f8d1d8,U,000032,
0x0000007100f8d1d8,O,000032,_ZNK4ksys4phys9RigidBody8isActiveEv
0x0000007100f8d1f8,O,000012,_ZNK4ksys4phys9RigidBody14sub_7100F8D1F8Ev
0x0000007100f8d204,O,000012,_ZNK4ksys4phys9RigidBody14sub_7100F8D204Ev
0x0000007100f8d210,O,000012,_ZNK4ksys4phys9RigidBody14sub_7100F8D210Ev
0x0000007100f8d21c,m,000236,_ZN4ksys4phys9RigidBody14sub_7100F8D21CEv
0x0000007100f8d21c,O,000236,_ZN4ksys4phys9RigidBody14sub_7100F8D21CEv
0x0000007100f8d308,U,000888,
0x0000007100f8d680,U,000140,
0x0000007100f8d70c,U,000156,

Can't render this file because it is too large.

View File

@ -26,6 +26,13 @@ RigidBody::RigidBody(u32 a, u32 mass_scaling, hkpRigidBody* hk_body, const sead:
mFlags.set(Flag::_100);
}
sead::SafeString RigidBody::getName() const {
const char* name = mHkBody->getName();
if (!name)
return sead::SafeString::cEmptyString;
return name;
}
void RigidBody::setMotionFlag(MotionFlag flag) {
auto lock = sead::makeScopedLock(mCS);
@ -38,6 +45,10 @@ void RigidBody::setMotionFlag(MotionFlag flag) {
}
}
bool RigidBody::isActive() const {
return mHkBody->isActive();
}
bool RigidBody::sub_7100F8D1F8() const {
return mFlags.isOn(Flag::_8);
}
@ -50,8 +61,10 @@ bool RigidBody::sub_7100F8D210() const {
return mMotionFlags.isOn(MotionFlag::_2);
}
// NON_MATCHING: mFlags is loaded differently
void RigidBody::sub_7100F8D21C() {
// debug code that survived because mFlags is atomic?
static_cast<void>(mFlags.isOn(Flag::_8));
auto lock = sead::makeScopedLock(mCS);
if (mMotionFlags.isOn(MotionFlag::_1)) {

View File

@ -17,6 +17,8 @@ class hkpMotion;
namespace ksys::phys {
class MotionAccessor;
class RigidContactPoints;
class UserTag;
class RigidBase {
public:
@ -56,7 +58,7 @@ public:
virtual void m5();
virtual void m6();
virtual void m7();
virtual void m8();
virtual void m8(float);
// FIXME: should be pure
virtual void m9();
virtual void m10();
@ -65,14 +67,71 @@ public:
virtual void m13();
virtual void m14();
void sub_7100F8CFA0();
// 0x0000007100f8ca50
bool initMotionAccessor(sead::Heap* heap);
// 0x0000007100f8cc98
void initMotionAndAccessor();
// 0x0000007100f8cd44
void initMotion();
sead::SafeString getName() const;
// 0x0000007100f8cfa0
void x_0();
void setMotionFlag(MotionFlag);
bool isActive() const;
// 0x0000007100f8d1f8
bool sub_7100F8D1F8() const;
// 0x0000007100f8d204
bool sub_7100F8D204() const;
// 0x0000007100f8d210
bool sub_7100F8D210() const;
// 0x0000007100f8d21c
void sub_7100F8D21C();
void sub_7100F8D680();
// 0x0000007100f8d308
bool x_6();
// 0x0000007100f8d680
// FIXME: rename after we figure out what the two types of MotionAccessor are
MotionAccessor* getMotionAccessorType1();
// 0x0000007100f8d70c
void* getMotionAccessorType2Stuff();
// 0x0000007100f8d7a8
void motionAccessorType2Stuff2();
// 0x0000007100f8d840
void x_8();
MotionType getMotionInfo() const;
// Motion functions
// 0x0000007100f8dcfc
void x_9();
// 0x0000007100f8e110
void x_10();
// 0x0000007100f8e3fc
void x_11();
// 0x0000007100f8e72c
void x_12();
// 0x0000007100f8e7b4
void setContactPoints(RigidContactPoints* points);
// 0x0000007100f8e7e8
void x_13(bool a, bool b);
// 0x0000007100f8e8f0
void x_14(bool a, bool b, bool c);
// 0x0000007100f8eabc
void x_15(bool a, bool b);
// 0x0000007100f8ec3c
bool setLinearVelocityMaybe(const sead::Vector3f& velocity, float x);
// 0x0000007100f8ed74
bool setAngularVelocityMaybe(const sead::Vector3f& velocity, float x);
// 0x0000007100f8ee38
void x_16();
u32 addContactLayer(ContactLayer);
u32 removeContactLayer(ContactLayer);
void setContactMask(u32);
@ -96,7 +155,7 @@ private:
sead::TypedBitFlag<MotionFlag, sead::Atomic<u32>> mMotionFlags{};
sead::BitFlag32 mContactMask{};
hkpRigidBody* mHkBody;
void* mActor = nullptr;
UserTag* mUserTag = nullptr;
void* _88 = nullptr;
void* _90 = nullptr;
u16 _98 = 0;

View File

@ -81,7 +81,7 @@ void InstanceSet::sub_7100FBA9BC() {
}
for (auto& body : mList) {
body->sub_7100F8CFA0();
body->x_0();
}
if (mCollisionController != nullptr)