Commit Graph

2 Commits (98a7722a915844794647873c3a3525ca24b7d0a6)

Author SHA1 Message Date
Nikolay Petrov d89e3fb3b3 feat(character): integrate camera system with aiming mode
Character (C++):
- Add camera components to character (SpringArm, Camera, CameraManager)
  * Initialize camera manager in BeginPlay with component references
  * SpringArm attached to capsule with 60cm vertical offset
  * Camera attached to SpringArm socket
- Add AimingCameraConfig for over-the-shoulder aiming view
  * Switch to aiming config when RMB/L2 pressed
  * Return to default config when aim button released
- Improve OnThrowInput code clarity
  * Simplify controller validation flow
  * Clean up trajectory calculation comments
- Add forward declarations for camera classes
- Update class documentation to mention camera integration

Blueprint:
- Remove legacy camera component (AC_Camera)
  * Camera rotation now handled by C++ TengriCameraComponent
  * SpringArm interpolation managed by camera config system
- Update look input to use native controller input
  * AddControllerYawInput/PitchInput for FreeLook mode
  * Skip input in side-scroller mode (camera is fixed)
- Remove camera-related variables (moved to C++ config)
- Simplify EventTick (camera logic now in C++ component)
- Pass DA_CameraAiming config to character constructor

Camera now seamlessly transitions between default and aiming modes,
working in tandem with strafe movement for precise targeting.
2026-01-07 00:38:43 +05:00
Nikolay Petrov 8744cb759b feat(interaction): implement pickup, aim and throw mechanics
- Implement Context-Based Input system:
  - Added `IMC_ItemHeld` mapping context.
  - Added logic to switch contexts when picking up/dropping items.
  - Added `Throw` (LMB/R2) and `Aim` (RMB/L2) input actions.

- Refactor Interaction Logic:
  - `Interact`: Now handles picking up items or gently dropping them if held.
  - `OnThrowInput`: Implemented physics-based throw towards camera aim point (center of screen raycast).
  - Added character rotation to face the throw target instantly.

- Update Physics & Movement:
  - Added `bStrafing` mode to `TengriMovementComponent` to allow rotation towards camera view.
  - Updated `TengriPickupActor` to use `bVelChange` for impulses (ignoring mass for consistent throw arc).
  - Tuned throw force and added vertical arc bias.

- Fixes:
  - Resolved rotation logic in MovementComponent to support Aiming state.
2025-12-27 21:55:31 +05:00