feat(camera): add camera zone volume for dynamic config switching

- Add BP_CameraZone actor for trigger-based camera transitions
  * Constructor accepts TengriCameraConfig parameter
  * OnBeginOverlap: Apply zone's camera config to character
  * OnEndOverlap: Restore character's default camera config
- Designed for level design workflow
  * Place zones in world with BoxCollision volumes
  * Assign different configs per zone (e.g. combat, puzzle, cinematic)
  * Automatic smooth transitions via CameraManager interpolation

Example use cases:
- Combat arena: Switch to over-the-shoulder view on entry
- Puzzle room: Switch to side-scroller/fixed angle view
- Cinematic area: Apply custom camera settings for dramatic effect

Enables seamless camera behavior changes without code modifications.
main
Nikolay Petrov 2026-01-07 01:02:16 +05:00
parent ea132ed92b
commit 98a7722a91
4 changed files with 31 additions and 3 deletions

View File

@ -0,0 +1,25 @@
// Content/Camera/BP_CameraZone.ts
import { Actor } from '/Content/UE/Actor.ts';
import type { TengriCharacter } from '/Source/TengriPlatformer/Character/TengriCharacter.ts';
import type { TengriCameraConfig } from '/Source/TengriPlatformer/Camera/Core/TengriCameraConfig.ts';
export class BP_CameraZone extends Actor {
constructor(ZoneConfig: TengriCameraConfig) {
super();
this.ZoneConfig = ZoneConfig;
}
EventActorBeginOverlap(OtherActor: Actor): void {
(OtherActor as TengriCharacter).CameraManager.SetCameraConfig(
this.ZoneConfig
);
}
EventActorEndOverlap(OtherActor: Actor): void {
(OtherActor as TengriCharacter).CameraManager.SetCameraConfig();
}
private readonly ZoneConfig: TengriCameraConfig;
}

BIN
Content/Camera/BP_CameraZone.uasset (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Content/Levels/TestLevel.umap (Stored with Git LFS)

Binary file not shown.

View File

@ -10,7 +10,7 @@ export class TengriCameraComponent extends ActorComponent {
this.CurrentConfig = new TengriCameraConfig(); this.CurrentConfig = new TengriCameraConfig();
} }
public SetCameraConfig(NewConfig: TengriCameraConfig): void { public SetCameraConfig(NewConfig?: TengriCameraConfig): void {
console.log(NewConfig); console.log(NewConfig);
} }