Commit Graph
16 Commits
Author SHA1 Message Date
adminandClaude Fable 5 066e308cde Docs: reduce over-documentation across gameplay scripts
Trim restated narration, dead commented-out code, and oversized class
headers; keep all why-comments (authority, timing, edge cases), tooltips,
and serialization caveats.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 10:08:28 +02:00
adminandClaude Opus 4.8 882d30797e Refactor: dedupe input reads, material-property guards, button hooks
Extract byte-identical duplicated code into shared helpers (behaviour-neutral):
- New InputUtil.cs: single source for mouse-delta/scroll/cursor-lock, modifier
  and mouse-button reads, previously copied verbatim across camera controllers,
  MeshPainter, FirstPersonMode and PlayerCharacterController.
- GetMatFloat/SetMatFloat replace the 12x material-instance + HasProperty guard
  pattern for the camo/height float properties.
- Route two inline button hooks through the existing Hook() helper.

Bespoke variants deliberately kept local (FreeCam SprintHeld = LeftShift only,
MeshPainter.TryGetMouse with out-params).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 09:20:40 +02:00
adminandClaude Opus 4.8 6fcada4631 Keep the pan limit constant across zoom and hand off cleanly to free cam
Two paint-mode pan refinements:
- The max-distance clamp is back to body-relative only (CurrentScale, no zoom
  factor), so the world-space pan limit is identical at every zoom level;
  only the sensitivity stays zoom-scaled (finer when zoomed in).
- Don't zero the pan offset in OnDisable. The only thing that disables this
  component is FreeCamMode taking over, and the freecam snaps to the live
  (still panned) view. Zeroing here jumped the orbit camera the brain blends
  FROM to center while the freecam sat at the panned pose - the visible
  "snap to 0, then translate to the offset" on the paint->free-cam switch.
  Leaving the offset frozen keeps blend-from == blend-to (both panned) for a
  seamless handoff; the pan glides home on its own once the orbit input next
  runs in a non-paint mode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 19:53:35 +02:00
adminandClaude Opus 4.8 3fa99f32fe Keep the paint-mode pan on release and scale it by zoom
The middle-mouse pan now persists when the button is released and only glides back to center on leaving paint mode. Pan sensitivity and max distance scale with the orbit zoom distance, so panning stays consistent on screen at any zoom and unchanged at the default zoom.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-30 19:25:45 +02:00
adminandClaude Opus 4.8 188f16a4e8 Make the eyedropper a hybrid material/screen pick
On a foreign object the pipette now reads the data channels
(metallic/smoothness/occlusion/emission) texel-exact from the material
while taking albedo from the rendered, fully-lit on-screen pixel - so the
picked colour honours baked lightmaps/ambient/SSAO while keeping the
material's PBR fidelity. Falls back to a pure screen pick when no readable
UV is available. Pull the render+readback out of PickFromScreen into a
shared TrySampleScreenColor.

The pipette now also arms on Ctrl (in addition to Shift), and Ctrl+wheel
resizes the brush; the orbit camera ignores the wheel while either modifier
is held so it does not zoom and resize at once.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-29 16:22:45 +02:00
adminandClaude Opus 4.8 a7a4fbdcb7 Carry first-person facing into orbit camera on mode switch
When leaving first person for an orbit mode (Paint / Player Control), snap
the orbit axes to Camera.main's current view direction instead of restoring
the orbit's last-used angle. With WorldSpace binding + Sphere orbit + a
centered composer the camera look rotation is exactly
Euler(VerticalAxis, HorizontalAxis, 0), so the inverse mapping is exact.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 23:02:31 +02:00
adminandClaude Opus 4.8 62cf0eae04 Scale third-person orbit zoom range and default by player size
The orbit radius (min/max/default and per-notch step) was in absolute world
units and ignored the player's localScale, so a small Hider started too far
out and a large Hunter too close and could not zoom out far enough. Multiply
range, step and default radius by the follow target's lossyScale (PlayerScaler
keeps the body uniformly scaled), making the inspector fields size-1 design
values that frame every role body-relative. Re-clamp every frame so a runtime
grow/shrink stays in range. GameModeManager.BindLocalPlayer calls ResetZoom
after rebinding so each new avatar starts at its scaled default zoom.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 21:39:41 +02:00
adminandClaude Opus 4.8 b6aaf69235 Add Shift brush controls to paint mode
Hold Shift to momentarily enable the pipette (restores prior state on
release) and Shift+Scroll to resize the brush. The orbit zoom ignores the
wheel while Shift is held so it does not zoom and resize at once. The HUD
brush-size slider follows live via a BrushSizeChanged event, and the brush
preview now stays visible while Shift is held (drawn before the pipette
early-return) so the new size is visible while scrubbing.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 16:20:25 +02:00
adminandClaude Opus 4.8 2a6fc163b1 Add persistent global mouse sensitivity setting with slider
MouseSensitivity is a static, PlayerPrefs-backed multiplier (default 1,
clamped 0.1-4.0) that scales the mouse-look delta in the FreeCam,
FirstPerson and ThirdPerson controllers. Writes flush immediately so the
value survives a hard build exit. MouseSensitivitySlider binds the
Settings-panel slider to it (range read from the inspector) and mirrors
the value into its label, syncing on panel open via OnEnable.

Main.unity now contains the session-manager canvas directly (the
Online Session Manager prefab was unpacked) and wires the slider binder.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-28 13:55:53 +02:00
adminandClaude Opus 4.8 ee482905f9 Replace auto paint persistence with a named painting library
Persistence rework:
- Drop auto-load on setup and auto-save on teardown; the painter now always
  seeds fresh from the material.
- Named slots under MeshPaint/Saved/<name>.paint via the existing CHMP
  machinery: SavePaintAs / LoadPaintByName / DeletePaint / ListSavedPaintings /
  PaintExists. Slot files carry the display name in the header.
- Remove the obsolete persistence partials (PlayerCharacterController,
  PlayerPoseController, ThirdPersonOrbitInput) and their references.

Paintings HUD panel:
- Authored Panel_Paintings + Save/Load/Delete dialogs into PaintHudPanel.prefab
  (TMP throughout); PaintHud.Library.cs is now a pure binder that clones the
  entry template per slot.
- Save dialog blocks empty/existing names; Load and Delete confirm first.
- Fix dialog z-order: open dialogs SetAsLastSibling so a dragged panel can no
  longer cover them.
- Lib_ListContent horizontal offsets corrected to 0 (was clipping entry labels
  out of the masked viewport).

Multiplayer:
- Loading a painting re-syncs to all peers via the snapshot broadcast path
  (BroadcastLoadedPaint), covering later late-joiners for free.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 18:39:20 +02:00
adminandClaude Opus 4.8 cda1373979 Persist player and third-person camera state across sessions
Add player position/rotation/wall-climb persistence and camera
orbit (yaw/pitch/radius) persistence, auto-saved on quit/play-stop
and auto-loaded on start. Also includes the wall-climb fixes
(directional top-out, base detach on push-away).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-25 07:38:32 +02:00
adminandClaude Opus 4.8 4c28d1488d Add movement accel/decel, camera smoothing, and Running animator hook
- Smooth acceleration/deceleration on ground and air movement
- Interpolated scroll zoom and low-pass smoothed orbit rotation
- Drive Animator "Running" bool while moving on the ground
- Add Paintman animator controllers and animation clips
- Update README and GAME_DESIGN docs for sprint, accel, camera smoothing and animator hookup

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 22:35:50 +02:00
adminandClaude Opus 4.8 4c9eef18f4 Rework wall-climb controls: constant W/S climb, mouse-drag wall pose
- W/S climb straight up/down at a constant speed (camera pitch no longer
  tilts or slows them); the camera only drives A/D strafe along the wall.
- The body now always faces the wall. Holding LMB and dragging sets the
  wall pose: vertical drag leans out from / back to the wall (offset eases
  back to zero while moving, never detaches), horizontal drag turns the
  body (yaw held until leaving the wall, eased back by ground rotation).
- Pause the camera orbit while dragging the wall pose (LookSuppressed).
- Drop the camera-to-wall angle logic and the old approach/detach-distance
  model; add wallMaxOffset, wallOffsetSensitivity, wallOffsetReturnSpeed
  and wallRotateSensitivity.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 18:36:58 +02:00
adminandClaude Opus 4.8 f758c96dc5 Trim comments and use implicit null checks for Unity objects
Reduce comments to non-obvious "why" notes and convert UnityEngine.Object
null checks to implicit bool (if (obj) / if (!obj)). Input System devices
(Mouse.current, Keyboard.current) and plain arrays keep explicit != null.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 17:26:41 +02:00
adminandClaude Opus 4.8 dcb1fc42a6 Add game mode manager with player-control and paint modes
Introduce an extensible game mode system toggled with Tab:
- Player Control: WASD movement with always-on mouse camera orbit
- Paint: player frozen, left-click paints, right-click holds to orbit

Add GameMode base class, GameModeManager, and the two concrete modes.
Refactor controlled scripts to expose clean state flags instead of
handling input themselves: ThirdPersonOrbitInput.LookMode,
PlayerCharacterController.ControlEnabled, MeshPainter.PaintingEnabled.

Also fix camera zoom: remove the obsolete /120 wheel normalization so
one scroll notch maps to one zoomSpeed step under the new Input System.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 15:13:46 +02:00
adminandClaude Opus 4.8 6e8ab4bc6d Add Cinemachine third-person orbit camera and fix paint raycast
- Install Cinemachine 3.1.7 and set up an orbital third-person camera rig
  (CinemachineBrain, OrbitalFollow, RotationComposer, Deoccluder).
- Add ThirdPersonOrbitInput: mouse-driven orbit and wheel zoom with a Tab
  toggle that unlocks the cursor and pauses rotation.
- Fix MeshPainter so the paint ray skips the player's CharacterController
  capsule (and any other collider) and always targets the mesh collider,
  so painting works from every camera angle.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-22 14:31:45 +02:00