unitysamples / LyraStarterGame /Plugins /GameFeatures /TopDownArena /Source /TopDownArenaRuntime /Private /LyraCameraMode_TopDownArenaCamera.cpp
Download LyraStarterGame/Plugins/GameFeatures/TopDownArena/Source/TopDownArenaRuntime/Private/LyraCameraMode_TopDownArenaCamera.cpp from Alexhas2/unitysamples: direct link, hf CLI and curl.
- Browser
- Download file 975 Bytes
-
https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Plugins/GameFeatures/TopDownArena/Source/TopDownArenaRuntime/Private/LyraCameraMode_TopDownArenaCamera.cpp
- Command line
-
hf download hf://datasets/Alexhas2/unitysamples/LyraStarterGame/Plugins/GameFeatures/TopDownArena/Source/TopDownArenaRuntime/Private/LyraCameraMode_TopDownArenaCamera.cpp
-
curl -L -o LyraCameraMode_TopDownArenaCamera.cpp https://huggingface.co/datasets/Alexhas2/unitysamples/resolve/main/LyraStarterGame/Plugins/GameFeatures/TopDownArena/Source/TopDownArenaRuntime/Private/LyraCameraMode_TopDownArenaCamera.cpp
975 Bytes
| // Copyright Epic Games, Inc. All Rights Reserved. | |
| ULyraCameraMode_TopDownArenaCamera::ULyraCameraMode_TopDownArenaCamera() | |
| { | |
| ArenaWidth = 1000.0f; | |
| ArenaHeight = 1000.0f; | |
| } | |
| void ULyraCameraMode_TopDownArenaCamera::UpdateView(float DeltaTime) | |
| { | |
| FBox ArenaBounds(FVector(-ArenaWidth, -ArenaHeight, 0.0f), FVector(ArenaWidth, ArenaHeight, 100.0f)); | |
| const double BoundsMaxComponent = ArenaBounds.GetSize().GetMax(); | |
| const double CameraLoftDistance = BoundsSizeToDistance.GetRichCurveConst()->Eval(BoundsMaxComponent); | |
| FVector PivotLocation = ArenaBounds.GetCenter() - DefaultPivotRotation.Vector() * CameraLoftDistance; | |
| FRotator PivotRotation = DefaultPivotRotation; | |
| View.Location = PivotLocation; | |
| View.Rotation = PivotRotation; | |
| View.ControlRotation = View.Rotation; | |
| View.FieldOfView = FieldOfView; | |
| } | |