From ab4278c2725d7ca155a2dd8528d3b9fdb59cf5dc Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 24 May 2026 15:07:40 +0200 Subject: [PATCH] feat(phys): add ShadowShape record (no callers yet) Standalone record representing one collision-bearing shape attached to a logical PhysicsObj. Foundation for the per-part BSP collision fix that closes the M1.5 "doors don't block" bug. Spec at docs/superpowers/specs/2026-05-24-door-collision-per-part-bsp-design.md. No callers in this commit; integration follows in subsequent commits. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/AcDream.Core/Physics/ShadowShape.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/AcDream.Core/Physics/ShadowShape.cs diff --git a/src/AcDream.Core/Physics/ShadowShape.cs b/src/AcDream.Core/Physics/ShadowShape.cs new file mode 100644 index 0000000..ccb81bb --- /dev/null +++ b/src/AcDream.Core/Physics/ShadowShape.cs @@ -0,0 +1,25 @@ +using System.Numerics; + +namespace AcDream.Core.Physics; + +/// +/// One collision-bearing shape attached to a logical PhysicsObj. +/// A door emits 3-4 (CylSphere(s) + Sphere(s) + Part-BSPs); a creature +/// may emit a few; a simple item zero. Positions and rotations are +/// LOCAL to the entity's origin so +/// can re-transform them when the entity moves. +/// +/// +/// Retail anchor: CPhysicsPart + CPhysicsPart::find_obj_collisions +/// at acclient_2013_pseudo_c.txt:275045-275055. Each part stores its +/// own transform and dispatches per-part collision to its GfxObj. +/// +/// +public readonly record struct ShadowShape( + uint GfxObjId, + Vector3 LocalPosition, + Quaternion LocalRotation, + float Scale, + ShadowCollisionType CollisionType, + float Radius, + float CylHeight);