summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLéo Lam <leo@leolam.fr>2026-09-24 23:59:56 +0200
committerGitHub <noreply@github.com>2026-09-24 23:59:56 +0200
commitde0a313d16eee61bf9709b6a0185bfab62c08984 (patch)
treece14c33b8221ffdea96c57c6fb0c714920c0b66f /src
parent22b09dcc18b0c15000ecea5784b054fe7e6e1937 (diff)
parent8495c4214b345b97f83295cb8fb1df6caf42841a (diff)
Merge pull request #198 from tarun-bandi/docs/contact-point-callback-contract
Document ContactPointInfo callback contract
Diffstat (limited to 'src')
-rw-r--r--src/KingSystem/Physics/System/physContactPointInfo.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/KingSystem/Physics/System/physContactPointInfo.h b/src/KingSystem/Physics/System/physContactPointInfo.h
index 450a2de0..16e63389 100644
--- a/src/KingSystem/Physics/System/physContactPointInfo.h
+++ b/src/KingSystem/Physics/System/physContactPointInfo.h
@@ -88,7 +88,10 @@ public:
No = false,
};
+ /// Contact data passed to ContactCallback. The vector and collision-mask pointers are borrowed
+ /// for the duration of the callback; copy their values if they are needed afterwards.
struct Event {
+ /// The other rigid body in the contact, rather than the body receiving the callback.
RigidBody* body;
const sead::Vector3f* position;
const sead::Vector3f* separating_normal;
@@ -133,6 +136,12 @@ public:
const ContactPoint* const* mPointsStart = nullptr;
};
+ /// The output parameter starts at ShouldDisableContact::No. Set it to Yes to request that the
+ /// physical contact be disabled, independently of the return value.
+ ///
+ /// When called by ContactMgr::registerContactPoint, return false to skip recording the point,
+ /// or true to allow recording (subject to available storage). ContactListener's manifold
+ /// callback ignores the return value and only checks the ShouldDisableContact output.
using ContactCallback = sead::IDelegate2R<ShouldDisableContact*, const Event&, bool>;
static ContactPointInfo* make(sead::Heap* heap, int num, const sead::SafeString& name, int a,