summaryrefslogtreecommitdiff
path: root/src/00_Core/Actor/Actor.cpp
diff options
context:
space:
mode:
authorAetias <aetias@outlook.com>2024-05-23 22:59:14 +0200
committerAetias <aetias@outlook.com>2024-05-23 22:59:14 +0200
commit0019a6751f0258e3e291f420d8a973fa0ef079c7 (patch)
tree856b61411e8ca0679db29e453a6513d7d52b327d /src/00_Core/Actor/Actor.cpp
parent66cd1914feeefe9b5c6f645bbb0cdd06b6bc601a (diff)
Decomp `Actor`
Diffstat (limited to 'src/00_Core/Actor/Actor.cpp')
-rw-r--r--src/00_Core/Actor/Actor.cpp48
1 files changed, 30 insertions, 18 deletions
diff --git a/src/00_Core/Actor/Actor.cpp b/src/00_Core/Actor/Actor.cpp
index 36b9cf57..7c8499cc 100644
--- a/src/00_Core/Actor/Actor.cpp
+++ b/src/00_Core/Actor/Actor.cpp
@@ -496,24 +496,36 @@ bool Actor::func_ov00_020c243c(ActorTypeId *actorTypes, Actor **result) {
return false;
}
-bool Actor::CollidesWith(const Actor *other) {
- // bool collides = false;
- // if (other->mAlive) {
- // if (other->mHitbox.size >= 0 && mHitbox.size >= 0) {
- // Cylinder a, b;
- // this->GetHitbox(&a);
- // other->GetHitbox(&b);
- // if (a.Overlaps(&b)) {
- // collides = true;
- // }
- // }
- // }
- // return collides;
-}
-
-bool Actor::func_ov00_020c27a8(unk32 param1) {}
-bool Actor::CollidesWithLink() {}
-bool Actor::IsFollowedByLink() {}
+bool Actor::CollidesWith(Actor *other) {
+ bool collides = false;
+ if (other->mAlive) {
+ if (other->mHitbox.size >= 0 && mHitbox.size >= 0) {
+ Cylinder a, b;
+ this->GetHitbox(&a);
+ other->GetHitbox(&b);
+ if (a.Overlaps(&b)) collides = true;
+ }
+ }
+ return collides;
+}
+
+bool Actor::func_ov00_020c27a8(unk32 param1) {
+ if (mUnk_11b) return false;
+ if (param1 == 0) return mUnk_12c != 0;
+ return mUnk_12c == param1;
+}
+
+bool Actor::CollidesWithLink() {
+ Cylinder hitbox;
+ this->GetHitbox(&hitbox);
+ // Link's hitbox has a radius of 1, hence why they add 1.0 here
+ return this->DistanceToLink() < hitbox.size + FLOAT_TO_Q20(1.0);
+}
+
+bool Actor::IsFollowedByLink() {
+ // return mRef.id == gPlayerControl->mFollowRef.id;
+}
+
void Actor::StopLinkFollow() {}
bool Actor::IsGrabbed() {}
s32 Actor::XzDistanceTo(Vec3p *vec) {}