mirror of
https://github.com/zeldaret/botw
synced 2026-09-07 19:10:49 -04:00
ksys: Start adding PhysicsUserTag
This commit is contained in:
@@ -107,6 +107,8 @@ target_sources(uking PRIVATE
|
||||
actInstParamPack.cpp
|
||||
actInstParamPack.h
|
||||
actLifeRecoveryInfo.h
|
||||
actPhysicsUserTag.cpp
|
||||
actPhysicsUserTag.h
|
||||
actPlayerInfo.cpp
|
||||
actPlayerInfo.h
|
||||
actTag.h
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
#include "KingSystem/ActorSystem/actPhysicsUserTag.h"
|
||||
#include "KingSystem/ActorSystem/actActor.h"
|
||||
#include "KingSystem/ActorSystem/actActorLinkConstDataAccess.h"
|
||||
#include "KingSystem/ActorSystem/actBaseProcMgr.h"
|
||||
|
||||
namespace ksys::act {
|
||||
|
||||
PhysicsUserTag::PhysicsUserTag(Actor* actor) : mActor(actor) {}
|
||||
|
||||
PhysicsUserTag::~PhysicsUserTag() = default;
|
||||
|
||||
Actor* PhysicsUserTag::getActor(ActorLinkConstDataAccess* accessor, Actor* other_actor) const {
|
||||
if (mActor != nullptr) {
|
||||
if (mActor != other_actor && !BaseProcMgr::instance()->isAccessingProcSafe(mActor, nullptr))
|
||||
return mActor;
|
||||
if (!acquireProc(accessor, mActor, "act::PhysicsUserTag"))
|
||||
return nullptr;
|
||||
}
|
||||
return mActor;
|
||||
}
|
||||
|
||||
bool PhysicsUserTag::acquireActor(ActorLinkConstDataAccess* accessor) const {
|
||||
return accessor->acquire(mActor);
|
||||
}
|
||||
|
||||
const sead::SafeString& PhysicsUserTag::getName() const {
|
||||
return mActor->getName();
|
||||
}
|
||||
|
||||
const sead::SafeString& PhysicsUserTag::getName2() const {
|
||||
return getName();
|
||||
}
|
||||
|
||||
} // namespace ksys::act
|
||||
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
|
||||
#include "KingSystem/Physics/System/physUserTag.h"
|
||||
#include "KingSystem/Utils/Types.h"
|
||||
|
||||
namespace ksys::act {
|
||||
|
||||
class Actor;
|
||||
class ActorLinkConstDataAccess;
|
||||
|
||||
class PhysicsUserTag : public phys::UserTag {
|
||||
SEAD_RTTI_OVERRIDE(PhysicsUserTag, phys::UserTag)
|
||||
|
||||
public:
|
||||
explicit PhysicsUserTag(Actor* actor);
|
||||
~PhysicsUserTag() override;
|
||||
|
||||
Actor* getActor(ActorLinkConstDataAccess* accessor, Actor* other_actor) const;
|
||||
bool acquireActor(ActorLinkConstDataAccess* accessor) const;
|
||||
|
||||
void m2(void* a) override;
|
||||
void m3(void* a, void* b, float c) override;
|
||||
void m4() override;
|
||||
void m5() override;
|
||||
const sead::SafeString& getName() const override;
|
||||
void m7() override;
|
||||
const sead::SafeString& getName2() const override;
|
||||
|
||||
private:
|
||||
Actor* mActor = nullptr;
|
||||
int _10 = -1;
|
||||
u16 _14 = 0;
|
||||
};
|
||||
KSYS_CHECK_SIZE_NX150(PhysicsUserTag, 0x18);
|
||||
|
||||
} // namespace ksys::act
|
||||
Reference in New Issue
Block a user