docs(render): Phase A8.F — camera-collision implementation plan
Bite-sized TDD plan for the swept-sphere camera collision: CollideCamera flag, ICameraCollisionProbe + PhysicsCameraCollisionProbe (reuses ResolveWithTransition), RetailChaseCamera slot-in, GameWindow wiring, Camera-menu toggle, visual acceptance. Also refines the spec from planning findings: the InitPath +radius sphere-center offset (ToSpherePath/FromSpherePath z-shift) and the deterministic probe test scope (z-offset round-trip + cellId==0 guard; collision correctness rides the existing sweep suite + visual). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
9bdd50287b
commit
77a6331ecd
2 changed files with 643 additions and 11 deletions
|
|
@ -130,9 +130,13 @@ public interface ICameraCollisionProbe
|
|||
public Vector3 SweepEye(Vector3 pivot, Vector3 desiredEye, uint cellId, uint selfEntityId)
|
||||
{
|
||||
if (cellId == 0) return desiredEye; // no starting cell → can't sweep
|
||||
// InitPath offsets sphere0's center up by radius (foot-capsule convention),
|
||||
// but retail's viewer_sphere center is (0,0,0). Shift the path down by radius
|
||||
// so the SPHERE CENTER travels pivot→eye, then add it back to the result.
|
||||
var zoff = new Vector3(0f, 0f, 0.3f);
|
||||
var r = _physics.ResolveWithTransition(
|
||||
currentPos: pivot,
|
||||
targetPos: desiredEye,
|
||||
currentPos: pivot - zoff,
|
||||
targetPos: desiredEye - zoff,
|
||||
cellId: cellId,
|
||||
sphereRadius: 0.3f, // retail viewer_sphere radius
|
||||
sphereHeight: 0f, // single sphere (no head sphere)
|
||||
|
|
@ -144,7 +148,7 @@ public Vector3 SweepEye(Vector3 pivot, Vector3 desiredEye, uint cellId, uint sel
|
|||
// camera sweeps out of the #98
|
||||
// IsPlayer capture filter
|
||||
movingEntityId: selfEntityId); // skip the player's own ShadowEntry
|
||||
return r.Position; // = sp.CheckPos, the swept stop position
|
||||
return r.Position + zoff; // r.Position = sp.CheckPos (path pt); + zoff = eye
|
||||
}
|
||||
```
|
||||
|
||||
|
|
@ -234,11 +238,13 @@ inside the player mesh) when backed into a corner.
|
|||
- probe returns a pulled-in eye → published `Position`/`View` use the collided
|
||||
eye; fade increases.
|
||||
- `CollideCamera = false` → probe never consulted.
|
||||
- `PhysicsCameraCollisionProbe` against fixtures (reuse the issue-#98 cell +
|
||||
GfxObj fixtures already in the test tree):
|
||||
- clear path → eye unchanged;
|
||||
- wall/shell between pivot and desiredEye → eye stops short (does not penetrate);
|
||||
- `selfEntityId` set → sweep does not collide with the player's own ShadowEntry.
|
||||
- `PhysicsCameraCollisionProbe` deterministic units (no heavy fixture setup):
|
||||
- `ToSpherePath`/`FromSpherePath` z-offset round-trip;
|
||||
- `cellId == 0` guard → returns `desiredEye` unchanged.
|
||||
Collision correctness itself (eye stops at a wall/shell; self-skip) is already
|
||||
covered by the exhaustive `ResolveWithTransition` / `BSPQuery` suites and is
|
||||
confirmed end-to-end by the visual acceptance below — re-proving it at the probe
|
||||
layer would duplicate that coverage with brittle fixture wiring.
|
||||
|
||||
**Visual (acceptance):** with `ACDREAM_A8_INDOOR_BRANCH=1`, walk into a Holtburg
|
||||
cottage and its cellar:
|
||||
|
|
@ -263,9 +269,12 @@ Compare `ACDREAM_CAMERA_COLLIDE=0` vs default to confirm the flag isolates the f
|
|||
retail's `find_valid_position` during implementation and confirm whether it
|
||||
slides or hard-stops; match it. Both keep the eye out of walls, so this does
|
||||
not change the architecture.
|
||||
2. **`sphereHeight: 0f`.** Confirm `SpherePath.InitPath` with height 0 yields a
|
||||
single sphere (no degenerate coincident head sphere). If not, pass a tiny
|
||||
height or a single-sphere init.
|
||||
2. **`sphereHeight: 0f` — RESOLVED.** `SpherePath.InitPath` with height 0 yields a
|
||||
single sphere (`NumSphere = 1`, `TransitionTypes.cs:534-537`). It also offsets
|
||||
sphere0's center to `pathPos + (0,0,radius)` (foot-capsule convention) whereas
|
||||
retail's `viewer_sphere` center is (0,0,0); the probe compensates with the
|
||||
`ToSpherePath`/`FromSpherePath` z-shift (§5.1) so the sphere center travels
|
||||
pivot→eye.
|
||||
3. **Probe construction order.** The `PhysicsEngine` must exist before the
|
||||
`RetailChaseCamera` constructions at `GameWindow.cs:10693/:10826`; confirm
|
||||
lifetime ordering or make the probe field settable post-construction.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue