├── .gitignore ├── CamVol.png ├── CamVol.uproject ├── Config ├── DefaultDeviceProfiles.ini ├── DefaultEditor.ini ├── DefaultEditorPerProjectUserSettings.ini ├── DefaultEngine.ini ├── DefaultGame.ini └── DefaultInput.ini ├── Content ├── 2DSideScroller │ ├── Materials │ │ └── PrototypingSpriteMaterial.uasset │ ├── Sprites │ │ ├── Background_Sprite.uasset │ │ ├── IdleAnimation.uasset │ │ ├── IdleFrames │ │ │ ├── IdleCycle1.uasset │ │ │ ├── IdleCycle2.uasset │ │ │ ├── IdleCycle3.uasset │ │ │ ├── IdleCycle4.uasset │ │ │ ├── IdleCycle5.uasset │ │ │ ├── IdleCycle6.uasset │ │ │ ├── IdleCycle7.uasset │ │ │ └── IdleCycle8.uasset │ │ ├── Ledge.uasset │ │ ├── PrototypingSprite.uasset │ │ ├── RunFrames │ │ │ ├── RunCycle_1.uasset │ │ │ ├── RunCycle_10.uasset │ │ │ ├── RunCycle_11.uasset │ │ │ ├── RunCycle_12.uasset │ │ │ ├── RunCycle_13.uasset │ │ │ ├── RunCycle_14.uasset │ │ │ ├── RunCycle_15.uasset │ │ │ ├── RunCycle_16.uasset │ │ │ ├── RunCycle_2.uasset │ │ │ ├── RunCycle_3.uasset │ │ │ ├── RunCycle_4.uasset │ │ │ ├── RunCycle_5.uasset │ │ │ ├── RunCycle_6.uasset │ │ │ ├── RunCycle_7.uasset │ │ │ ├── RunCycle_8.uasset │ │ │ └── RunCycle_9.uasset │ │ └── RunningAnimation.uasset │ └── Textures │ │ ├── 2DBackground.uasset │ │ ├── 2DBackgroundBlockAtlas.uasset │ │ ├── 2DBackgroundTile.uasset │ │ ├── 2DCharacter_IdleAnimAtlas.uasset │ │ └── 2DCharacter_RunAnimAtlas.uasset ├── Blueprints │ ├── 2DRetroSS │ │ ├── BP_2DRetroCharacter.uasset │ │ └── BP_2DRetroGameMode.uasset │ ├── 2DSS │ │ ├── BP_CamVol2D_SS_GameMode.uasset │ │ └── BP_CamVol2D_SS_PlayerCharacter.uasset │ ├── 2DTD │ │ ├── BP_CamVol2D_TD_GameMode.uasset │ │ └── BP_CamVol2D_TD_PlayerCharacter.uasset │ ├── BP_CamVolGameMode.uasset │ ├── BP_CamVolPlayerCharacter.uasset │ ├── BP_CamVolPlayerController.uasset │ ├── BP_CameraManager.uasset │ ├── Sequences │ │ ├── BP_CameraShake_01.uasset │ │ └── LevelSequence01.uasset │ ├── ThirdPerson │ │ ├── BP_CamVolGameModeTP.uasset │ │ └── BP_CamVolPlayerCharacterTP.uasset │ └── TopDown │ │ ├── BP_CamVolGameModeTD.uasset │ │ └── BP_CamVolPlayerCharacterTD.uasset ├── Geometry │ ├── M_Back_01.uasset │ ├── M_Floor_01.uasset │ ├── M_Floor_01_Blue.uasset │ ├── M_Floor_01_Green.uasset │ ├── M_Floor_01_Red.uasset │ ├── M_Floor_01_Yellow.uasset │ └── Meshes │ │ ├── 1M_Cube.uasset │ │ └── CubesBlock.uasset ├── Mannequin │ ├── Animations │ │ ├── ThirdPersonIdle.uasset │ │ ├── ThirdPersonJump_End.uasset │ │ ├── ThirdPersonJump_Loop.uasset │ │ ├── ThirdPersonJump_Start.uasset │ │ ├── ThirdPersonRun.uasset │ │ ├── ThirdPersonWalk.uasset │ │ ├── ThirdPerson_AnimBP.uasset │ │ ├── ThirdPerson_IdleRun_2D.uasset │ │ └── ThirdPerson_Jump.uasset │ └── Character │ │ ├── Materials │ │ ├── M_UE4Man_Body.uasset │ │ ├── M_UE4Man_ChestLogo.uasset │ │ └── MaterialLayers │ │ │ ├── ML_GlossyBlack_Latex_UE4.uasset │ │ │ ├── ML_Plastic_Shiny_Beige.uasset │ │ │ ├── ML_Plastic_Shiny_Beige_LOGO.uasset │ │ │ ├── ML_SoftMetal_UE4.uasset │ │ │ ├── T_ML_Aluminum01.uasset │ │ │ ├── T_ML_Aluminum01_N.uasset │ │ │ ├── T_ML_Rubber_Blue_01_D.uasset │ │ │ └── T_ML_Rubber_Blue_01_N.uasset │ │ ├── Mesh │ │ ├── SK_Mannequin.uasset │ │ ├── SK_Mannequin_PhysicsAsset.uasset │ │ └── UE4_Mannequin_Skeleton.uasset │ │ └── Textures │ │ ├── UE4Man_Logo_N.uasset │ │ ├── UE4_LOGO_CARD.uasset │ │ ├── UE4_Mannequin_MAT_MASKA.uasset │ │ └── UE4_Mannequin__normals.uasset └── Maps │ ├── 2DRetroSideScrollerExampleMap.umap │ ├── 2DSideScrollerExampleMap.umap │ ├── 2DTopDownExampleMap.umap │ ├── NotSideScrollerExampleMap.umap │ ├── SideScrollerExampleMap.umap │ ├── TestsMap.umap │ ├── TestsRuntimeMap.umap │ ├── TestsStreamingMap.umap │ └── TopDownExampleMap.umap ├── LICENSE ├── Plugins └── CameraVolumes │ ├── CameraVolumes.uplugin │ ├── Config │ ├── DefaultCameraVolumes.ini │ └── FilterPlugin.ini │ ├── Content │ ├── Icons │ │ └── CameraVolume.uasset │ └── Materials │ │ ├── DeadZonePreview.uasset │ │ ├── ScreenAspectRatioYX.uasset │ │ ├── ScreenPercentToFloat2.uasset │ │ └── UnlitText.uasset │ ├── Resources │ └── Icon128.png │ └── Source │ └── CameraVolumes │ ├── CameraVolumes.Build.cs │ ├── Private │ ├── CameraVolumeActor.cpp │ ├── CameraVolumeDynamicActor.cpp │ ├── CameraVolumesCameraComponent.cpp │ ├── CameraVolumesCameraManager.cpp │ ├── CameraVolumesCharacter.cpp │ ├── CameraVolumesFunctionLibrary.cpp │ ├── CameraVolumesModule.cpp │ └── CameraVolumesPaperCharacter.cpp │ └── Public │ ├── CameraVolumeActor.h │ ├── CameraVolumeDynamicActor.h │ ├── CameraVolumesCameraComponent.h │ ├── CameraVolumesCameraManager.h │ ├── CameraVolumesCharacter.h │ ├── CameraVolumesCharacterInterface.h │ ├── CameraVolumesFunctionLibrary.h │ ├── CameraVolumesModule.h │ ├── CameraVolumesPaperCharacter.h │ └── CameraVolumesTypes.h └── Source ├── CamVol.Target.cs ├── CamVol ├── CamVol.Build.cs ├── CamVol.cpp ├── CamVol.h ├── CamVolCharacter.cpp ├── CamVolCharacter.h ├── CamVolExamplePawn.cpp ├── CamVolExamplePawn.h ├── CamVolGameMode.cpp ├── CamVolGameMode.h ├── CamVolPaperCharacter.cpp ├── CamVolPaperCharacter.h ├── CamVolPlayerController.cpp └── CamVolPlayerController.h └── CamVolEditor.Target.cs /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | #Other 35 | *.vs* 36 | *.sln 37 | Binaries 38 | Build 39 | Intermediate 40 | Saved -------------------------------------------------------------------------------- /CamVol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/CamVol.png -------------------------------------------------------------------------------- /CamVol.uproject: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "EngineAssociation": "5.3", 4 | "Category": "", 5 | "Description": "", 6 | "Modules": [ 7 | { 8 | "Name": "CamVol", 9 | "Type": "Runtime", 10 | "LoadingPhase": "Default" 11 | } 12 | ], 13 | "Plugins": [ 14 | { 15 | "Name": "CameraVolumes", 16 | "Enabled": true, 17 | "MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/b851f8a1270e41b6b72dc209d6732eac" 18 | } 19 | ] 20 | } -------------------------------------------------------------------------------- /Config/DefaultDeviceProfiles.ini: -------------------------------------------------------------------------------- 1 | ; Add a ArrayOfStruct key for all DeviceProfile PerObjectConfig sections (this must come before any DeviceProfile sections) 2 | ; Note that * properties don't get written back out by the config system, but these aren't real sections, so that should be okay 3 | [DeviceProfile] 4 | *TextureLODGroups=Group 5 | 6 | [DeviceProfiles] 7 | +DeviceProfileNameAndTypes=Windows,Windows 8 | +DeviceProfileNameAndTypes=WindowsNoEditor,Windows 9 | +DeviceProfileNameAndTypes=WindowsServer,Windows 10 | +DeviceProfileNameAndTypes=WindowsClient,Windows 11 | +DeviceProfileNameAndTypes=IOS,IOS 12 | +DeviceProfileNameAndTypes=iPad2,IOS 13 | +DeviceProfileNameAndTypes=iPad3,IOS 14 | +DeviceProfileNameAndTypes=iPad4,IOS 15 | +DeviceProfileNameAndTypes=iPadAir,IOS 16 | +DeviceProfileNameAndTypes=iPadMini,IOS 17 | +DeviceProfileNameAndTypes=iPadMini2,IOS 18 | +DeviceProfileNameAndTypes=iPadMini4,IOS 19 | +DeviceProfileNameAndTypes=iPodTouch5,IOS 20 | +DeviceProfileNameAndTypes=iPodTouch6,IOS 21 | +DeviceProfileNameAndTypes=iPhone4,IOS 22 | +DeviceProfileNameAndTypes=iPhone4S,IOS 23 | +DeviceProfileNameAndTypes=iPhone5,IOS 24 | +DeviceProfileNameAndTypes=iPhone5S,IOS 25 | +DeviceProfileNameAndTypes=iPhone6,IOS 26 | +DeviceProfileNameAndTypes=iPhone6Plus,IOS 27 | +DeviceProfileNameAndTypes=iPhone6S,IOS 28 | +DeviceProfileNameAndTypes=iPhone6SPlus,IOS 29 | +DeviceProfileNameAndTypes=iPhone7,IOS 30 | +DeviceProfileNameAndTypes=iPhone7Plus,IOS 31 | +DeviceProfileNameAndTypes=iPhoneSE,IOS 32 | +DeviceProfileNameAndTypes=iPhone8,IOS 33 | +DeviceProfileNameAndTypes=iPhone8Plus,IOS 34 | +DeviceProfileNameAndTypes=iPhoneX,IOS 35 | +DeviceProfileNameAndTypes=iPhoneXS,IOS 36 | +DeviceProfileNameAndTypes=iPhoneXSMax,IOS 37 | +DeviceProfileNameAndTypes=iPhoneXR,IOS 38 | +DeviceProfileNameAndTypes=iPadPro,IOS 39 | +DeviceProfileNameAndTypes=iPadPro105,IOS 40 | +DeviceProfileNameAndTypes=iPadPro129,IOS 41 | +DeviceProfileNameAndTypes=iPadPro97,IOS 42 | +DeviceProfileNameAndTypes=iPadPro2_129,IOS 43 | +DeviceProfileNameAndTypes=iPad5,IOS 44 | +DeviceProfileNameAndTypes=iPad6,IOS 45 | +DeviceProfileNameAndTypes=iPadPro11,IOS 46 | +DeviceProfileNameAndTypes=iPadPro3_129,IOS 47 | +DeviceProfileNameAndTypes=AppleTV,IOS 48 | +DeviceProfileNameAndTypes=AppleTV4K,IOS 49 | +DeviceProfileNameAndTypes=HTML5,HTML5 50 | +DeviceProfileNameAndTypes=Mac,Mac 51 | +DeviceProfileNameAndTypes=MacClient,Mac 52 | +DeviceProfileNameAndTypes=MacNoEditor,Mac 53 | +DeviceProfileNameAndTypes=MacServer,Mac 54 | +DeviceProfileNameAndTypes=Linux,Linux 55 | +DeviceProfileNameAndTypes=LinuxNoEditor,Linux 56 | +DeviceProfileNameAndTypes=LinuxServer,Linux 57 | +DeviceProfileNameAndTypes=Android,Android 58 | +DeviceProfileNameAndTypes=Android_Low,Android 59 | +DeviceProfileNameAndTypes=Android_Mid,Android 60 | +DeviceProfileNameAndTypes=Android_High,Android 61 | +DeviceProfileNameAndTypes=Android_Default,Android 62 | +DeviceProfileNameAndTypes=Android_Adreno320,Android 63 | +DeviceProfileNameAndTypes=Android_Adreno2xx,Android 64 | +DeviceProfileNameAndTypes=Android_Adreno330,Android 65 | +DeviceProfileNameAndTypes=Android_Adreno330_Ver53,Android 66 | +DeviceProfileNameAndTypes=Android_Adreno4xx_Nexus6,Android 67 | +DeviceProfileNameAndTypes=Android_Adreno4xx,Android 68 | +DeviceProfileNameAndTypes=Android_Adreno5xx,Android 69 | +DeviceProfileNameAndTypes=Android_Adreno6xx,Android 70 | +DeviceProfileNameAndTypes=Android_PowerVR54x,Android 71 | +DeviceProfileNameAndTypes=Android_PowerVRLow,Android 72 | +DeviceProfileNameAndTypes=Android_PowerVRMid,Android 73 | +DeviceProfileNameAndTypes=Android_TegraK1,Android 74 | +DeviceProfileNameAndTypes=Android_Tegra4,Android 75 | +DeviceProfileNameAndTypes=Android_IntelHD,Android 76 | +DeviceProfileNameAndTypes=Android_IntelHD_ES3,Android 77 | +DeviceProfileNameAndTypes=Android_Mali_4xx,Android 78 | +DeviceProfileNameAndTypes=Android_Mali_T6xx,Android 79 | +DeviceProfileNameAndTypes=Android_Mali_T7xx,Android 80 | +DeviceProfileNameAndTypes=Android_Mali_T8xx,Android 81 | +DeviceProfileNameAndTypes=Android_Mali_T8xx_No_Vulkan,Android 82 | +DeviceProfileNameAndTypes=Android_Mali_G71,Android 83 | +DeviceProfileNameAndTypes=Android_Mali_G72,Android 84 | ; @todo Lumin: Once we get the IniPlatformParent stuff, this should move into a LuminBaseDeviceProfiles.ini, and make type be Lumin 85 | +DeviceProfileNameAndTypes=Lumin,Android 86 | 87 | [GlobalDefaults DeviceProfile] 88 | @TextureLODGroups=Group 89 | TextureLODGroups=(Group=TEXTUREGROUP_World,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 90 | +TextureLODGroups=(Group=TEXTUREGROUP_WorldNormalMap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 91 | +TextureLODGroups=(Group=TEXTUREGROUP_WorldSpecular,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 92 | +TextureLODGroups=(Group=TEXTUREGROUP_Character,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 93 | +TextureLODGroups=(Group=TEXTUREGROUP_CharacterNormalMap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 94 | +TextureLODGroups=(Group=TEXTUREGROUP_CharacterSpecular,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 95 | +TextureLODGroups=(Group=TEXTUREGROUP_Weapon,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 96 | +TextureLODGroups=(Group=TEXTUREGROUP_WeaponNormalMap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 97 | +TextureLODGroups=(Group=TEXTUREGROUP_WeaponSpecular,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 98 | +TextureLODGroups=(Group=TEXTUREGROUP_Vehicle,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 99 | +TextureLODGroups=(Group=TEXTUREGROUP_VehicleNormalMap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 100 | +TextureLODGroups=(Group=TEXTUREGROUP_VehicleSpecular,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 101 | +TextureLODGroups=(Group=TEXTUREGROUP_Cinematic,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 102 | +TextureLODGroups=(Group=TEXTUREGROUP_Effects,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=linear,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 103 | +TextureLODGroups=(Group=TEXTUREGROUP_EffectsNotFiltered,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 104 | +TextureLODGroups=(Group=TEXTUREGROUP_Skybox,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 105 | +TextureLODGroups=(Group=TEXTUREGROUP_UI,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 106 | +TextureLODGroups=(Group=TEXTUREGROUP_Lightmap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 107 | +TextureLODGroups=(Group=TEXTUREGROUP_Shadowmap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,NumStreamedMips=3,MipGenSettings=TMGS_SimpleAverage) 108 | +TextureLODGroups=(Group=TEXTUREGROUP_RenderTarget,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 109 | +TextureLODGroups=(Group=TEXTUREGROUP_MobileFlattened,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 110 | +TextureLODGroups=(Group=TEXTUREGROUP_Terrain_Heightmap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 111 | +TextureLODGroups=(Group=TEXTUREGROUP_Terrain_Weightmap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 112 | +TextureLODGroups=(Group=TEXTUREGROUP_Bokeh,MinLODSize=1,MaxLODSize=256,LODBias=0,MinMagFilter=linear,MipFilter=linear,MipGenSettings=TMGS_SimpleAverage) 113 | +TextureLODGroups=(Group=TEXTUREGROUP_Pixels2D,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=point,MipFilter=point,MipGenSettings=TMGS_SimpleAverage) 114 | 115 | [Windows DeviceProfile] 116 | DeviceType=Windows 117 | BaseProfileName= 118 | +CVars=r.Vulkan.UseRealUBs=1 119 | ; +CVars=r.Vulkan.EnableValidation=0 120 | 121 | [WindowsNoEditor DeviceProfile] 122 | DeviceType=Windows 123 | BaseProfileName=Windows 124 | 125 | [WindowsClient DeviceProfile] 126 | DeviceType=Windows 127 | BaseProfileName=Windows 128 | 129 | [WindowsServer DeviceProfile] 130 | DeviceType=Windows 131 | BaseProfileName=Windows 132 | 133 | [WindowsClient DeviceProfile] 134 | DeviceType=Windows 135 | BaseProfileName=Windows 136 | 137 | [IOS DeviceProfile] 138 | DeviceType=IOS 139 | BaseProfileName= 140 | +CVars=r.BloomQuality=0 141 | +CVars=r.DepthOfFieldQuality=0 142 | +CVars=r.LightShaftQuality=0 143 | +CVars=r.RefractionQuality=0 144 | +CVars=r.ShadowQuality=2 145 | ; HZB will be slower with tiled, and not needed 146 | +CVars=r.HZBOcclusion=0 147 | ; Non need for depth prepass 148 | +CVars=r.EarlyZPass=0 149 | +CVars=r.EarlyZPassMovable=0 150 | ; Needs geometry shader support 151 | +CVars=r.TranslucentLightingVolume=0 152 | ; Needs geometry shader support 153 | +CVars=r.AllowPointLightCubemapShadows=0 154 | ; Temporal AA (?) looks blurry right now 155 | +CVars=r.PostProcessAAQuality=0 156 | ; Not sure on this one - may need the whole D Buffer stuff going 157 | +CVars=r.Decal.StencilSizeThreshold=-1 158 | +CVars=slate.AbsoluteIndices=1 159 | +CVars=r.MorphTarget.Mode=0 160 | 161 | [iPad2 DeviceProfile] 162 | DeviceType=IOS 163 | BaseProfileName=IOS 164 | +CVars=r.RenderTargetSwitchWorkaround=1 165 | 166 | [iPad3 DeviceProfile] 167 | DeviceType=IOS 168 | BaseProfileName=IOS 169 | +CVars=r.RenderTargetSwitchWorkaround=1 170 | 171 | [iPad4 DeviceProfile] 172 | DeviceType=IOS 173 | BaseProfileName=IOS 174 | +CVars=r.RenderTargetSwitchWorkaround=1 175 | 176 | [iPadAir DeviceProfile] 177 | DeviceType=IOS 178 | BaseProfileName=IOS 179 | +CVars=r.BloomQuality=1 180 | 181 | [iPadAir2 DeviceProfile] 182 | DeviceType=IOS 183 | BaseProfileName=IOS 184 | +CVars=r.BloomQuality=1 185 | +CVars=r.DepthOfFieldQuality=1 186 | +CVars=r.LightShaftQuality=1 187 | +CVars=r.RefractionQuality=1 188 | 189 | [iPadMini DeviceProfile] 190 | DeviceType=IOS 191 | BaseProfileName=IOS 192 | +CVars=r.RenderTargetSwitchWorkaround=1 193 | 194 | [iPadMini2 DeviceProfile] 195 | DeviceType=IOS 196 | BaseProfileName=iPadAir 197 | 198 | [iPadMini4 DeviceProfile] 199 | DeviceType=IOS 200 | BaseProfileName=iPadMini2 201 | +CVars=r.RefractionQuality=1 202 | 203 | [iPhone4 DeviceProfile] 204 | DeviceType=IOS 205 | BaseProfileName=IOS 206 | +CVars=r.RenderTargetSwitchWorkaround=1 207 | 208 | [iPhone4S DeviceProfile] 209 | DeviceType=IOS 210 | BaseProfileName=IOS 211 | +CVars=r.RenderTargetSwitchWorkaround=1 212 | 213 | [iPhone5 DeviceProfile] 214 | DeviceType=IOS 215 | BaseProfileName=IOS 216 | +CVars=r.RenderTargetSwitchWorkaround=1 217 | 218 | [iPhone5S DeviceProfile] 219 | DeviceType=IOS 220 | BaseProfileName=IOS 221 | +CVars=r.MobileContentScaleFactor=2 222 | +CVars=r.BloomQuality=1 223 | +CVars=r.DepthOfFieldQuality=1 224 | +CVars=r.LightShaftQuality=1 225 | +CVars=r.RefractionQuality=1 226 | 227 | [iPodTouch5 DeviceProfile] 228 | DeviceType=IOS 229 | BaseProfileName=IOS 230 | +CVars=r.RenderTargetSwitchWorkaround=1 231 | 232 | [iPodTouch6 DeviceProfile] 233 | DeviceType=IOS 234 | BaseProfileName=iPhone6 235 | +CVars=r.MobileContentScaleFactor=2 236 | 237 | [iPhone6 DeviceProfile] 238 | DeviceType=IOS 239 | BaseProfileName=IOS 240 | +CVars=r.MobileContentScaleFactor=2 241 | +CVars=r.BloomQuality=1 242 | +CVars=r.DepthOfFieldQuality=1 243 | +CVars=r.LightShaftQuality=1 244 | +CVars=r.RefractionQuality=1 245 | 246 | [iPhone6Plus DeviceProfile] 247 | DeviceType=IOS 248 | BaseProfileName=IOS 249 | +CVars=r.MobileContentScaleFactor=2 250 | +CVars=r.BloomQuality=1 251 | +CVars=r.DepthOfFieldQuality=1 252 | +CVars=r.LightShaftQuality=1 253 | +CVars=r.RefractionQuality=1 254 | 255 | [iPhone6S DeviceProfile] 256 | DeviceType=IOS 257 | BaseProfileName=iPhone6 258 | +CVars=r.MobileContentScaleFactor=2 259 | 260 | [iPhone6SPlus DeviceProfile] 261 | DeviceType=IOS 262 | BaseProfileName=iPhone6Plus 263 | +CVars=r.MobileContentScaleFactor=2 264 | 265 | [iPhoneSE DeviceProfile] 266 | DeviceType=IOS 267 | BaseProfileName=IOS 268 | +CVars=r.MobileContentScaleFactor=2 269 | +CVars=r.BloomQuality=1 270 | +CVars=r.DepthOfFieldQuality=1 271 | +CVars=r.LightShaftQuality=1 272 | +CVars=r.RefractionQuality=1 273 | 274 | [iPhone7 DeviceProfile] 275 | DeviceType=IOS 276 | BaseProfileName=iPhone6 277 | +CVars=r.MobileContentScaleFactor=2 278 | 279 | [iPhone7Plus DeviceProfile] 280 | DeviceType=IOS 281 | BaseProfileName=iPhone6Plus 282 | +CVars=r.MobileContentScaleFactor=2 283 | 284 | [iPhone8 DeviceProfile] 285 | DeviceType=IOS 286 | BaseProfileName=iPhone7 287 | 288 | [iPhone8Plus DeviceProfile] 289 | DeviceType=IOS 290 | BaseProfileName=iPhone7Plus 291 | 292 | [iPhoneX DeviceProfile] 293 | DeviceType=IOS 294 | BaseProfileName=iPhone8 295 | +CVars=r.CustomUnsafeZones="(L:free[0,-15][812,15]);(P:fixed[83,0][206,30])" 296 | 297 | [iPhoneXS DeviceProfile] 298 | DeviceType=IOS 299 | BaseProfileName=iPhone8 300 | +CVars=r.CustomUnsafeZones="(L:free[0,-15][812,15]);(P:fixed[83,0][206,30])" 301 | 302 | [iPhoneXSMax DeviceProfile] 303 | DeviceType=IOS 304 | BaseProfileName=iPhone8 305 | +CVars=r.CustomUnsafeZones="(L:free[0,-15][812,15]);(P:fixed[83,0][206,30])" 306 | 307 | [iPhoneXR DeviceProfile] 308 | DeviceType=IOS 309 | BaseProfileName=iPhone8 310 | +CVars=r.CustomUnsafeZones="(L:free[0,-15][812,15]);(P:fixed[83,0][206,30])" 311 | 312 | [iPadPro DeviceProfile] 313 | DeviceType=IOS 314 | BaseProfileName=IOS 315 | +CVars=r.BloomQuality=1 316 | +CVars=r.DepthOfFieldQuality=1 317 | +CVars=r.LightShaftQuality=1 318 | +CVars=r.RefractionQuality=1 319 | +CVars=r.MobileContentScaleFactor=1.5 320 | +CVars=g.TimeoutForBlockOnRenderFence=3000000 321 | +CVars=r.Decal.StencilSizeThreshold=0.1 322 | +CVars=r.MetalComputeParameterSize=1024 323 | +CVars=r.EarlyZPass=3 324 | +CVars=r.EarlyZPassMovable=1 325 | +CVars=r.PostProcessAAQuality=4 326 | 327 | [AppleTV DeviceProfile] 328 | DeviceType=IOS 329 | BaseProfileName=IOS 330 | +CVars=r.BloomQuality=1 331 | +CVars=r.DepthOfFieldQuality=1 332 | +CVars=r.LightShaftQuality=1 333 | +CVars=r.RefractionQuality=1 334 | 335 | [AppleTV4K DeviceProfile] 336 | DeviceType=IOS 337 | BaseProfileName=AppleTV 338 | 339 | [iPadPro97 DeviceProfile] 340 | DeviceType=IOS 341 | BaseProfileName=IPadPro 342 | 343 | [iPadPro129 DeviceProfile] 344 | DeviceType=IOS 345 | BaseProfileName=IPadPro 346 | 347 | [iPadPro105 DeviceProfile] 348 | DeviceType=IOS 349 | BaseProfileName=IPadPro 350 | 351 | [iPadPro11 DeviceProfile] 352 | DeviceType=IOS 353 | BaseProfileName=IPadPro 354 | 355 | [iPad5 DeviceProfile] 356 | DeviceType=IOS 357 | BaseProfileName=IPadPro97 358 | 359 | [iPad6 DeviceProfile] 360 | DeviceType=IOS 361 | BaseProfileName=IPadPro97 362 | 363 | [iPadPro2_129 DeviceProfile] 364 | DeviceType=IOS 365 | BaseProfileName=IPadPro 366 | 367 | [iPadPro3_129 DeviceProfile] 368 | DeviceType=IOS 369 | BaseProfileName=IPadPro 370 | 371 | [/Script/AndroidDeviceProfileSelector.AndroidDeviceProfileMatchingRules] 372 | MatchProfile=(Profile="Android_PowerVR54x",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="PowerVR SGX 54[0-9]"))) 373 | +MatchProfile=(Profile="Android_PowerVRMid",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="PowerVR"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 3\\."))) 374 | +MatchProfile=(Profile="Android_PowerVRLow",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="PowerVR"))) 375 | +MatchProfile=(Profile="Android_Adreno2xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 2[0-9][0-9]"))) 376 | +MatchProfile=(Profile="Android_Adreno320",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="Adreno (TM) 320"))) 377 | +MatchProfile=(Profile="Android_Adreno330_Ver53",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="Adreno (TM) 330"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="ES 3\\.0 V@([0-9]+)"),(SourceType=SRC_PreviousRegexMatch,CompareType=CMP_GreaterEqual,MatchString="53"))) 378 | +MatchProfile=(Profile="Android_Adreno330",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="Adreno (TM) 330"))) 379 | +MatchProfile=(Profile="Android_Adreno4xx_Nexus6",Match=((SourceType=SRC_DeviceModel,CompareType=CMP_Equal,MatchString="Nexus 6"))) 380 | +MatchProfile=(Profile="Android_Adreno4xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 4[0-9][0-9]"))) 381 | +MatchProfile=(Profile="Android_Adreno51x",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 51[0-9]"))) 382 | +MatchProfile=(Profile="Android_Adreno5xx_Vulkan_Nougat",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 5[0-9][0-9]"),,(SourceType=SRC_VulkanAvailable,CompareType=CMP_Equal,MatchString="true"),(SourceType=SRC_AndroidVersion,CompareType=CMP_Regex,MatchString="7\\."))) 383 | +MatchProfile=(Profile="Android_Adreno5xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 5[0-9][0-9]"))) 384 | +MatchProfile=(Profile="Android_Adreno6xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="Adreno \\(TM\\) 6[0-9][0-9]"))) 385 | +MatchProfile=(Profile="Android_TegraK1",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="NVIDIA Tegra"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 3\\."))) 386 | +MatchProfile=(Profile="Android_Tegra4",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="NVIDIA Tegra"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 2\\."))) 387 | +MatchProfile=(Profile="Android_IntelHD_ES3",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="Intel(R) HD Graphics"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 3\\."))) 388 | +MatchProfile=(Profile="Android_IntelHD",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Equal,MatchString="Intel(R) HD Graphics"),(SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 2\\."))) 389 | +MatchProfile=(Profile="Android_Mali_4xx_LenovoS939",Match=((SourceType=SRC_DeviceModel,CompareType=CMP_Equal,MatchString="Lenovo S939"))) 390 | +MatchProfile=(Profile="Android_Mali_4xx_LenovoA7600",Match=((SourceType=SRC_DeviceModel,CompareType=CMP_Regex,MatchString="^Lenovo A7600"))) 391 | +MatchProfile=(Profile="Android_Mali_4xx_WikoHighwaySigns",Match=((SourceType=SRC_DeviceMake,CompareType=CMP_Equal,MatchString="Wiko"),(SourceType=SRC_DeviceModel,CompareType=CMP_Equal,MatchString="Highway Signs"))) 392 | +MatchProfile=(Profile="Android_Mali_4xx_AlcatelPixi3",Match=((SourceType=SRC_DeviceMake,CompareType=CMP_Equal,MatchString="Alcatel"),(SourceType=SRC_DeviceModel,CompareType=CMP_Equal,MatchString="Pixi 3 (4) 3G"))) 393 | +MatchProfile=(Profile="Android_Mali_4xx_KindleFire7",Match=((SourceType=SRC_DeviceModel,CompareType=CMP_Equal,MatchString="KFFOWI"))) 394 | +MatchProfile=(Profile="Android_Mali_4xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-4"))) 395 | +MatchProfile=(Profile="Android_Mali_T6xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-T6"))) 396 | +MatchProfile=(Profile="Android_Mali_T7xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-T7"))) 397 | +MatchProfile=(Profile="Android_Mali_T8xx_No_Vulkan",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-T8"),(SourceType=SRC_VulkanVersion,CompareType=CMP_Regex,MatchString="^1\\.0\\.([0-9]+)"),(SourceType=SRC_PreviousRegexMatch,CompareType=CMP_Less,MatchString="11"))) 398 | +MatchProfile=(Profile="Android_Mali_T8xx_No_Vulkan",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-T8"),(SourceType=SRC_AndroidVersion, CompareType=CMP_Regex,MatchString="([0-9]).*"),(SourceType=SRC_PreviousRegexMatch,CompareType=CMP_Less,MatchString="8"))) 399 | +MatchProfile=(Profile="Android_Mali_T8xx",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-T8"))) 400 | +MatchProfile=(Profile="Android_Mali_G71",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-G71"))) 401 | +MatchProfile=(Profile="Android_Mali_G72",Match=((SourceType=SRC_GpuFamily,CompareType=CMP_Regex,MatchString="^Mali\\-G72"))) 402 | +MatchProfile=(Profile="Android_Mid",Match=((SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 3\\."))) 403 | +MatchProfile=(Profile="Android_Low",Match=((SourceType=SRC_GlVersion,CompareType=CMP_Regex,MatchString="^OpenGL ES 2\\."))) 404 | 405 | [/Script/AndroidDeviceProfileSelector.AndroidJavaSurfaceViewDevices] 406 | SurfaceViewDevices=(Manufacturer="Amazon",Model="Kindle Fire") ; Kindle Fire (2011) 407 | +SurfaceViewDevices=(Manufacturer="Amazon",Model="KFOT") ; Kindle Fire (2012) 408 | +SurfaceViewDevices=(Manufacturer="Amazon",Model="KFTT") ; Kindle Fire HD 7" 2012 (WiFi) 409 | +SurfaceViewDevices=(Manufacturer="Amazon",Model="KFJWA") ; Kindle Fire HD 8.9" 2012 (WAN) 410 | +SurfaceViewDevices=(Manufacturer="Amazon",Model="KFJWI") ; Kindle Fire HD 8.9" 2012 (WiFi) 411 | +SurfaceViewDevices=(Manufacturer="HTC",Model="HTC6435LVW") ; HTC One M7 412 | 413 | [Android DeviceProfile] 414 | DeviceType=Android 415 | BaseProfileName= 416 | +CVars=r.MobileContentScaleFactor=1 417 | +CVars=r.BloomQuality=0 418 | +CVars=r.DepthOfFieldQuality=0 419 | +CVars=r.LightShaftQuality=0 420 | +CVars=r.RefractionQuality=0 421 | +CVars=r.ShadowQuality=2 422 | +CVars=slate.AbsoluteIndices=1 423 | +CVars=r.Vulkan.DelayAcquireBackBuffer=0 424 | +CVars=r.Vulkan.RobustBufferAccess=1 425 | +CVars=r.Vulkan.DescriptorSetLayoutMode=2 426 | 427 | [Android_Low DeviceProfile] 428 | DeviceType=Android 429 | BaseProfileName=Android 430 | +CVars=r.MobileContentScaleFactor=0.5 431 | +CVars=r.ShadowQuality=1 432 | +CVars=sg.EffectsQuality=0 433 | 434 | [Android_Mid DeviceProfile] 435 | DeviceType=Android 436 | BaseProfileName=Android 437 | +CVars=r.BloomQuality=1 438 | +CVars=r.MobileContentScaleFactor=0.8 439 | 440 | [Android_High DeviceProfile] 441 | DeviceType=Android 442 | BaseProfileName=Android 443 | +CVars=r.BloomQuality=1 444 | +CVars=r.DepthOfFieldQuality=1 445 | +CVars=r.LightShaftQuality=1 446 | +CVars=r.RefractionQuality=1 447 | +CVars=r.MobileContentScaleFactor=1.0 448 | 449 | [Android_Default DeviceProfile] 450 | DeviceType=Android 451 | BaseProfileName=Android_Mid 452 | 453 | [Android_Adreno320 DeviceProfile] 454 | DeviceType=Android 455 | BaseProfileName=Android_Mid 456 | 457 | ;This offset needs to be set for the mosaic fallback to work on Galaxy S4 (SAMSUNG-IGH-I337) 458 | ;+CVars=r.DemosaicVposOffset=0.5 459 | 460 | [Android_Adreno2xx DeviceProfile] 461 | DeviceType=Android 462 | BaseProfileName=Android_Low 463 | 464 | [Android_Adreno330 DeviceProfile] 465 | DeviceType=Android 466 | BaseProfileName=Android_High 467 | +CVars=OpenGL.UseBufferDiscard=0 468 | 469 | [Android_Adreno330_Ver53 DeviceProfile] 470 | DeviceType=Android 471 | BaseProfileName=Android_Adreno330 472 | +CVars=r.DisjointTimerQueries=0 473 | 474 | [Android_Adreno51x DeviceProfile] 475 | DeviceType=Android 476 | BaseProfileName=Android_High 477 | +CVars=r.OpenGL.StripExtensions=GL_EXT_shader_framebuffer_fetch 478 | 479 | [Android_Adreno5xx DeviceProfile] 480 | DeviceType=Android 481 | BaseProfileName=Android_High 482 | +CVars=r.DisjointTimerQueries=1 483 | 484 | [Android_Adreno5xx_Vulkan_Nougat DeviceProfile] 485 | DeviceType=Android 486 | BaseProfileName=Android_Adreno5xx 487 | ; vulkan occlusion queries do not work on this device/android version atm 488 | +CVars=r.AllowOcclusionQueries=0 489 | 490 | [Android_Adreno6xx DeviceProfile] 491 | DeviceType=Android 492 | BaseProfileName=Android_High 493 | +CVars=r.DisjointTimerQueries=1 494 | 495 | [Android_Adreno4xx DeviceProfile] 496 | DeviceType=Android 497 | BaseProfileName=Android_High 498 | 499 | [Android_Adreno4xx_Nexus6 DeviceProfile] 500 | DeviceType=Android 501 | BaseProfileName=Android_Adreno4xx 502 | 503 | [Android_PowerVR54x DeviceProfile] 504 | DeviceType=Android 505 | BaseProfileName=Android_Mid 506 | +CVars=r.Mobile.ForceDepthResolve=1 507 | +CVars=r.Android.DisableASTCSupport=1 508 | 509 | [Android_PowerVRMid DeviceProfile] 510 | DeviceType=Android 511 | BaseProfileName=Android_Mid 512 | +CVars=r.Mobile.ForceDepthResolve=1 513 | +CVars=r.Android.DisableASTCSupport=1 514 | 515 | [Android_PowerVRLow DeviceProfile] 516 | DeviceType=Android 517 | BaseProfileName=Android_Low 518 | +CVars=r.Mobile.ForceDepthResolve=1 519 | +CVars=r.Android.DisableASTCSupport=1 520 | 521 | [Android_IntelHD DeviceProfile] 522 | DeviceType=Android 523 | BaseProfileName=Android_Low 524 | 525 | [Android_IntelHD_ES3 DeviceProfile] 526 | DeviceType=Android 527 | BaseProfileName=Android 528 | +CVars=r.BloomQuality=1 529 | 530 | [Android_Mali_4xx DeviceProfile] 531 | DeviceType=Android 532 | BaseProfileName=Android_Low 533 | 534 | [Android_Mali_4xx_LenovoS939 DeviceProfile] 535 | DeviceType=Android 536 | BaseProfileName=Android_Mali_4xx 537 | +CVars=r.AndroidDisableThreadedRendering=1 538 | 539 | [Android_Mali_4xx_LenovoA7600 DeviceProfile] 540 | DeviceType=Android 541 | BaseProfileName=Android_Mali_4xx 542 | +CVars=r.AndroidDisableThreadedRendering=1 543 | 544 | [Android_Mali_4xx_WikoHighwaySigns DeviceProfile] 545 | DeviceType=Android 546 | BaseProfileName=Android_Mali_4xx 547 | +CVars=r.AndroidDisableThreadedRendering=1 548 | 549 | [Android_Mali_4xx_AlcatelPixi3 DeviceProfile] 550 | DeviceType=Android 551 | BaseProfileName=Android_Mali_4xx 552 | +CVars=r.AndroidDisableThreadedRendering=1 553 | 554 | [Android_Mali_4xx_KindleFire7 DeviceProfile] 555 | DeviceType=Android 556 | BaseProfileName=Android_Mali_4xx 557 | +CVars=r.AndroidDisableThreadedRendering=1 558 | +CVars=r.AndroidDisableThreadedRenderingFirstLoad=1 559 | 560 | [Android_Mali_T6xx DeviceProfile] 561 | DeviceType=Android 562 | BaseProfileName=Android_Mid 563 | 564 | [Android_Mali_T7xx DeviceProfile] 565 | DeviceType=Android 566 | BaseProfileName=Android_High 567 | 568 | [Android_Mali_T8xx DeviceProfile] 569 | DeviceType=Android 570 | BaseProfileName=Android_High 571 | 572 | [Android_Mali_G71 DeviceProfile] 573 | DeviceType=Android 574 | BaseProfileName=Android_High 575 | 576 | [Android_Mali_G72 DeviceProfile] 577 | DeviceType=Android 578 | BaseProfileName=Android_High 579 | 580 | [Android_TegraK1 DeviceProfile] 581 | DeviceType=Android 582 | BaseProfileName=Android_High 583 | 584 | [Android_Tegra4 DeviceProfile] 585 | DeviceType=Android 586 | BaseProfileName=Android_Mid 587 | 588 | [Android_Mali_T8xx_No_Vulkan DeviceProfile] 589 | DeviceType=Android 590 | BaseProfileName=Android_Mali_T8xx 591 | +CVars=r.Android.DisableVulkanSupport=1 592 | 593 | [Lumin DeviceProfile] 594 | ; @todo Lumin: Android - no! 595 | DeviceType=Android 596 | +CVars=r.defaultfeature.postprocessing=0 597 | +CVars=r.Lumin.OverrideExternalTextureSupport=4 598 | +CVars=r.Vulkan.DelayAcquireBackBuffer=1 599 | +CVars=vr.DebugCanvasInLayer=1 600 | +CVars=r.Vulkan.RHIThread=0 601 | 602 | [HTML5 DeviceProfile] 603 | DeviceType=HTML5 604 | BaseProfileName= 605 | +CVars=r.RefractionQuality=1 606 | 607 | [Mac DeviceProfile] 608 | DeviceType=Mac 609 | BaseProfileName= 610 | +CVars=r.Shaders.ZeroInitialise=1 611 | +CVars=r.Shaders.BoundsChecking=1 612 | 613 | [MacClient DeviceProfile] 614 | DeviceType=Mac 615 | BaseProfileName=Mac 616 | 617 | [MacNoEditor DeviceProfile] 618 | DeviceType=Mac 619 | BaseProfileName=Mac 620 | 621 | [MacServer DeviceProfile] 622 | DeviceType=Mac 623 | BaseProfileName=Mac 624 | 625 | [Linux DeviceProfile] 626 | DeviceType=Linux 627 | BaseProfileName= 628 | MeshLODSettings= 629 | TextureLODSettings= 630 | 631 | [LinuxNoEditor DeviceProfile] 632 | DeviceType=Linux 633 | BaseProfileName=Linux 634 | MeshLODSettings= 635 | TextureLODSettings= 636 | 637 | [LinuxServer DeviceProfile] 638 | DeviceType=Linux 639 | BaseProfileName=Linux 640 | MeshLODSettings= 641 | TextureLODSettings= 642 | -------------------------------------------------------------------------------- /Config/DefaultEditor.ini: -------------------------------------------------------------------------------- 1 | [UnrealEd.SimpleMap] 2 | SimpleMapName=/Game/SideScroller/Maps/SideScrollerExampleMap 3 | 4 | [EditoronlyBP] 5 | bAllowClassAndBlueprintPinMatching=true 6 | bReplaceBlueprintWithClass= true 7 | bDontLoadBlueprintOutsideEditor= true 8 | bBlueprintIsNotBlueprintType= true 9 | 10 | [/Script/UnrealEd.LevelEditor2DSettings] 11 | bEnableSnapLayers=True 12 | SnapAxis=X 13 | +SnapLayers=(Name="Foreground",Depth=1500.000000) 14 | +SnapLayers=(Name="Default",Depth=1200.000000) 15 | +SnapLayers=(Name="Background",Depth=900.000000) 16 | 17 | -------------------------------------------------------------------------------- /Config/DefaultEditorPerProjectUserSettings.ini: -------------------------------------------------------------------------------- 1 | [ContentBrowser] 2 | ContentBrowserTab1.SelectedPaths=/Game/SideScroller -------------------------------------------------------------------------------- /Config/DefaultEngine.ini: -------------------------------------------------------------------------------- 1 | [/Script/EngineSettings.GameMapsSettings] 2 | EditorStartupMap=/Game/Maps/TestsMap.TestsMap 3 | LocalMapOptions= 4 | TransitionMap= 5 | bUseSplitscreen=True 6 | TwoPlayerSplitscreenLayout=Horizontal 7 | ThreePlayerSplitscreenLayout=FavorTop 8 | GameInstanceClass=/Script/Engine.GameInstance 9 | GameDefaultMap=/Game/Maps/SideScrollerExampleMap.SideScrollerExampleMap 10 | ServerDefaultMap=/Engine/Maps/Entry 11 | GlobalDefaultGameMode=/Script/CamVol.CamVolGameMode 12 | GlobalDefaultServerGameMode=None 13 | 14 | [/Script/IOSRuntimeSettings.IOSRuntimeSettings] 15 | MinimumiOSVersion=IOS_11 16 | bSupportsPortraitOrientation=False 17 | bSupportsUpsideDownOrientation=False 18 | bSupportsLandscapeLeftOrientation=True 19 | PreferredLandscapeOrientation=LandscapeLeft 20 | 21 | [/Script/HardwareTargeting.HardwareTargetingSettings] 22 | TargetedHardwareClass=Desktop 23 | AppliedTargetedHardwareClass=Desktop 24 | DefaultGraphicsPerformance=Maximum 25 | AppliedDefaultGraphicsPerformance=Maximum 26 | 27 | [/Script/AndroidRuntimeSettings.AndroidRuntimeSettings] 28 | PackageName=redcatbox.CameraVolumesExample 29 | VersionDisplayName=1 30 | MinSDKVersion=26 31 | TargetSDKVersion=28 32 | InstallLocation=Auto 33 | bDisableVerifyOBBOnStartUp=True 34 | bUseExternalFilesDir=True 35 | Orientation=SensorLandscape 36 | bBuildForArm64=True 37 | 38 | [/Script/Engine.RendererSettings] 39 | r.MobileHDR=False 40 | r.Mobile.DisableVertexFog=False 41 | 42 | [/Script/Engine.PhysicsSettings] 43 | DefaultGravityZ=-980.000000 44 | DefaultTerminalVelocity=4000.000000 45 | DefaultFluidFriction=0.300000 46 | SimulateScratchMemorySize=262144 47 | RagdollAggregateThreshold=4 48 | TriangleMeshTriangleMinAreaThreshold=5.000000 49 | bEnableShapeSharing=False 50 | bEnablePCM=True 51 | bEnableStabilization=False 52 | bWarnMissingLocks=True 53 | bEnable2DPhysics=False 54 | PhysicErrorCorrection=(PingExtrapolation=0.100000,PingLimit=100.000000,ErrorPerLinearDifference=1.000000,ErrorPerAngularDifference=1.000000,MaxRestoredStateError=1.000000,MaxLinearHardSnapDistance=400.000000,PositionLerp=0.000000,AngleLerp=0.400000,LinearVelocityCoefficient=100.000000,AngularVelocityCoefficient=10.000000,ErrorAccumulationSeconds=0.500000,ErrorAccumulationDistanceSq=15.000000,ErrorAccumulationSimilarity=100.000000) 55 | LockedAxis=Invalid 56 | DefaultDegreesOfFreedom=Full3D 57 | BounceThresholdVelocity=200.000000 58 | FrictionCombineMode=Average 59 | RestitutionCombineMode=Average 60 | MaxAngularVelocity=3600.000000 61 | MaxDepenetrationVelocity=0.000000 62 | ContactOffsetMultiplier=0.020000 63 | MinContactOffset=2.000000 64 | MaxContactOffset=8.000000 65 | bSimulateSkeletalMeshOnDedicatedServer=True 66 | DefaultShapeComplexity=CTF_UseSimpleAndComplex 67 | bDefaultHasComplexCollision=True 68 | bSuppressFaceRemapTable=False 69 | bSupportUVFromHitResults=False 70 | bDisableActiveActors=False 71 | bDisableKinematicStaticPairs=False 72 | bDisableKinematicKinematicPairs=False 73 | bDisableCCD=False 74 | bEnableEnhancedDeterminism=False 75 | AnimPhysicsMinDeltaTime=0.000000 76 | bSimulateAnimPhysicsAfterReset=False 77 | MaxPhysicsDeltaTime=0.033333 78 | bSubstepping=False 79 | bSubsteppingAsync=False 80 | MaxSubstepDeltaTime=0.016667 81 | MaxSubsteps=6 82 | SyncSceneSmoothingFactor=0.000000 83 | InitialAverageFrameRate=0.016667 84 | PhysXTreeRebuildRate=10 85 | DefaultBroadphaseSettings=(bUseMBPOnClient=False,bUseMBPOnServer=False,bUseMBPOuterBounds=False,MBPBounds=(Min=(X=0.000000,Y=0.000000,Z=0.000000),Max=(X=0.000000,Y=0.000000,Z=0.000000),IsValid=0),MBPOuterBounds=(Min=(X=0.000000,Y=0.000000,Z=0.000000),Max=(X=0.000000,Y=0.000000,Z=0.000000),IsValid=0),MBPNumSubdivs=2) 86 | ChaosSettings=(DefaultThreadingModel=DedicatedThread,DedicatedThreadTickMode=VariableCappedWithTarget,DedicatedThreadBufferMode=Double) 87 | 88 | [/Script/AndroidFileServerEditor.AndroidFileServerRuntimeSettings] 89 | bEnablePlugin=True 90 | bAllowNetworkConnection=True 91 | SecurityToken=987EB35B468884B91E116586EE9786EE 92 | bIncludeInShipping=False 93 | bAllowExternalStartInShipping=False 94 | bCompileAFSProject=False 95 | bUseCompression=False 96 | bLogFiles=False 97 | bReportStats=False 98 | ConnectionType=USBOnly 99 | bUseManualIPAddress=False 100 | ManualIPAddress= 101 | 102 | [/Script/Engine.LocalPlayer] 103 | AspectRatioAxisConstraint=AspectRatio_MajorAxisFOV 104 | -------------------------------------------------------------------------------- /Config/DefaultGame.ini: -------------------------------------------------------------------------------- 1 | [/Script/EngineSettings.GeneralProjectSettings] 2 | ProjectID=8F88C8AE4D660C68F609F9855ED0680C 3 | ProjectName=Camera Volumes Example Project 4 | ProjectVersion=0.1.0.0 5 | CompanyName=redbox 6 | Homepage="https://github.com/redcatbox/CameraVolumes" 7 | CopyrightNotice=redbox, 2021 8 | 9 | [/Script/UnrealEd.ProjectPackagingSettings] 10 | BlueprintNativizationMethod=Disabled 11 | BuildConfiguration=PPBC_Development 12 | 13 | -------------------------------------------------------------------------------- /Config/DefaultInput.ini: -------------------------------------------------------------------------------- 1 | 2 | 3 | [/Script/Engine.InputSettings] 4 | -AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) 5 | -AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) 6 | -AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) 7 | -AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.25,Exponent=1.f,Sensitivity=1.f)) 8 | -AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) 9 | -AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) 10 | -AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.f,Exponent=1.f,Sensitivity=0.07f)) 11 | +AxisConfig=(AxisKeyName="Mouse2D",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) 12 | +AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 13 | +AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 14 | +AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 15 | +AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 16 | +AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) 17 | +AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False)) 18 | +AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_Z",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 19 | +AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Z",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 20 | +AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 21 | +AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 22 | +AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 23 | +AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 24 | +AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 25 | +AxisConfig=(AxisKeyName="MotionController_Left_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 26 | +AxisConfig=(AxisKeyName="MotionController_Left_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 27 | +AxisConfig=(AxisKeyName="MotionController_Left_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 28 | +AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 29 | +AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 30 | +AxisConfig=(AxisKeyName="MotionController_Right_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 31 | +AxisConfig=(AxisKeyName="MotionController_Right_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 32 | +AxisConfig=(AxisKeyName="MotionController_Right_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 33 | +AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 34 | +AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 35 | +AxisConfig=(AxisKeyName="Daydream_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 36 | +AxisConfig=(AxisKeyName="Daydream_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 37 | +AxisConfig=(AxisKeyName="Daydream_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 38 | +AxisConfig=(AxisKeyName="Daydream_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 39 | +AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 40 | +AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 41 | +AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 42 | +AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 43 | +AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 44 | +AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 45 | +AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 46 | +AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 47 | +AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 48 | +AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 49 | +AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 50 | +AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 51 | +AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 52 | +AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 53 | +AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 54 | +AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 55 | +AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 56 | +AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 57 | +AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 58 | +AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 59 | +AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 60 | +AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 61 | +AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 62 | +AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 63 | +AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 64 | +AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 65 | +AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 66 | +AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 67 | +AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 68 | +AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 69 | +AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 70 | +AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 71 | +AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Touch",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 72 | +AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 73 | +AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 74 | +AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 75 | +AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 76 | +AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 77 | +AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 78 | +AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 79 | +AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False)) 80 | bAltEnterTogglesFullscreen=True 81 | bF11TogglesFullscreen=True 82 | bUseMouseForTouch=False 83 | bEnableMouseSmoothing=True 84 | bEnableFOVScaling=True 85 | bCaptureMouseOnLaunch=True 86 | bEnableLegacyInputScales=True 87 | bEnableMotionControls=True 88 | bFilterInputByPlatformUser=False 89 | bEnableInputDeviceSubsystem=True 90 | bShouldFlushPressedKeysOnViewportFocusLost=True 91 | bEnableDynamicComponentInputBinding=True 92 | bAlwaysShowTouchInterface=False 93 | bShowConsoleOnFourFingerTap=True 94 | bEnableGestureRecognizer=False 95 | bUseAutocorrect=False 96 | DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown 97 | DefaultViewportMouseLockMode=LockOnCapture 98 | FOVScale=0.011110 99 | DoubleClickTime=0.200000 100 | +ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=SpaceBar) 101 | +ActionMappings=(ActionName="Jump",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=Gamepad_FaceButton_Bottom) 102 | +ActionMappings=(ActionName="Fire",bShift=False,bCtrl=False,bAlt=False,bCmd=False,Key=LeftMouseButton) 103 | +AxisMappings=(AxisName="MoveRight",Scale=-1.000000,Key=A) 104 | +AxisMappings=(AxisName="MoveRight",Scale=1.000000,Key=D) 105 | +AxisMappings=(AxisName="MoveRight",Scale=1.000000,Key=Gamepad_LeftX) 106 | +AxisMappings=(AxisName="MoveForward",Scale=-1.000000,Key=W) 107 | +AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=S) 108 | +AxisMappings=(AxisName="MoveForward",Scale=-1.000000,Key=Gamepad_LeftY) 109 | +AxisMappings=(AxisName="MoveUp",Scale=-1.000000,Key=Q) 110 | +AxisMappings=(AxisName="MoveUp",Scale=1.000000,Key=E) 111 | +AxisMappings=(AxisName="LookRight",Scale=1.000000,Key=Right) 112 | +AxisMappings=(AxisName="LookRight",Scale=-1.000000,Key=Left) 113 | +AxisMappings=(AxisName="LookUp",Scale=1.000000,Key=Up) 114 | +AxisMappings=(AxisName="LookUp",Scale=-1.000000,Key=Down) 115 | +AxisMappings=(AxisName="CameraRight",Scale=1.000000,Key=MouseX) 116 | +AxisMappings=(AxisName="CameraUp",Scale=-1.000000,Key=MouseY) 117 | +AxisMappings=(AxisName="CameraRight",Scale=1.000000,Key=Gamepad_RightX) 118 | +AxisMappings=(AxisName="CameraUp",Scale=1.000000,Key=Gamepad_RightY) 119 | +AxisMappings=(AxisName="LookRight",Scale=1.000000,Key=Gamepad_DPad_Right) 120 | +AxisMappings=(AxisName="LookRight",Scale=-1.000000,Key=Gamepad_DPad_Left) 121 | +AxisMappings=(AxisName="LookUp",Scale=1.000000,Key=Gamepad_DPad_Up) 122 | +AxisMappings=(AxisName="LookUp",Scale=-1.000000,Key=Gamepad_DPad_Down) 123 | DefaultPlayerInputClass=/Script/EnhancedInput.EnhancedPlayerInput 124 | DefaultInputComponentClass=/Script/EnhancedInput.EnhancedInputComponent 125 | DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks 126 | -ConsoleKeys=Tilde 127 | +ConsoleKeys=Tilde 128 | 129 | -------------------------------------------------------------------------------- /Content/2DSideScroller/Materials/PrototypingSpriteMaterial.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Materials/PrototypingSpriteMaterial.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/Background_Sprite.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/Background_Sprite.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/IdleAnimation.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/IdleAnimation.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/IdleFrames/IdleCycle1.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/IdleFrames/IdleCycle1.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/IdleFrames/IdleCycle2.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/IdleFrames/IdleCycle2.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/IdleFrames/IdleCycle3.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/IdleFrames/IdleCycle3.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/IdleFrames/IdleCycle4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/IdleFrames/IdleCycle4.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/IdleFrames/IdleCycle5.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/IdleFrames/IdleCycle5.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/IdleFrames/IdleCycle6.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/IdleFrames/IdleCycle6.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/IdleFrames/IdleCycle7.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/IdleFrames/IdleCycle7.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/IdleFrames/IdleCycle8.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/IdleFrames/IdleCycle8.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/Ledge.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/Ledge.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/PrototypingSprite.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/PrototypingSprite.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_1.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_1.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_10.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_10.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_11.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_11.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_12.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_12.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_13.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_13.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_14.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_14.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_15.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_15.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_16.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_16.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_2.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_2.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_3.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_3.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_4.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_5.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_5.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_6.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_6.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_7.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_7.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_8.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_8.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunFrames/RunCycle_9.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunFrames/RunCycle_9.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Sprites/RunningAnimation.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Sprites/RunningAnimation.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Textures/2DBackground.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Textures/2DBackground.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Textures/2DBackgroundBlockAtlas.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Textures/2DBackgroundBlockAtlas.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Textures/2DBackgroundTile.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Textures/2DBackgroundTile.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Textures/2DCharacter_IdleAnimAtlas.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Textures/2DCharacter_IdleAnimAtlas.uasset -------------------------------------------------------------------------------- /Content/2DSideScroller/Textures/2DCharacter_RunAnimAtlas.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/2DSideScroller/Textures/2DCharacter_RunAnimAtlas.uasset -------------------------------------------------------------------------------- /Content/Blueprints/2DRetroSS/BP_2DRetroCharacter.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/2DRetroSS/BP_2DRetroCharacter.uasset -------------------------------------------------------------------------------- /Content/Blueprints/2DRetroSS/BP_2DRetroGameMode.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/2DRetroSS/BP_2DRetroGameMode.uasset -------------------------------------------------------------------------------- /Content/Blueprints/2DSS/BP_CamVol2D_SS_GameMode.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/2DSS/BP_CamVol2D_SS_GameMode.uasset -------------------------------------------------------------------------------- /Content/Blueprints/2DSS/BP_CamVol2D_SS_PlayerCharacter.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/2DSS/BP_CamVol2D_SS_PlayerCharacter.uasset -------------------------------------------------------------------------------- /Content/Blueprints/2DTD/BP_CamVol2D_TD_GameMode.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/2DTD/BP_CamVol2D_TD_GameMode.uasset -------------------------------------------------------------------------------- /Content/Blueprints/2DTD/BP_CamVol2D_TD_PlayerCharacter.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/2DTD/BP_CamVol2D_TD_PlayerCharacter.uasset -------------------------------------------------------------------------------- /Content/Blueprints/BP_CamVolGameMode.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/BP_CamVolGameMode.uasset -------------------------------------------------------------------------------- /Content/Blueprints/BP_CamVolPlayerCharacter.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/BP_CamVolPlayerCharacter.uasset -------------------------------------------------------------------------------- /Content/Blueprints/BP_CamVolPlayerController.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/BP_CamVolPlayerController.uasset -------------------------------------------------------------------------------- /Content/Blueprints/BP_CameraManager.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/BP_CameraManager.uasset -------------------------------------------------------------------------------- /Content/Blueprints/Sequences/BP_CameraShake_01.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/Sequences/BP_CameraShake_01.uasset -------------------------------------------------------------------------------- /Content/Blueprints/Sequences/LevelSequence01.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/Sequences/LevelSequence01.uasset -------------------------------------------------------------------------------- /Content/Blueprints/ThirdPerson/BP_CamVolGameModeTP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/ThirdPerson/BP_CamVolGameModeTP.uasset -------------------------------------------------------------------------------- /Content/Blueprints/ThirdPerson/BP_CamVolPlayerCharacterTP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/ThirdPerson/BP_CamVolPlayerCharacterTP.uasset -------------------------------------------------------------------------------- /Content/Blueprints/TopDown/BP_CamVolGameModeTD.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/TopDown/BP_CamVolGameModeTD.uasset -------------------------------------------------------------------------------- /Content/Blueprints/TopDown/BP_CamVolPlayerCharacterTD.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Blueprints/TopDown/BP_CamVolPlayerCharacterTD.uasset -------------------------------------------------------------------------------- /Content/Geometry/M_Back_01.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Geometry/M_Back_01.uasset -------------------------------------------------------------------------------- /Content/Geometry/M_Floor_01.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Geometry/M_Floor_01.uasset -------------------------------------------------------------------------------- /Content/Geometry/M_Floor_01_Blue.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Geometry/M_Floor_01_Blue.uasset -------------------------------------------------------------------------------- /Content/Geometry/M_Floor_01_Green.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Geometry/M_Floor_01_Green.uasset -------------------------------------------------------------------------------- /Content/Geometry/M_Floor_01_Red.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Geometry/M_Floor_01_Red.uasset -------------------------------------------------------------------------------- /Content/Geometry/M_Floor_01_Yellow.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Geometry/M_Floor_01_Yellow.uasset -------------------------------------------------------------------------------- /Content/Geometry/Meshes/1M_Cube.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Geometry/Meshes/1M_Cube.uasset -------------------------------------------------------------------------------- /Content/Geometry/Meshes/CubesBlock.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Geometry/Meshes/CubesBlock.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonIdle.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Animations/ThirdPersonIdle.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonJump_End.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Animations/ThirdPersonJump_End.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonJump_Loop.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Animations/ThirdPersonJump_Loop.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonJump_Start.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Animations/ThirdPersonJump_Start.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonRun.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Animations/ThirdPersonRun.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPersonWalk.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Animations/ThirdPersonWalk.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPerson_AnimBP.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Animations/ThirdPerson_AnimBP.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPerson_IdleRun_2D.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Animations/ThirdPerson_IdleRun_2D.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Animations/ThirdPerson_Jump.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Animations/ThirdPerson_Jump.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/M_UE4Man_Body.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Materials/M_UE4Man_Body.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/M_UE4Man_ChestLogo.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Materials/M_UE4Man_ChestLogo.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Materials/MaterialLayers/ML_GlossyBlack_Latex_UE4.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Materials/MaterialLayers/ML_Plastic_Shiny_Beige_LOGO.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Materials/MaterialLayers/ML_SoftMetal_UE4.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Aluminum01.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Aluminum01.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Aluminum01_N.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_D.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Materials/MaterialLayers/T_ML_Rubber_Blue_01_N.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Mesh/SK_Mannequin.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Mesh/SK_Mannequin.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Mesh/SK_Mannequin_PhysicsAsset.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Mesh/SK_Mannequin_PhysicsAsset.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Mesh/UE4_Mannequin_Skeleton.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Mesh/UE4_Mannequin_Skeleton.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Textures/UE4Man_Logo_N.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Textures/UE4Man_Logo_N.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Textures/UE4_LOGO_CARD.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Textures/UE4_LOGO_CARD.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Textures/UE4_Mannequin_MAT_MASKA.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Textures/UE4_Mannequin_MAT_MASKA.uasset -------------------------------------------------------------------------------- /Content/Mannequin/Character/Textures/UE4_Mannequin__normals.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Mannequin/Character/Textures/UE4_Mannequin__normals.uasset -------------------------------------------------------------------------------- /Content/Maps/2DRetroSideScrollerExampleMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Maps/2DRetroSideScrollerExampleMap.umap -------------------------------------------------------------------------------- /Content/Maps/2DSideScrollerExampleMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Maps/2DSideScrollerExampleMap.umap -------------------------------------------------------------------------------- /Content/Maps/2DTopDownExampleMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Maps/2DTopDownExampleMap.umap -------------------------------------------------------------------------------- /Content/Maps/NotSideScrollerExampleMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Maps/NotSideScrollerExampleMap.umap -------------------------------------------------------------------------------- /Content/Maps/SideScrollerExampleMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Maps/SideScrollerExampleMap.umap -------------------------------------------------------------------------------- /Content/Maps/TestsMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Maps/TestsMap.umap -------------------------------------------------------------------------------- /Content/Maps/TestsRuntimeMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Maps/TestsRuntimeMap.umap -------------------------------------------------------------------------------- /Content/Maps/TestsStreamingMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Maps/TestsStreamingMap.umap -------------------------------------------------------------------------------- /Content/Maps/TopDownExampleMap.umap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Content/Maps/TopDownExampleMap.umap -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 redcatbox 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/CameraVolumes.uplugin: -------------------------------------------------------------------------------- 1 | { 2 | "FileVersion": 3, 3 | "Version": 1, 4 | "VersionName": "1.0", 5 | "FriendlyName": "CameraVolumes", 6 | "Description": "Advanced side-scroller camera behavior", 7 | "Category": "CameraVolumes", 8 | "CreatedBy": "redbox", 9 | "CreatedByURL": "", 10 | "DocsURL": "https://github.com/redcatbox/CameraVolumes/wiki", 11 | "MarketplaceURL": "com.epicgames.launcher://ue/marketplace/content/b851f8a1270e41b6b72dc209d6732eac", 12 | "SupportURL": "https://discord.gg/gVexAf", 13 | "CanContainContent": true, 14 | "IsBetaVersion": false, 15 | "IsExperimentalVersion": false, 16 | "Installed": true, 17 | "Modules": [ 18 | { 19 | "Name": "CameraVolumes", 20 | "Type": "Runtime", 21 | "LoadingPhase": "Default", 22 | "WhitelistPlatforms": [ 23 | "Win64", 24 | "Android" 25 | ] 26 | } 27 | ], 28 | "Plugins": [ 29 | { 30 | "Name": "Paper2D", 31 | "Enabled": true 32 | } 33 | ] 34 | } -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Config/DefaultCameraVolumes.ini: -------------------------------------------------------------------------------- 1 | ; This config contains global parameters and switchers. 2 | ; Comment them to have an ability to change values per-instance. 3 | 4 | [/Script/CameraVolumes.CameraVolumeActor] 5 | ;OpenEdgeOffset=10000.f 6 | ;VolumeExtentDefault=(X = 500.f,Y = 500.f,Z = 500.f) 7 | ;bUseZeroDepthExtent=false 8 | ;bUse6DOFVolume=true 9 | ;CameraProjectionMode=ECameraProjectionMode::Orthographic 10 | ;TextSize=50.f 11 | ;BillboardIconPath="/CameraVolumes/Icons/CameraVolume" 12 | 13 | [/Script/CameraVolumes.CameraVolumesCameraManager] 14 | ;bPerformBlockingCalculations=false 15 | 16 | [/Script/CameraVolumes.CameraVolumesCameraComponent] 17 | DeadZonePreviewMaterialPath="/CameraVolumes/Materials/DeadZonePreview" 18 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Config/FilterPlugin.ini: -------------------------------------------------------------------------------- 1 | [FilterPlugin] 2 | ; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and 3 | ; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively. 4 | ; 5 | ; Examples: 6 | ; /README.txt 7 | ; /Extras/... 8 | ; /Binaries/ThirdParty/*.dll 9 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Content/Icons/CameraVolume.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Plugins/CameraVolumes/Content/Icons/CameraVolume.uasset -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Content/Materials/DeadZonePreview.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Plugins/CameraVolumes/Content/Materials/DeadZonePreview.uasset -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Content/Materials/ScreenAspectRatioYX.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Plugins/CameraVolumes/Content/Materials/ScreenAspectRatioYX.uasset -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Content/Materials/ScreenPercentToFloat2.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Plugins/CameraVolumes/Content/Materials/ScreenPercentToFloat2.uasset -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Content/Materials/UnlitText.uasset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Plugins/CameraVolumes/Content/Materials/UnlitText.uasset -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Resources/Icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/redcatbox/CameraVolumes/373ffccde096865e00aae38edfb6d89926004a91/Plugins/CameraVolumes/Resources/Icon128.png -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/CameraVolumes.Build.cs: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | using UnrealBuildTool; 4 | 5 | public class CameraVolumes : ModuleRules 6 | { 7 | public CameraVolumes(ReadOnlyTargetRules Target) : base(Target) 8 | { 9 | PCHUsage = ModuleRules.PCHUsageMode.UseExplicitOrSharedPCHs; 10 | 11 | PublicIncludePaths.AddRange( 12 | new string[] { 13 | } 14 | ); 15 | 16 | 17 | PrivateIncludePaths.AddRange( 18 | new string[] { 19 | } 20 | ); 21 | 22 | 23 | PublicDependencyModuleNames.AddRange( 24 | new string[] 25 | { 26 | "Core", 27 | "CoreUObject", 28 | "Engine", 29 | "Paper2D", 30 | } 31 | ); 32 | 33 | 34 | PrivateDependencyModuleNames.AddRange( 35 | new string[] 36 | { 37 | } 38 | ); 39 | 40 | 41 | DynamicallyLoadedModuleNames.AddRange( 42 | new string[] 43 | { 44 | } 45 | ); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Private/CameraVolumeActor.cpp: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #include "CameraVolumeActor.h" 4 | #include "CameraVolumesCameraComponent.h" 5 | #include "CameraVolumesFunctionLibrary.h" 6 | #include "UObject/ConstructorHelpers.h" 7 | #include "Components/BillboardComponent.h" 8 | #include "Components/BoxComponent.h" 9 | #include "Components/TextRenderComponent.h" 10 | #include "Materials/MaterialInterface.h" 11 | 12 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CameraVolumeActor) 13 | 14 | ACameraVolumeActor::ACameraVolumeActor() 15 | { 16 | PrimaryActorTick.bCanEverTick = false; 17 | 18 | // Default root 19 | DefaultSceneRoot = CreateDefaultSubobject(TEXT("DefaultSceneRoot")); 20 | DefaultSceneRoot->SetMobility(EComponentMobility::Static); 21 | #if WITH_EDITORONLY_DATA 22 | DefaultSceneRoot->bVisualizeComponent = false; 23 | #endif 24 | RootComponent = DefaultSceneRoot; 25 | 26 | #if WITH_EDITORONLY_DATA 27 | // Billboard 28 | BillboardComponent = CreateDefaultSubobject(TEXT("BillboardComponent")); 29 | BillboardComponent->SetIsVisualizationComponent(true); 30 | BillboardComponent->SetupAttachment(RootComponent); 31 | 32 | // CameraPreview 33 | CameraPreview = CreateDefaultSubobject(TEXT("CameraPreview")); 34 | CameraPreview->SetupAttachment(RootComponent); 35 | #endif 36 | 37 | // BoxComponent 38 | BoxComponent = CreateDefaultSubobject(TEXT("BoxComponent")); 39 | BoxComponent->SetupAttachment(RootComponent); 40 | BoxComponent->SetCollisionEnabled(ECollisionEnabled::QueryOnly); 41 | BoxComponent->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore); 42 | BoxComponent->SetCollisionResponseToChannel(ECollisionChannel::ECC_Pawn, ECollisionResponse::ECR_Overlap); 43 | 44 | // Default values 45 | #if WITH_EDITORONLY_DATA 46 | bPerformCameraBlockingEditCond = true; 47 | #endif 48 | bPerformCameraBlocking = true; 49 | 50 | #if WITH_EDITORONLY_DATA 51 | CameraProjectionMode = ECameraProjectionMode::Perspective; 52 | #endif 53 | 54 | CameraMobility = ECameraMobility::ECM_Movable; 55 | 56 | bCameraLocationRelativeToVolume = true; 57 | 58 | CameraFieldOfView = 90.f; 59 | CameraOrthoWidth = 512.f; 60 | 61 | CameraSmoothTransitionSpeed = 1.f; 62 | SmoothTransitionEasingFunc = EEasingFunc::SinusoidalInOut; 63 | EasingFuncBlendExp = 2.f; 64 | EasingFuncSteps = 2; 65 | 66 | #if WITH_EDITORONLY_DATA 67 | TextSize = 50.f; 68 | #endif 69 | 70 | FrontSide.Side = ESide::ES_Front; 71 | BackSide.Side = ESide::ES_Back; 72 | RightSide.Side = ESide::ES_Right; 73 | LeftSide.Side = ESide::ES_Left; 74 | TopSide.Side = ESide::ES_Top; 75 | BottomSide.Side = ESide::ES_Bottom; 76 | 77 | #if WITH_EDITOR 78 | ACameraVolumeActor::CreateSidesIndicators(); 79 | #endif 80 | 81 | OpenEdgeOffset = 10000.f; 82 | VolumeExtentDefault = FVector(500.f); 83 | 84 | #if WITH_EDITORONLY_DATA 85 | BillboardIconPath = TEXT("/CameraVolumes/Icons/CameraVolume"); 86 | #endif 87 | 88 | LoadConfig(); 89 | 90 | VolumeExtent = VolumeExtentDefault; 91 | 92 | #if WITH_EDITORONLY_DATA 93 | static ConstructorHelpers::FObjectFinder TextureObj(*BillboardIconPath); 94 | if (TextureObj.Object) 95 | { 96 | BillboardComponent->Sprite = TextureObj.Object; 97 | } 98 | #endif 99 | 100 | UpdateVolume(); 101 | } 102 | 103 | void ACameraVolumeActor::UpdateVolume() 104 | { 105 | //Reset actor scale 106 | SetActorScale3D(FVector::OneVector); 107 | 108 | //Extents 109 | CalculateVolumeExtents(); 110 | 111 | //Components 112 | BoxComponent->ResetRelativeTransform(); 113 | BoxComponent->SetBoxExtent(VolumeExtent); 114 | SetDisableMainBoxCollision(bDisableMainBoxCollision); 115 | 116 | #if WITH_EDITORONLY_DATA 117 | BillboardComponent->SetRelativeLocation(FVector::ZeroVector); 118 | BillboardComponent->SetRelativeScale3D(FVector(5.f, 1.f, 1.f)); 119 | #endif 120 | 121 | if (bUse6DOFVolume) 122 | { 123 | #if WITH_EDITORONLY_DATA 124 | bUseZeroDepthExtentEditCond = false; 125 | #endif 126 | bUseZeroDepthExtent = false; 127 | } 128 | #if WITH_EDITORONLY_DATA 129 | else 130 | { 131 | bUseZeroDepthExtentEditCond = true; 132 | } 133 | #endif 134 | 135 | switch (CameraMobility) 136 | { 137 | case ECameraMobility::ECM_Movable: 138 | bIsCameraStatic = false; 139 | if (!bUseCameraRotationAxis) 140 | { 141 | bFocalPointIsPlayer = true; 142 | } 143 | #if WITH_EDITORONLY_DATA 144 | bFocalPointIsPlayerEditCond = bUseCameraRotationAxis; 145 | bUseCameraRotationAxisEditCond = true; 146 | bPerformCameraBlockingEditCond = true; 147 | bDisableCameraLocationLagEditCond = true; 148 | bDisableCameraRotationLagEditCond = true; 149 | bDoCollisionTestEditCond = true; 150 | #endif 151 | break; 152 | case ECameraMobility::ECM_Static: 153 | bIsCameraStatic = true; 154 | bOverrideCameraLocation = true; 155 | bUseCameraRotationAxis = false; 156 | #if WITH_EDITORONLY_DATA 157 | bFocalPointIsPlayerEditCond = true; 158 | bUseCameraRotationAxisEditCond = false; 159 | bPerformCameraBlockingEditCond = false; 160 | bDisableCameraLocationLagEditCond = false; 161 | bDisableCameraRotationLagEditCond = bFocalPointIsPlayer; 162 | bDoCollisionTestEditCond = false; 163 | #endif 164 | break; 165 | } 166 | 167 | if (!bOverrideCameraLocation) 168 | { 169 | CameraLocation = FVector(0.f, 1000.f, 0.f); 170 | } 171 | 172 | if (!bOverrideCameraRotation) 173 | { 174 | CameraFocalPoint = FVector::ZeroVector; 175 | CameraRoll = 0.f; 176 | CameraRotation = FRotator(0.f, -90.f, 0.f).Quaternion(); 177 | } 178 | else 179 | { 180 | CameraRotation = UCameraVolumesFunctionLibrary::CalculateCameraRotation(CameraLocation, CameraFocalPoint, CameraRoll); 181 | } 182 | 183 | if (!bOverrideCameraFieldOfView) 184 | { 185 | CameraFieldOfView = 90.f; 186 | } 187 | 188 | if (!bOverrideCameraOrthoWidth) 189 | { 190 | CameraOrthoWidth = 512.f; 191 | } 192 | 193 | #if WITH_EDITORONLY_DATA 194 | CameraPreview->ProjectionMode = CameraProjectionMode; 195 | 196 | CameraPreview->DefaultCameraLocation = CameraLocation; 197 | CameraPreview->DefaultCameraFocalPoint = CameraFocalPoint; 198 | CameraPreview->DefaultCameraRoll = CameraRoll; 199 | 200 | CameraPreview->DefaultCameraFieldOfView = CameraFieldOfView; 201 | CameraPreview->DefaultCameraOrthoWidth = CameraOrthoWidth; 202 | #endif 203 | 204 | #if WITH_EDITOR 205 | CameraPreview->UpdateCameraComponent(); 206 | UpdateSidesIndicators(); 207 | Modify(); 208 | #endif 209 | } 210 | 211 | void ACameraVolumeActor::CalculateVolumeExtents() 212 | { 213 | VolumeExtent = VolumeExtent.GetAbs(); 214 | CamVolMinCorrected = -VolumeExtent; 215 | CamVolMaxCorrected = VolumeExtent; 216 | 217 | if (RightSide.SideType == ESideType::EST_Open) 218 | { 219 | CamVolMaxCorrected.X += OpenEdgeOffset; 220 | } 221 | 222 | if (LeftSide.SideType == ESideType::EST_Open) 223 | { 224 | CamVolMinCorrected.X -= OpenEdgeOffset; 225 | } 226 | 227 | if (TopSide.SideType == ESideType::EST_Open) 228 | { 229 | CamVolMaxCorrected.Z += OpenEdgeOffset; 230 | } 231 | 232 | if (BottomSide.SideType == ESideType::EST_Open) 233 | { 234 | CamVolMinCorrected.Z -= OpenEdgeOffset; 235 | } 236 | 237 | if (bUse6DOFVolume) 238 | { 239 | if (FrontSide.SideType == ESideType::EST_Open) 240 | { 241 | CamVolMaxCorrected.Y += OpenEdgeOffset; 242 | } 243 | 244 | if (BackSide.SideType == ESideType::EST_Open) 245 | { 246 | CamVolMinCorrected.Y -= OpenEdgeOffset; 247 | } 248 | } 249 | 250 | if (bUseZeroDepthExtent) 251 | { 252 | CamVolMinCorrected.Y = 0.f; 253 | CamVolMaxCorrected.Y = 0.f; 254 | } 255 | 256 | CamVolExtentCorrected = (CamVolMaxCorrected - CamVolMinCorrected) * 0.5f; 257 | CamVolAspectRatio = CamVolExtentCorrected.X / CamVolExtentCorrected.Z; 258 | } 259 | 260 | FSideInfo ACameraVolumeActor::GetNearestVolumeSideInfo(const FVector& PlayerPawnLocation) const 261 | { 262 | ESide NearestSide = ESide::ES_Front; 263 | TMap Sides; 264 | const FVector PlayerPawnLocationTransformed = GetActorTransform().InverseTransformPositionNoScale(PlayerPawnLocation); 265 | 266 | if (bUse6DOFVolume) 267 | { 268 | Sides.Add(ESide::ES_Front, FMath::Abs(PlayerPawnLocationTransformed.Y - VolumeExtent.Y)); 269 | Sides.Add(ESide::ES_Back, FMath::Abs(PlayerPawnLocationTransformed.Y + VolumeExtent.Y)); 270 | Sides.Add(ESide::ES_Right, FMath::Abs(PlayerPawnLocationTransformed.X - VolumeExtent.X)); 271 | Sides.Add(ESide::ES_Left, FMath::Abs(PlayerPawnLocationTransformed.X + VolumeExtent.X)); 272 | Sides.Add(ESide::ES_Top, FMath::Abs(PlayerPawnLocationTransformed.Z - VolumeExtent.Z)); 273 | Sides.Add(ESide::ES_Bottom, FMath::Abs(PlayerPawnLocationTransformed.Z + VolumeExtent.Z)); 274 | } 275 | else 276 | { 277 | Sides.Add(ESide::ES_Right, FMath::Abs(PlayerPawnLocationTransformed.X - VolumeExtent.X)); 278 | Sides.Add(ESide::ES_Left, FMath::Abs(PlayerPawnLocationTransformed.X + VolumeExtent.X)); 279 | Sides.Add(ESide::ES_Top, FMath::Abs(PlayerPawnLocationTransformed.Z - VolumeExtent.Z)); 280 | Sides.Add(ESide::ES_Bottom, FMath::Abs(PlayerPawnLocationTransformed.Z + VolumeExtent.Z)); 281 | } 282 | 283 | Sides.ValueSort([](float Min, float Max) { return Min < Max; }); 284 | 285 | for (auto& Pair : Sides) 286 | { 287 | NearestSide = Pair.Key; 288 | break; 289 | } 290 | 291 | switch (NearestSide) 292 | { 293 | case ESide::ES_Front: 294 | return FrontSide; 295 | case ESide::ES_Back: 296 | return BackSide; 297 | case ESide::ES_Right: 298 | return RightSide; 299 | case ESide::ES_Left: 300 | return LeftSide; 301 | case ESide::ES_Top: 302 | return TopSide; 303 | case ESide::ES_Bottom: 304 | return BottomSide; 305 | default: 306 | UE_LOG(LogTemp, Warning, TEXT("Unknown side type! Using SideInfo(Front, Open, Normal)")); 307 | return FSideInfo(); 308 | } 309 | } 310 | 311 | #if WITH_EDITOR 312 | void ACameraVolumeActor::CreateSidesIndicators() 313 | { 314 | /** 315 | * Sides indicators 316 | * Priority [0] 317 | * SideInfo [1-18] 318 | */ 319 | Text_Indicators.SetNum(19); 320 | static ConstructorHelpers::FObjectFinder TextMaterialObj(TEXT("/CameraVolumes/Materials/UnlitText.UnlitText")); 321 | 322 | for (uint8 i = 0; i < 19; i++) 323 | { 324 | const FName ComponentName = *(FString(TEXT("TextRenderComponent")) + FString::FromInt(i)); 325 | Text_Indicators[i] = CreateDefaultSubobject(ComponentName); 326 | Text_Indicators[i]->SetupAttachment(RootComponent); 327 | Text_Indicators[i]->bHiddenInGame = true; 328 | Text_Indicators[i]->bAlwaysRenderAsText = true; 329 | Text_Indicators[i]->HorizontalAlignment = EHorizTextAligment::EHTA_Center; 330 | Text_Indicators[i]->VerticalAlignment = EVerticalTextAligment::EVRTA_TextCenter; 331 | Text_Indicators[i]->SetTextRenderColor(FColor::White); 332 | 333 | if (TextMaterialObj.Object) 334 | { 335 | Text_Indicators[i]->SetTextMaterial(TextMaterialObj.Object); 336 | } 337 | } 338 | } 339 | 340 | void ACameraVolumeActor::UpdateSidesIndicators() 341 | { 342 | //Priority 343 | Text_Indicators[0]->SetText(FText::FromString(FString::FromInt(Priority))); 344 | Text_Indicators[0]->SetWorldSize(2.f * TextSize); 345 | Text_Indicators[0]->SetRelativeLocationAndRotation(FVector(0.f, VolumeExtent.Y + 5.f, 0.f), FRotator(0.f, 90.f, 0.f)); 346 | 347 | //Sides 348 | for (uint8 i = 1; i <= 18; i = i + 3) 349 | { 350 | Text_Indicators[i]->SetWorldSize(TextSize); 351 | Text_Indicators[i + 1]->SetWorldSize(TextSize); 352 | Text_Indicators[i + 2]->SetWorldSize(TextSize); 353 | 354 | FSideInfo SideInfo; 355 | if (i == 1) 356 | { 357 | SideInfo = FrontSide; 358 | Text_Indicators[i]->SetText(Text_Front); 359 | Text_Indicators[i]->SetRelativeLocationAndRotation(FVector(0.f, VolumeExtent.Y - 2.5f * TextSize, VolumeExtent.Z + 5.f), FRotator(90.f, 90.f, 0.f)); 360 | Text_Indicators[i + 1]->SetRelativeLocationAndRotation(FVector(0.f, VolumeExtent.Y - 1.5f * TextSize, VolumeExtent.Z + 5.f), FRotator(90.f, 90.f, 0.f)); 361 | Text_Indicators[i + 2]->SetRelativeLocationAndRotation(FVector(0.f, VolumeExtent.Y - 0.5f * TextSize, VolumeExtent.Z + 5.f), FRotator(90.f, 90.f, 0.f)); 362 | 363 | if (bUse6DOFVolume) 364 | { 365 | Text_Indicators[i]->SetVisibility(true); 366 | Text_Indicators[i + 1]->SetVisibility(true); 367 | Text_Indicators[i + 2]->SetVisibility(true); 368 | } 369 | else 370 | { 371 | Text_Indicators[i]->SetVisibility(false); 372 | Text_Indicators[i + 1]->SetVisibility(false); 373 | Text_Indicators[i + 2]->SetVisibility(false); 374 | } 375 | } 376 | else if (i == 4) 377 | { 378 | SideInfo = BackSide; 379 | Text_Indicators[i]->SetText(Text_Back); 380 | Text_Indicators[i]->SetRelativeLocationAndRotation(FVector(0.f, -VolumeExtent.Y + 0.5f * TextSize, VolumeExtent.Z + 5.f), FRotator(90.f, 90.f, 0.f)); 381 | Text_Indicators[i + 1]->SetRelativeLocationAndRotation(FVector(0.f, -VolumeExtent.Y + 1.5f * TextSize, VolumeExtent.Z + 5.f), FRotator(90.f, 90.f, 0.f)); 382 | Text_Indicators[i + 2]->SetRelativeLocationAndRotation(FVector(0.f, -VolumeExtent.Y + 2.5f * TextSize, VolumeExtent.Z + 5.f), FRotator(90.f, 90.f, 0.f)); 383 | 384 | if (bUse6DOFVolume) 385 | { 386 | Text_Indicators[i]->SetVisibility(true); 387 | Text_Indicators[i + 1]->SetVisibility(true); 388 | Text_Indicators[i + 2]->SetVisibility(true); 389 | } 390 | else 391 | { 392 | Text_Indicators[i]->SetVisibility(false); 393 | Text_Indicators[i + 1]->SetVisibility(false); 394 | Text_Indicators[i + 2]->SetVisibility(false); 395 | } 396 | } 397 | else if (i == 7) 398 | { 399 | SideInfo = RightSide; 400 | Text_Indicators[i]->SetText(Text_Right); 401 | Text_Indicators[i]->SetRelativeLocationAndRotation(FVector(VolumeExtent.X - 2.f * TextSize, VolumeExtent.Y + 5.f, TextSize), FRotator(0.f, 90.f, 0.f)); 402 | Text_Indicators[i + 1]->SetRelativeLocationAndRotation(FVector(VolumeExtent.X - 2.f * TextSize, VolumeExtent.Y + 5.f, 0.f), FRotator(0.f, 90.f, 0.f)); 403 | Text_Indicators[i + 2]->SetRelativeLocationAndRotation(FVector(VolumeExtent.X - 2.f * TextSize, VolumeExtent.Y + 5.f, -TextSize), FRotator(0.f, 90.f, 0.f)); 404 | } 405 | else if (i == 10) 406 | { 407 | SideInfo = LeftSide; 408 | Text_Indicators[i]->SetText(Text_Left); 409 | Text_Indicators[i]->SetRelativeLocationAndRotation(FVector(-VolumeExtent.X + 2.f * TextSize, VolumeExtent.Y + 5.f, TextSize), FRotator(0.f, 90.f, 0.f)); 410 | Text_Indicators[i + 1]->SetRelativeLocationAndRotation(FVector(-VolumeExtent.X + 2.f * TextSize, VolumeExtent.Y + 5.f, 0.f), FRotator(0.f, 90.f, 0.f)); 411 | Text_Indicators[i + 2]->SetRelativeLocationAndRotation(FVector(-VolumeExtent.X + 2.f * TextSize, VolumeExtent.Y + 5.f, -TextSize), FRotator(0.f, 90.f, 0.f)); 412 | } 413 | else if (i == 13) 414 | { 415 | SideInfo = TopSide; 416 | Text_Indicators[i]->SetText(Text_Top); 417 | Text_Indicators[i]->SetRelativeLocationAndRotation(FVector(0.f, VolumeExtent.Y + 5.f, VolumeExtent.Z - 0.5f * TextSize), FRotator(0.f, 90.f, 0.f)); 418 | Text_Indicators[i + 1]->SetRelativeLocationAndRotation(FVector(0.f, VolumeExtent.Y + 5.f, VolumeExtent.Z - 1.5f * TextSize), FRotator(0.f, 90.f, 0.f)); 419 | Text_Indicators[i + 2]->SetRelativeLocationAndRotation(FVector(0.f, VolumeExtent.Y + 5.f, VolumeExtent.Z - 2.5f * TextSize), FRotator(0.f, 90.f, 0.f)); 420 | 421 | if (bUse6DOFVolume) 422 | { 423 | Text_Indicators[i]->SetVisibility(true); 424 | Text_Indicators[i + 1]->SetVisibility(true); 425 | Text_Indicators[i + 2]->SetVisibility(true); 426 | } 427 | else 428 | { 429 | Text_Indicators[i]->SetVisibility(true); 430 | Text_Indicators[i + 1]->SetVisibility(true); 431 | Text_Indicators[i + 2]->SetVisibility(true); 432 | } 433 | } 434 | else if (i == 16) 435 | { 436 | SideInfo = BottomSide; 437 | Text_Indicators[i]->SetText(Text_Bottom); 438 | Text_Indicators[i]->SetRelativeLocationAndRotation(FVector(0.f, VolumeExtent.Y + 5.f, -VolumeExtent.Z + 2.5f * TextSize), FRotator(0.f, 90.f, 0.f)); 439 | Text_Indicators[i + 1]->SetRelativeLocationAndRotation(FVector(0.f, VolumeExtent.Y + 5.f, -VolumeExtent.Z + 1.5f * TextSize), FRotator(0.f, 90.f, 0.f)); 440 | Text_Indicators[i + 2]->SetRelativeLocationAndRotation(FVector(0.f, VolumeExtent.Y + 5.f, -VolumeExtent.Z + 0.5f * TextSize), FRotator(0.f, 90.f, 0.f)); 441 | 442 | if (bUse6DOFVolume) 443 | { 444 | Text_Indicators[i]->SetVisibility(true); 445 | Text_Indicators[i + 1]->SetVisibility(true); 446 | Text_Indicators[i + 2]->SetVisibility(true); 447 | } 448 | else 449 | { 450 | Text_Indicators[i]->SetVisibility(true); 451 | Text_Indicators[i + 1]->SetVisibility(true); 452 | Text_Indicators[i + 2]->SetVisibility(true); 453 | } 454 | } 455 | 456 | if (SideInfo.SideType == ESideType::EST_Closed) 457 | { 458 | Text_Indicators[i + 1]->SetText(Text_Closed); 459 | Text_Indicators[i + 1]->SetTextRenderColor(FColor::Red); 460 | } 461 | else 462 | { 463 | Text_Indicators[i + 1]->SetText(Text_Open); 464 | Text_Indicators[i + 1]->SetTextRenderColor(FColor::Green); 465 | } 466 | 467 | switch (SideInfo.SideTransitionType) 468 | { 469 | case ESideTransitionType::ESTT_Normal: 470 | Text_Indicators[i + 2]->SetText(Text_Normal); 471 | Text_Indicators[i + 2]->SetTextRenderColor(FColor::Yellow); 472 | break; 473 | case ESideTransitionType::ESTT_Smooth: 474 | Text_Indicators[i + 2]->SetText(Text_Smooth); 475 | Text_Indicators[i + 2]->SetTextRenderColor(FColor::Green); 476 | break; 477 | case ESideTransitionType::ESTT_Cut: 478 | Text_Indicators[i + 2]->SetText(Text_Cut); 479 | Text_Indicators[i + 2]->SetTextRenderColor(FColor::Red); 480 | break; 481 | } 482 | } 483 | } 484 | #endif 485 | 486 | //Update with changed property 487 | #if WITH_EDITOR 488 | void ACameraVolumeActor::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) 489 | { 490 | Super::PostEditChangeProperty(PropertyChangedEvent); 491 | const FName PropertyName = PropertyChangedEvent.Property ? PropertyChangedEvent.Property->GetFName() : NAME_None; 492 | if (PropertyName == TEXT("Priority") || TEXT("VolumeExtent") 493 | || TEXT("bUseZeroDepthExtent") || TEXT("bUse6DOFVolume") 494 | || TEXT("bDisableMainBoxCollision") 495 | || TEXT("CameraProjectionMode") || TEXT("CameraMobility") 496 | || TEXT("bOverrideCameraLocation") || TEXT("CameraLocation") 497 | || TEXT("bOverrideCameraRotation") || TEXT("CameraFocalPoint") || TEXT("CameraRoll") 498 | || TEXT("bOverrideCameraFieldOfView") || TEXT("CameraFieldOfView") 499 | || TEXT("bOverrideCameraOrthoWidth") || TEXT("CameraOrthoWidth") 500 | || TEXT("FrontSide") || TEXT("BackSide") || TEXT("RightSide") || TEXT("LeftSide") || TEXT("TopSide") || TEXT("BottomSide") 501 | || TEXT("TextSize") 502 | || TEXT("bUseCameraRotationAxis") 503 | ) 504 | { 505 | UpdateVolume(); 506 | } 507 | } 508 | 509 | void ACameraVolumeActor::EditorApplyTranslation(const FVector& DeltaTranslation, bool bAltDown, bool bShiftDown, bool bCtrlDown) 510 | { 511 | Super::EditorApplyTranslation(DeltaTranslation, bAltDown, bShiftDown, bCtrlDown); 512 | UpdateVolume(); 513 | } 514 | 515 | void ACameraVolumeActor::EditorApplyRotation(const FRotator& DeltaRotation, bool bAltDown, bool bShiftDown, bool bCtrlDown) 516 | { 517 | Super::EditorApplyRotation(DeltaRotation, bAltDown, bShiftDown, bCtrlDown); 518 | UpdateVolume(); 519 | } 520 | 521 | void ACameraVolumeActor::EditorApplyScale(const FVector& DeltaScale, const FVector* PivotLocation, bool bAltDown, bool bShiftDown, bool bCtrlDown) 522 | { 523 | Super::EditorApplyScale(DeltaScale, PivotLocation, bAltDown, bShiftDown, bCtrlDown); 524 | 525 | FVector ScaleToApply = VolumeExtent / VolumeExtentDefault; 526 | 527 | if (bUsePercentageBasedScaling) 528 | { 529 | ScaleToApply *= FVector::OneVector + DeltaScale; 530 | } 531 | else 532 | { 533 | ScaleToApply += DeltaScale; 534 | } 535 | 536 | VolumeExtent = VolumeExtentDefault * ScaleToApply; 537 | UpdateVolume(); 538 | } 539 | 540 | void ACameraVolumeActor::EditorApplyMirror(const FVector& MirrorScale, const FVector& PivotLocation) 541 | { 542 | Super::EditorApplyMirror(MirrorScale, PivotLocation); 543 | SetActorScale3D(FVector::OneVector); 544 | } 545 | #endif 546 | 547 | // Runtime setters 548 | void ACameraVolumeActor::SetVolumeExtent(FVector NewVolumeExtent) 549 | { 550 | VolumeExtent = NewVolumeExtent; 551 | UpdateVolume(); 552 | } 553 | 554 | void ACameraVolumeActor::SetUseZeroDepthExtent(bool bNewUseZeroDepthExtent) 555 | { 556 | bUseZeroDepthExtent = bNewUseZeroDepthExtent; 557 | UpdateVolume(); 558 | } 559 | 560 | void ACameraVolumeActor::SetUse6DOFVolume(bool bNewUse6DOFVolume) 561 | { 562 | bUse6DOFVolume = bNewUse6DOFVolume; 563 | UpdateVolume(); 564 | } 565 | 566 | void ACameraVolumeActor::SetCameraMobility(ECameraMobility NewCameraMobility) 567 | { 568 | CameraMobility = NewCameraMobility; 569 | UpdateVolume(); 570 | } 571 | 572 | void ACameraVolumeActor::SetOverrideCameraLocation(bool bNewOverrideCameraLocation) 573 | { 574 | bOverrideCameraLocation = bNewOverrideCameraLocation; 575 | UpdateVolume(); 576 | } 577 | 578 | void ACameraVolumeActor::SetCameraLocation(FVector NewCameraLocation) 579 | { 580 | CameraLocation = NewCameraLocation; 581 | UpdateVolume(); 582 | } 583 | 584 | void ACameraVolumeActor::SetOverrideCameraRotation(bool bNewOverrideCameraRotation) 585 | { 586 | bOverrideCameraRotation = bNewOverrideCameraRotation; 587 | UpdateVolume(); 588 | } 589 | 590 | void ACameraVolumeActor::SetCameraFocalPoint(FVector NewCameraFocalPoint) 591 | { 592 | CameraFocalPoint = NewCameraFocalPoint; 593 | UpdateVolume(); 594 | } 595 | 596 | void ACameraVolumeActor::SetCameraRoll(float NewCameraRoll) 597 | { 598 | CameraRoll = NewCameraRoll; 599 | UpdateVolume(); 600 | } 601 | 602 | void ACameraVolumeActor::SetSide(ESide Side, FSideInfo NewSideInfo) 603 | { 604 | switch (Side) 605 | { 606 | case ESide::ES_Right: 607 | RightSide = NewSideInfo; 608 | break; 609 | case ESide::ES_Left: 610 | LeftSide = NewSideInfo; 611 | break; 612 | case ESide::ES_Top: 613 | TopSide = NewSideInfo; 614 | break; 615 | case ESide::ES_Bottom: 616 | BottomSide = NewSideInfo; 617 | break; 618 | case ESide::ES_Front: 619 | FrontSide = NewSideInfo; 620 | break; 621 | case ESide::ES_Back: 622 | BackSide = NewSideInfo; 623 | break; 624 | } 625 | 626 | CalculateVolumeExtents(); 627 | } 628 | 629 | void ACameraVolumeActor::SetDisableMainBoxCollision(bool bNewDisableMainBoxCollision) 630 | { 631 | bDisableMainBoxCollision = bNewDisableMainBoxCollision; 632 | 633 | if (bDisableMainBoxCollision) 634 | { 635 | BoxComponent->SetCollisionEnabled(ECollisionEnabled::NoCollision); 636 | BoxComponent->ShapeColor = FColor(127, 127, 127, 255); 637 | } 638 | else 639 | { 640 | BoxComponent->SetCollisionEnabled(ECollisionEnabled::QueryOnly); 641 | BoxComponent->ShapeColor = FColor(223, 149, 157, 255); 642 | } 643 | } 644 | 645 | #if WITH_EDITOR 646 | void ACameraVolumeActor::SetAllOpen() 647 | { 648 | FrontSide.SideType = ESideType::EST_Open; 649 | BackSide.SideType = ESideType::EST_Open; 650 | RightSide.SideType = ESideType::EST_Open; 651 | LeftSide.SideType = ESideType::EST_Open; 652 | TopSide.SideType = ESideType::EST_Open; 653 | BottomSide.SideType = ESideType::EST_Open; 654 | 655 | UpdateVolume(); 656 | } 657 | 658 | void ACameraVolumeActor::SetAllClosed() 659 | { 660 | FrontSide.SideType = ESideType::EST_Closed; 661 | BackSide.SideType = ESideType::EST_Closed; 662 | RightSide.SideType = ESideType::EST_Closed; 663 | LeftSide.SideType = ESideType::EST_Closed; 664 | TopSide.SideType = ESideType::EST_Closed; 665 | BottomSide.SideType = ESideType::EST_Closed; 666 | 667 | UpdateVolume(); 668 | } 669 | 670 | void ACameraVolumeActor::SetAllNormal() 671 | { 672 | FrontSide.SideTransitionType = ESideTransitionType::ESTT_Normal; 673 | BackSide.SideTransitionType = ESideTransitionType::ESTT_Normal; 674 | RightSide.SideTransitionType = ESideTransitionType::ESTT_Normal; 675 | LeftSide.SideTransitionType = ESideTransitionType::ESTT_Normal; 676 | TopSide.SideTransitionType = ESideTransitionType::ESTT_Normal; 677 | BottomSide.SideTransitionType = ESideTransitionType::ESTT_Normal; 678 | 679 | UpdateVolume(); 680 | } 681 | 682 | void ACameraVolumeActor::SetAllSmooth() 683 | { 684 | FrontSide.SideTransitionType = ESideTransitionType::ESTT_Smooth; 685 | BackSide.SideTransitionType = ESideTransitionType::ESTT_Smooth; 686 | RightSide.SideTransitionType = ESideTransitionType::ESTT_Smooth; 687 | LeftSide.SideTransitionType = ESideTransitionType::ESTT_Smooth; 688 | TopSide.SideTransitionType = ESideTransitionType::ESTT_Smooth; 689 | BottomSide.SideTransitionType = ESideTransitionType::ESTT_Smooth; 690 | 691 | UpdateVolume(); 692 | } 693 | 694 | void ACameraVolumeActor::SetAllCut() 695 | { 696 | FrontSide.SideTransitionType = ESideTransitionType::ESTT_Cut; 697 | BackSide.SideTransitionType = ESideTransitionType::ESTT_Cut; 698 | RightSide.SideTransitionType = ESideTransitionType::ESTT_Cut; 699 | LeftSide.SideTransitionType = ESideTransitionType::ESTT_Cut; 700 | TopSide.SideTransitionType = ESideTransitionType::ESTT_Cut; 701 | BottomSide.SideTransitionType = ESideTransitionType::ESTT_Cut; 702 | 703 | UpdateVolume(); 704 | } 705 | #endif 706 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Private/CameraVolumeDynamicActor.cpp: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #include "CameraVolumeDynamicActor.h" 4 | 5 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CameraVolumeDynamicActor) 6 | 7 | ACameraVolumeDynamicActor::ACameraVolumeDynamicActor() 8 | { 9 | PrimaryActorTick.bCanEverTick = true; 10 | 11 | // Default root 12 | RootComponent->SetMobility(EComponentMobility::Movable); 13 | } 14 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Private/CameraVolumesCameraComponent.cpp: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #include "CameraVolumesCameraComponent.h" 4 | #include "CameraVolumesFunctionLibrary.h" 5 | 6 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CameraVolumesCameraComponent) 7 | 8 | UCameraVolumesCameraComponent::UCameraVolumesCameraComponent() 9 | { 10 | // Camera defaults 11 | DefaultCameraLocation = FVector(0.f, 1000.f, 0.f); 12 | DefaultCameraFieldOfView = 90.f; 13 | DefaultCameraOrthoWidth = 512.f; 14 | 15 | // Camera lag 16 | CameraLocationLagSpeed = 10.0f; 17 | CameraRotationLagSpeed = 10.0f; 18 | CameraFOVInterpSpeed = 10.f; 19 | CameraOrthoWidthInterpSpeed = 10.f; 20 | 21 | // Camera collision 22 | ProbeSize = 12.f; 23 | ProbeChannel = ECC_Camera; 24 | 25 | // Camera rotation 26 | bUpdateControlRotationFromCameraRotation = true; 27 | bInheritPitchCV = true; 28 | bInheritYawCV = true; 29 | bInheritRollCV = true; 30 | 31 | bUpdateCamera = true; 32 | 33 | LoadConfig(); 34 | 35 | UpdateCameraComponent(); 36 | } 37 | 38 | void UCameraVolumesCameraComponent::UpdateCamera(FMinimalViewInfo& InViewInfo) 39 | { 40 | if (bUpdateCamera) 41 | { 42 | SetWorldLocationAndRotation(InViewInfo.Location, InViewInfo.Rotation); 43 | SetOrthoWidth(InViewInfo.OrthoWidth); 44 | SetFieldOfView(InViewInfo.FOV); 45 | } 46 | } 47 | 48 | void UCameraVolumesCameraComponent::UpdateCameraComponent() 49 | { 50 | switch (ProjectionMode) 51 | { 52 | case ECameraProjectionMode::Orthographic: 53 | SetOrthoWidth(DefaultCameraOrthoWidth); 54 | break; 55 | default: 56 | SetFieldOfView(DefaultCameraFieldOfView); 57 | break; 58 | } 59 | 60 | DefaultCameraRotation = UCameraVolumesFunctionLibrary::CalculateCameraRotation(DefaultCameraLocation, DefaultCameraFocalPoint, DefaultCameraRoll); 61 | SetRelativeLocationAndRotation(DefaultCameraLocation, DefaultCameraRotation); 62 | 63 | #if WITH_EDITOR 64 | RefreshVisualRepresentation(); 65 | #endif 66 | } 67 | 68 | //Update with changed property 69 | #if WITH_EDITOR 70 | void UCameraVolumesCameraComponent::PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) 71 | { 72 | Super::PostEditChangeProperty(PropertyChangedEvent); 73 | const FName PropertyName = PropertyChangedEvent.Property ? PropertyChangedEvent.Property->GetFName() : NAME_None; 74 | if (PropertyName == TEXT("ProjectionMode") 75 | || TEXT("DefaultCameraLocation") 76 | || TEXT("DefaultCameraFocalPoint") 77 | || TEXT("DefaultCameraRoll") 78 | || TEXT("DefaultCameraFieldOfView") || TEXT("DefaultCameraOrthoWidth") 79 | ) 80 | { 81 | UpdateCameraComponent(); 82 | } 83 | } 84 | #endif 85 | 86 | // Runtime setters 87 | void UCameraVolumesCameraComponent::SetDefaultCameraLocation(FVector NewDefaultCameraLocation) 88 | { 89 | DefaultCameraLocation = NewDefaultCameraLocation; 90 | DefaultCameraRotation = UCameraVolumesFunctionLibrary::CalculateCameraRotation(DefaultCameraLocation, DefaultCameraFocalPoint, DefaultCameraRoll); 91 | } 92 | 93 | void UCameraVolumesCameraComponent::SetDefaultCameraFocalPoint(FVector NewDefaultCameraFocalPoint) 94 | { 95 | DefaultCameraFocalPoint = NewDefaultCameraFocalPoint; 96 | DefaultCameraRotation = UCameraVolumesFunctionLibrary::CalculateCameraRotation(DefaultCameraLocation, DefaultCameraFocalPoint, DefaultCameraRoll); 97 | } 98 | 99 | void UCameraVolumesCameraComponent::SetDefaultCameraRoll(float NewDefaultCameraRoll) 100 | { 101 | DefaultCameraRoll = NewDefaultCameraRoll; 102 | DefaultCameraRotation = UCameraVolumesFunctionLibrary::CalculateCameraRotation(DefaultCameraLocation, DefaultCameraFocalPoint, DefaultCameraRoll); 103 | } 104 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Private/CameraVolumesCameraManager.cpp: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #include "CameraVolumesCameraManager.h" 4 | #include "CameraVolumesCharacterInterface.h" 5 | #include "CameraVolumeDynamicActor.h" 6 | #include "CameraVolumesFunctionLibrary.h" 7 | #include "Engine/GameViewportClient.h" 8 | #include "Engine/LocalPlayer.h" 9 | #include "Engine/World.h" 10 | #include "GameFramework/PlayerController.h" 11 | #include "GameFramework/Pawn.h" 12 | 13 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CameraVolumesCameraManager) 14 | 15 | ACameraVolumesCameraManager::ACameraVolumesCameraManager(const FObjectInitializer& ObjectInitializer) 16 | : Super(ObjectInitializer) 17 | { 18 | bUpdateCamera = true; 19 | bProcessCameraVolumes = true; 20 | bPerformBlockingCalculations = true; 21 | bFirstPass = true; 22 | 23 | LoadConfig(); 24 | } 25 | 26 | void ACameraVolumesCameraManager::UpdateCamera(float DeltaTime) 27 | { 28 | if (bUpdateCamera) 29 | { 30 | PlayerPawn = GetOwningPlayerController()->GetPawn(); 31 | if (IsValid(PlayerPawn)) 32 | { 33 | ICameraVolumesCharacterInterface* PlayerCharacter = Cast(PlayerPawn); 34 | if (PlayerCharacter) 35 | { 36 | // Store previous values and prepare params 37 | CameraVolumePrevious = CameraVolumeCurrent; 38 | CameraVolumeCurrent = nullptr; 39 | 40 | CameraComponent = PlayerCharacter->GetCameraComponent(); 41 | if (IsValid(CameraComponent)) 42 | { 43 | PlayerPawnLocation = PlayerPawn->GetActorLocation(); 44 | 45 | if (bProcessCameraVolumes) 46 | { 47 | // Check if camera component not contains any overlapped camera volumes, 48 | // try to get them from actors overlapping character's primitive component 49 | // and put into camera component 50 | if (CameraComponent->OverlappingCameraVolumes.Num() == 0) 51 | { 52 | TArray OverlappingActors; 53 | PlayerCharacter->GetCollisionPrimitiveComponent()->GetOverlappingActors(OverlappingActors, ACameraVolumeActor::StaticClass()); 54 | 55 | if (OverlappingActors.Num() > 0) 56 | { 57 | for (AActor* OverlappingActor : OverlappingActors) 58 | { 59 | ACameraVolumeActor* CameraVolume = Cast(OverlappingActor); 60 | if (IsValid(CameraVolume)) 61 | { 62 | CameraComponent->OverlappingCameraVolumes.Emplace(CameraVolume); 63 | } 64 | } 65 | 66 | CameraVolumeCurrent = UCameraVolumesFunctionLibrary::GetCurrentCameraVolume(CameraComponent->OverlappingCameraVolumes, PlayerPawnLocation); 67 | } 68 | else 69 | { 70 | // There are no camera volumes overlapping character at this time, 71 | // so we can stop processing until player pawn overlap some camera volume again. 72 | SetProcessCameraVolumes(false); 73 | } 74 | } 75 | else 76 | { 77 | CameraVolumeCurrent = UCameraVolumesFunctionLibrary::GetCurrentCameraVolume(CameraComponent->OverlappingCameraVolumes, PlayerPawnLocation); 78 | } 79 | 80 | if (IsValid(CameraVolumeCurrent)) 81 | { 82 | if (CameraVolumeCurrent != CameraVolumePrevious) // Do we changed to another volume? 83 | { 84 | const FSideInfo& PassedSideInfoCurrent = CameraVolumeCurrent->GetNearestVolumeSideInfo(PlayerPawnLocation); 85 | 86 | if (IsValid(CameraVolumePrevious)) 87 | { 88 | const FSideInfo& PassedSideInfoPrevious = CameraVolumePrevious->GetNearestVolumeSideInfo(PlayerPawnLocation); 89 | 90 | if (UCameraVolumesFunctionLibrary::CompareSidesPairs(PassedSideInfoCurrent.Side, PassedSideInfoPrevious.Side, CameraVolumePrevious->bUse6DOFVolume)) 91 | { 92 | // We've passed to nearby volume 93 | // Use settings of side we have passed to 94 | SetTransitionBySideInfo(CameraVolumeCurrent, PassedSideInfoCurrent); 95 | } 96 | else 97 | { 98 | // We've passed to volume with another priority 99 | if (CameraVolumeCurrent->Priority > CameraVolumePrevious->Priority) 100 | { 101 | // Use settings of side we have passed to 102 | SetTransitionBySideInfo(CameraVolumeCurrent, PassedSideInfoCurrent); 103 | } 104 | else 105 | { 106 | // Use settings of side we have passed from 107 | SetTransitionBySideInfo(CameraVolumePrevious, PassedSideInfoPrevious); 108 | } 109 | } 110 | } 111 | else 112 | { 113 | // We've passed from void to volume 114 | SetTransitionBySideInfo(CameraVolumeCurrent, PassedSideInfoCurrent); 115 | } 116 | } 117 | } 118 | else if (IsValid(CameraVolumePrevious)) // Do we passed from volume to void? 119 | { 120 | // Use settings of side we've passed from 121 | const FSideInfo& PassedSideInfoPrevious = CameraVolumePrevious->GetNearestVolumeSideInfo(PlayerPawnLocation); 122 | SetTransitionBySideInfo(CameraVolumePrevious, PassedSideInfoPrevious); 123 | } 124 | } 125 | 126 | CalculateCameraParams(DeltaTime); 127 | 128 | // Update camera component 129 | CameraComponent->UpdateCamera(CameraViewInfoFinal); 130 | 131 | // Update camera manager 132 | DefaultFOV = CameraFOVFinal; 133 | DefaultOrthoWidth = CameraOrthoWidthFinal; 134 | } 135 | } 136 | } 137 | } 138 | 139 | Super::UpdateCamera(DeltaTime); 140 | } 141 | 142 | void ACameraVolumesCameraManager::CalculateCameraParams(float DeltaTime) 143 | { 144 | // Smooth transition from fixed old params or smooth transition was interrupted 145 | if (!bNeedsSmoothTransition || bSmoothTransitionInterrupted) 146 | { 147 | bSmoothTransitionInterrupted = false; 148 | CameraLocationOld = CameraLocationNew; 149 | CameraQuatOld = CameraQuatNew; 150 | CameraFOVOld = CameraFOVNew; 151 | CameraOrthoWidthOld = CameraOrthoWidthNew; 152 | } 153 | 154 | CameraLocationSourceOld = CameraLocationSourceNew; 155 | CameraLocationSourceNew = PlayerPawnLocation; 156 | 157 | bIsCameraStatic = false; 158 | bUsePlayerPawnControlRotation = false; 159 | 160 | CameraProjectionModeOld = CameraProjectionModeNew; 161 | CameraProjectionModeNew = CameraComponent->ProjectionMode; 162 | bIsOrthographic = CameraProjectionModeNew == ECameraProjectionMode::Orthographic; 163 | 164 | CameraLocationNew = CameraLocationSourceNew + CameraComponent->DefaultCameraLocation; 165 | CameraQuatNew = CameraComponent->GetDefaultCameraRotation(); 166 | CameraFocalPointNew = CameraLocationSourceNew + CameraComponent->DefaultCameraFocalPoint; 167 | CameraFOVNew = CameraComponent->DefaultCameraFieldOfView; 168 | CameraOrthoWidthNew = CameraComponent->DefaultCameraOrthoWidth; 169 | 170 | bool bDoCollisionTest = CameraComponent->bDoCollisionTest; 171 | 172 | // Active camera volume 173 | if (IsValid(CameraVolumeCurrent)) 174 | { 175 | bIsCameraStatic = CameraVolumeCurrent->GetIsCameraStatic(); 176 | 177 | // Camera projection 178 | if (CameraVolumeCurrent->bOverrideCameraOrthoWidth) 179 | { 180 | CameraOrthoWidthNew = CameraVolumeCurrent->CameraOrthoWidth; 181 | } 182 | 183 | if (CameraVolumeCurrent->bOverrideCameraFieldOfView) 184 | { 185 | CameraFOVNew = CameraVolumeCurrent->CameraFieldOfView; 186 | } 187 | 188 | // Location and Rotation 189 | const FVector CameraLocationSourceLocal = CameraVolumeCurrent->GetActorTransform().InverseTransformPositionNoScale(CameraLocationSourceNew); 190 | 191 | bIsCameraStatic = CameraVolumeCurrent->GetIsCameraStatic(); 192 | if (bIsCameraStatic) 193 | { 194 | CameraLocationNew = CameraVolumeCurrent->CameraLocation; 195 | 196 | if (CameraVolumeCurrent->bFocalPointIsPlayer) 197 | { 198 | CameraFocalPointNew = CameraLocationSourceLocal + CameraVolumeCurrent->CameraFocalPoint; 199 | CameraQuatNew = UCameraVolumesFunctionLibrary::CalculateCameraRotation(CameraVolumeCurrent->CameraLocation, CameraFocalPointNew, CameraVolumeCurrent->CameraRoll); 200 | } 201 | else 202 | { 203 | CameraQuatNew = CameraVolumeCurrent->GetCameraRotation(); 204 | } 205 | } 206 | else 207 | { 208 | if (CameraVolumeCurrent->bUseCameraRotationAxis) 209 | { 210 | CameraLocationNew = CameraVolumeCurrent->bOverrideCameraLocation 211 | ? CameraVolumeCurrent->CameraLocation 212 | : CameraComponent->DefaultCameraLocation; 213 | 214 | const FVector DirToAxis = CameraLocationSourceLocal.GetSafeNormal2D(); 215 | const FQuat RotToAxis = FRotationMatrix::MakeFromX(DirToAxis).ToQuat(); 216 | const FVector VerticalOffset = FVector(0.f, 0.f, CameraLocationSourceLocal.Z); 217 | 218 | CameraLocationNew = RotToAxis.RotateVector(CameraLocationNew) + VerticalOffset; 219 | 220 | if (!CameraVolumeCurrent->bCameraLocationRelativeToVolume) 221 | { 222 | CameraLocationNew += FVector(CameraLocationSourceLocal.X, CameraLocationSourceLocal.Y, 0.f); 223 | } 224 | 225 | const float NewCameraRoll = CameraVolumeCurrent->bOverrideCameraRotation 226 | ? CameraVolumeCurrent->CameraRoll 227 | : CameraComponent->DefaultCameraRoll; 228 | 229 | CameraFocalPointNew = CameraVolumeCurrent->bOverrideCameraRotation 230 | ? RotToAxis.RotateVector(CameraVolumeCurrent->CameraFocalPoint) 231 | : RotToAxis.RotateVector(CameraComponent->DefaultCameraFocalPoint); 232 | 233 | if (CameraVolumeCurrent->bFocalPointIsPlayer) 234 | { 235 | CameraFocalPointNew += CameraLocationSourceLocal; 236 | CameraQuatNew = UCameraVolumesFunctionLibrary::CalculateCameraRotation(CameraLocationNew, CameraFocalPointNew, NewCameraRoll); 237 | } 238 | else 239 | { 240 | CameraFocalPointNew += VerticalOffset; 241 | CameraQuatNew = CameraVolumeCurrent->bOverrideCameraRotation 242 | ? RotToAxis * CameraVolumeCurrent->GetCameraRotation() 243 | // Focal point will be relative to volume, not character! 244 | : UCameraVolumesFunctionLibrary::CalculateCameraRotation(CameraLocationNew, CameraFocalPointNew, NewCameraRoll); 245 | } 246 | } 247 | else 248 | { 249 | CameraLocationNew = CameraLocationSourceLocal; 250 | CameraFocalPointNew = CameraLocationSourceLocal; 251 | 252 | CameraLocationNew += CameraVolumeCurrent->bOverrideCameraLocation 253 | ? CameraVolumeCurrent->CameraLocation 254 | : CameraComponent->DefaultCameraLocation; 255 | 256 | CameraFocalPointNew += CameraVolumeCurrent->bOverrideCameraRotation 257 | ? CameraVolumeCurrent->CameraFocalPoint 258 | : CameraComponent->DefaultCameraFocalPoint; 259 | 260 | if (CameraVolumeCurrent->bOverrideCameraRotation) 261 | { 262 | CameraQuatNew = CameraVolumeCurrent->GetCameraRotation(); 263 | } 264 | 265 | if (CameraVolumeCurrent->bCameraLocationRelativeToVolume) 266 | { 267 | CameraLocationNew.Y = CameraVolumeCurrent->bOverrideCameraLocation 268 | ? CameraVolumeCurrent->CameraLocation.Y 269 | : CameraComponent->DefaultCameraLocation.Y; 270 | 271 | CameraFocalPointNew.Y = CameraVolumeCurrent->bOverrideCameraRotation 272 | ? CameraVolumeCurrent->CameraFocalPoint.Y 273 | : CameraComponent->DefaultCameraFocalPoint.Y; 274 | } 275 | } 276 | 277 | bDoCollisionTest = bDoCollisionTest || CameraVolumeCurrent->bDoCollisionTest; 278 | 279 | // Calculate camera blocking like it oriented to volume Front side 280 | bBlockingCalculations = bPerformBlockingCalculations 281 | ? CameraVolumeCurrent->bPerformCameraBlocking 282 | : bPerformBlockingCalculations; 283 | 284 | if (bBlockingCalculations) 285 | { 286 | APlayerController* PC = GetOwningPlayerController(); 287 | if (IsValid(PC)) 288 | { 289 | ULocalPlayer* LP = PC->GetLocalPlayer(); 290 | if (IsValid(LP)) 291 | { 292 | if (IsValid(LP->ViewportClient)) 293 | { 294 | FVector2D ViewportSize; 295 | LP->ViewportClient->GetViewportSize(ViewportSize); 296 | if (ViewportSize.X > 0 && ViewportSize.Y > 0) 297 | { 298 | // Aspect ratio axis constraint 299 | const TEnumAsByte AspectRatioAxisConstraint = 300 | CameraComponent->bOverrideAspectRatioAxisConstraint 301 | ? CameraComponent->AspectRatioAxisConstraint 302 | : LP->AspectRatioAxisConstraint; 303 | 304 | const bool bMaintainXFOV = 305 | ((ViewportSize.X > ViewportSize.Y) && (AspectRatioAxisConstraint == AspectRatio_MajorAxisFOV)) 306 | || (AspectRatioAxisConstraint == AspectRatio_MaintainXFOV) 307 | || bIsOrthographic; 308 | 309 | float HalfFOVRad = FMath::DegreesToRadians(CameraFOVNew * 0.5f); 310 | float ScreenAspectRatio = static_cast(ViewportSize.X / ViewportSize.Y); 311 | 312 | if (!bMaintainXFOV) 313 | { 314 | HalfFOVRad = FMath::Atan(FMath::Tan(HalfFOVRad) / CameraComponent->AspectRatio); 315 | ScreenAspectRatio = 1.f / ScreenAspectRatio; 316 | } 317 | 318 | const float HalfFOVTan = FMath::Tan(HalfFOVRad); 319 | 320 | FVector NewCamVolExtentCorrected = CameraVolumeCurrent->GetCamVolExtentCorrected(); 321 | FVector NewCamVolMinCorrected = CameraVolumeCurrent->GetCamVolMinCorrected(); 322 | FVector NewCamVolMaxCorrected = CameraVolumeCurrent->GetCamVolMaxCorrected(); 323 | 324 | // Calculate delta volume extent with max +Y volume coordinate 325 | if (!bIsOrthographic && !CameraVolumeCurrent->bUseZeroDepthExtent) 326 | { 327 | FVector DeltaExtent(FVector::ZeroVector); 328 | 329 | if (bMaintainXFOV) 330 | { 331 | DeltaExtent.X = FMath::Abs(NewCamVolMaxCorrected.Y * HalfFOVTan); 332 | DeltaExtent.Z = DeltaExtent.X / ScreenAspectRatio; 333 | } 334 | else 335 | { 336 | DeltaExtent.Z = FMath::Abs(NewCamVolMaxCorrected.Y * HalfFOVTan); 337 | DeltaExtent.X = DeltaExtent.Z / ScreenAspectRatio; 338 | } 339 | 340 | NewCamVolExtentCorrected += DeltaExtent; 341 | NewCamVolMinCorrected -= DeltaExtent; 342 | NewCamVolMaxCorrected += DeltaExtent; 343 | } 344 | 345 | // Camera offset is always relative to camera volume local Y axis 346 | float CameraOffset = CameraVolumeCurrent->bUseCameraRotationAxis 347 | ? CameraLocationNew.Size2D() 348 | : CameraLocationNew.Y; 349 | 350 | // Calculate new camera offset and screen world extent at depth of CameraOffset 351 | FVector ScreenExtent(FVector::ZeroVector); 352 | 353 | if (bIsOrthographic) 354 | { 355 | CameraOrthoWidthNew = CameraVolumeCurrent->GetCamVolAspectRatio() >= ScreenAspectRatio 356 | ? FMath::Min(CameraOrthoWidthNew, 2.f * NewCamVolExtentCorrected.Z * ScreenAspectRatio) 357 | : FMath::Min(CameraOrthoWidthNew, 2.f * NewCamVolExtentCorrected.X); 358 | 359 | ScreenExtent.X = CameraOrthoWidthNew * 0.5f; 360 | ScreenExtent.Z = ScreenExtent.X / ScreenAspectRatio; 361 | } 362 | else 363 | { 364 | if (CameraVolumeCurrent->bUseCameraRotationAxis) 365 | { 366 | if (bMaintainXFOV) 367 | { 368 | CameraOffset = FMath::Min( 369 | CameraOffset, 370 | NewCamVolExtentCorrected.Z * ScreenAspectRatio / HalfFOVTan); 371 | } 372 | else 373 | { 374 | CameraOffset = FMath::Min( 375 | CameraOffset, 376 | NewCamVolExtentCorrected.Z / HalfFOVTan); 377 | } 378 | } 379 | else 380 | { 381 | if (bMaintainXFOV) 382 | { 383 | CameraOffset = CameraVolumeCurrent->GetCamVolAspectRatio() >= ScreenAspectRatio 384 | ? FMath::Min( 385 | CameraOffset, 386 | NewCamVolExtentCorrected.Z * ScreenAspectRatio / HalfFOVTan) 387 | : FMath::Min( 388 | CameraOffset, 389 | NewCamVolExtentCorrected.X / HalfFOVTan); 390 | } 391 | else 392 | { 393 | CameraOffset = 1.f / CameraVolumeCurrent->GetCamVolAspectRatio() >= ScreenAspectRatio 394 | ? FMath::Min( 395 | CameraOffset, 396 | NewCamVolExtentCorrected.X * ScreenAspectRatio / HalfFOVTan) 397 | : FMath::Min( 398 | CameraOffset, 399 | NewCamVolExtentCorrected.Z / HalfFOVTan); 400 | } 401 | } 402 | 403 | if (bMaintainXFOV) 404 | { 405 | ScreenExtent.X = FMath::Abs(CameraOffset * HalfFOVTan); 406 | ScreenExtent.Z = ScreenExtent.X / ScreenAspectRatio; 407 | } 408 | else 409 | { 410 | ScreenExtent.Z = FMath::Abs(CameraOffset * HalfFOVTan); 411 | ScreenExtent.X = ScreenExtent.Z / ScreenAspectRatio; 412 | } 413 | } 414 | 415 | const FVector ScreenMin = NewCamVolMinCorrected + ScreenExtent; 416 | const FVector ScreenMax = NewCamVolMaxCorrected - ScreenExtent; 417 | 418 | // Perform camera blocking only on top and bottom sides 419 | if (CameraVolumeCurrent->bUseCameraRotationAxis) 420 | { 421 | CameraLocationNew = FVector( 422 | CameraLocationNew.GetSafeNormal2D().X * CameraOffset, 423 | CameraLocationNew.GetSafeNormal2D().Y * CameraOffset, 424 | FMath::Clamp(CameraLocationNew.Z, ScreenMin.Z, ScreenMax.Z)); 425 | } 426 | else 427 | { 428 | CameraLocationNew = FVector( 429 | FMath::Clamp(CameraLocationNew.X, ScreenMin.X, ScreenMax.X), 430 | CameraOffset, 431 | FMath::Clamp(CameraLocationNew.Z, ScreenMin.Z, ScreenMax.Z)); 432 | } 433 | } 434 | } 435 | } 436 | } 437 | } 438 | } 439 | 440 | // World-space values 441 | CameraLocationNew = CameraVolumeCurrent->GetActorTransform().TransformPositionNoScale(CameraLocationNew); 442 | CameraFocalPointNew = CameraVolumeCurrent->GetActorTransform().TransformPositionNoScale(CameraFocalPointNew); 443 | CameraQuatNew = CameraVolumeCurrent->GetActorTransform().TransformRotation(CameraQuatNew); 444 | } 445 | else 446 | { 447 | if (CameraComponent->bUsePawnControlRotationCV) 448 | { 449 | // Player-controlled camera 450 | bUsePlayerPawnControlRotation = true; 451 | 452 | const FRotator CamRot = CameraComponent->GetDefaultCameraRotation().Rotator(); 453 | FRotator PawnViewRot = PlayerPawn->GetViewRotation(); 454 | 455 | if (!CameraComponent->bInheritPitchCV) 456 | { 457 | PawnViewRot.Pitch = CamRot.Pitch; 458 | } 459 | 460 | if (!CameraComponent->bInheritYawCV) 461 | { 462 | PawnViewRot.Yaw = CamRot.Yaw; 463 | } 464 | 465 | if (!CameraComponent->bInheritRollCV) 466 | { 467 | PawnViewRot.Roll = CamRot.Roll; 468 | } 469 | 470 | CameraQuatNew = PawnViewRot.Quaternion(); 471 | 472 | if (CameraComponent->bEnableCameraRotationLag) 473 | { 474 | CameraQuatNew = FMath::QInterpTo(CameraQuatOld, CameraQuatNew, DeltaTime, CameraComponent->CameraRotationLagSpeed); 475 | } 476 | 477 | if (CameraComponent->bEnableCameraLocationLag) 478 | { 479 | CameraLocationNew = FMath::VInterpTo(CameraLocationSourceOld, CameraLocationSourceNew, DeltaTime, CameraComponent->CameraLocationLagSpeed); 480 | } 481 | 482 | // Final world-space values 483 | CameraFocalPointNew = CameraLocationSourceNew + PlayerPawn->GetActorQuat().RotateVector(CameraComponent->DefaultCameraFocalPoint); 484 | CameraLocationNew = CameraFocalPointNew + CameraQuatNew.RotateVector(CameraComponent->DefaultCameraLocation - CameraComponent->DefaultCameraFocalPoint); 485 | } 486 | } 487 | 488 | // Transitions and interpolations 489 | if (!bFirstPass) 490 | { 491 | CalculateTransitions(DeltaTime); 492 | } 493 | 494 | CameraLocationFinal = CameraLocationNew; 495 | CameraQuatFinal = CameraQuatNew; 496 | CameraFOVFinal = CameraFOVNew; 497 | CameraOrthoWidthFinal = CameraOrthoWidthNew; 498 | 499 | // Camera collision 500 | if (!bIsCameraStatic && bDoCollisionTest) 501 | { 502 | FCollisionQueryParams QueryParams(SCENE_QUERY_STAT(SpringArm), false, CameraComponent->GetOwner()); 503 | FHitResult HitResult; 504 | GetWorld()->SweepSingleByChannel(HitResult, CameraFocalPointNew, CameraLocationNew, FQuat::Identity, CameraComponent->ProbeChannel, FCollisionShape::MakeSphere(CameraComponent->ProbeSize), QueryParams); 505 | 506 | if (HitResult.bBlockingHit) 507 | { 508 | CameraLocationFinal = HitResult.Location; 509 | } 510 | } 511 | 512 | // Additional camera params 513 | if (CameraComponent->bUseAdditionalCameraParams && !bFirstPass) 514 | { 515 | CameraLocationFinal += CameraComponent->AdditionalCameraLocation; 516 | CameraQuatFinal *= CameraComponent->AdditionalCameraRotation.Quaternion(); 517 | CameraFOVFinal += CameraComponent->AdditionalCameraFOV; 518 | CameraOrthoWidthFinal += CameraComponent->AdditionalCameraOrthoWidth; 519 | } 520 | 521 | CameraViewInfoFinal.Location = CameraLocationFinal; 522 | CameraViewInfoFinal.Rotation = CameraQuatFinal.Rotator(); 523 | CameraViewInfoFinal.FOV = CameraFOVFinal; 524 | CameraViewInfoFinal.OrthoWidth = CameraOrthoWidthFinal; 525 | 526 | // Update control rotation from camera rotation 527 | if (!bUsePlayerPawnControlRotation && CameraComponent->bUpdateControlRotationFromCameraRotation) 528 | { 529 | APlayerController* PC = GetOwningPlayerController(); 530 | if (IsValid(PC)) 531 | { 532 | PC->SetControlRotation(CameraQuatFinal.Rotator()); 533 | } 534 | } 535 | 536 | bFirstPass = false; 537 | 538 | // Broadcast volume changed event 539 | if (bBroadcastOnCameraVolumeChanged) 540 | { 541 | bBroadcastOnCameraVolumeChanged = false; 542 | OnCameraVolumeChanged.Broadcast(BroadcastCameraVolume, BroadcastSideInfo); 543 | } 544 | } 545 | 546 | void ACameraVolumesCameraManager::SetTransitionBySideInfo(const ACameraVolumeActor* CameraVolume, const FSideInfo& SideInfo) 547 | { 548 | if (!IsValid(CameraVolume)) 549 | { 550 | return; 551 | } 552 | 553 | // Interrupt previous smooth transition 554 | if (bNeedsSmoothTransition) 555 | { 556 | bSmoothTransitionInterrupted = true; 557 | } 558 | 559 | SmoothTransitionAlpha = 0.f; 560 | SmoothTransitionAlphaEase = 0.f; 561 | 562 | if (SideInfo.SideTransitionType == ESideTransitionType::ESTT_Smooth) 563 | { 564 | bNeedsSmoothTransition = true; 565 | bSmoothTransitionJustStarted = true; 566 | 567 | SmoothTransitionSpeed = CameraVolume->CameraSmoothTransitionSpeed; 568 | SmoothTransitionEasingFunc = static_cast(CameraVolume->SmoothTransitionEasingFunc); 569 | EasingFuncBlendExp = CameraVolume->EasingFuncBlendExp; 570 | EasingFuncSteps = CameraVolume->EasingFuncSteps; 571 | } 572 | else if (SideInfo.SideTransitionType == ESideTransitionType::ESTT_Cut) 573 | { 574 | bNeedsSmoothTransition = false; 575 | bNeedsCutTransition = true; 576 | } 577 | else 578 | { 579 | bNeedsSmoothTransition = false; 580 | bNeedsCutTransition = false; 581 | } 582 | 583 | // Store OnCameraVolumeChanged broadcast params 584 | bBroadcastOnCameraVolumeChanged = true; 585 | BroadcastCameraVolume = CameraVolume; 586 | BroadcastSideInfo = SideInfo; 587 | } 588 | 589 | void ACameraVolumesCameraManager::CalculateTransitions(float DeltaTime) 590 | { 591 | if (bNeedsSmoothTransition) 592 | { 593 | if (bSmoothTransitionJustStarted) 594 | { 595 | CameraLocationNewFixed = CameraLocationNew; 596 | bSmoothTransitionJustStarted = false; 597 | } 598 | 599 | SmoothTransitionAlpha = FMath::Clamp(SmoothTransitionAlpha + DeltaTime * SmoothTransitionSpeed, 0.f, 1.f); 600 | SmoothTransitionAlphaEase = UKismetMathLibrary::Ease(0.f, 1.f, SmoothTransitionAlpha, static_cast(SmoothTransitionEasingFunc), EasingFuncBlendExp, EasingFuncSteps); 601 | 602 | if (CameraLocationNew.Equals(CameraLocationOld, 0.1f) 603 | || SmoothTransitionAlpha == 1.f) 604 | { 605 | SmoothTransitionAlpha = 0.f; 606 | SmoothTransitionAlphaEase = 0.f; 607 | bNeedsSmoothTransition = false; 608 | } 609 | else 610 | { 611 | CameraLocationNew = FMath::Lerp(CameraLocationOld, CameraLocationNew, SmoothTransitionAlphaEase); 612 | CameraQuatNew = FQuat::Slerp(CameraQuatOld, CameraQuatNew, SmoothTransitionAlphaEase); 613 | 614 | if (CameraProjectionModeOld == CameraProjectionModeNew) 615 | { 616 | if (bIsOrthographic) 617 | { 618 | CameraOrthoWidthNew = FMath::Lerp(CameraOrthoWidthOld, CameraOrthoWidthNew, SmoothTransitionAlphaEase); 619 | } 620 | else 621 | { 622 | CameraFOVNew = FMath::Lerp(CameraFOVOld, CameraFOVNew, SmoothTransitionAlphaEase); 623 | } 624 | } 625 | } 626 | } 627 | else if (bNeedsCutTransition) 628 | { 629 | bNeedsSmoothTransition = false; 630 | bNeedsCutTransition = false; 631 | bGameCameraCutThisFrame = true; 632 | } 633 | else 634 | { 635 | // Camera lags 636 | bool bUseCameraLocationLag = CameraComponent->bEnableCameraLocationLag && !bUsePlayerPawnControlRotation; 637 | bool bUseCameraRotationLag = CameraComponent->bEnableCameraRotationLag && !bUsePlayerPawnControlRotation; 638 | if (IsValid(CameraVolumeCurrent)) 639 | { 640 | bUseCameraLocationLag = CameraVolumeCurrent->bDisableCameraLocationLag ? false : bUseCameraLocationLag; 641 | bUseCameraRotationLag = CameraVolumeCurrent->bDisableCameraRotationLag ? false : bUseCameraRotationLag; 642 | } 643 | 644 | if (bUseCameraLocationLag) 645 | { 646 | CameraLocationNew = FMath::VInterpTo(CameraLocationOld, CameraLocationNew, DeltaTime, CameraComponent->CameraLocationLagSpeed); 647 | } 648 | 649 | if (bUseCameraRotationLag) 650 | { 651 | CameraQuatNew = FMath::QInterpTo(CameraQuatOld, CameraQuatNew, DeltaTime, CameraComponent->CameraRotationLagSpeed); 652 | } 653 | 654 | // Camera FOV/OW interpolation 655 | if (bIsOrthographic) 656 | { 657 | if (CameraComponent->bEnableCameraOrthoWidthInterp) 658 | { 659 | if (CameraProjectionModeOld == CameraProjectionModeNew) 660 | { 661 | CameraOrthoWidthNew = FMath::FInterpTo(CameraOrthoWidthOld, CameraOrthoWidthNew, DeltaTime, CameraComponent->CameraOrthoWidthInterpSpeed); 662 | } 663 | } 664 | } 665 | else if (CameraComponent->bEnableCameraFOVInterp) 666 | { 667 | if (CameraProjectionModeOld == CameraProjectionModeNew) 668 | { 669 | CameraFOVNew = FMath::FInterpTo(CameraFOVOld, CameraFOVNew, DeltaTime, CameraComponent->CameraFOVInterpSpeed); 670 | } 671 | } 672 | } 673 | } 674 | 675 | FVector2D ACameraVolumesCameraManager::CalculateScreenWorldExtentAtDepth(float Depth) 676 | { 677 | FVector2D ScreenExtentResult = FVector2D::ZeroVector; 678 | 679 | APlayerController* PC = GetOwningPlayerController(); 680 | if (IsValid(PC)) 681 | { 682 | ULocalPlayer* LP = PC->GetLocalPlayer(); 683 | if (IsValid(LP)) 684 | { 685 | if (IsValid(LP->ViewportClient) && IsValid(CameraComponent)) 686 | { 687 | FVector2D ViewportSize; 688 | LP->ViewportClient->GetViewportSize(ViewportSize); 689 | if (ViewportSize.X > 0 && ViewportSize.Y > 0) 690 | { 691 | const TEnumAsByte AspectRatioAxisConstraint = 692 | CameraComponent->bOverrideAspectRatioAxisConstraint 693 | ? CameraComponent->AspectRatioAxisConstraint 694 | : LP->AspectRatioAxisConstraint; 695 | 696 | const bool bMaintainXFOV = 697 | ((ViewportSize.X > ViewportSize.Y) && (AspectRatioAxisConstraint == AspectRatio_MajorAxisFOV)) 698 | || (AspectRatioAxisConstraint == AspectRatio_MaintainXFOV) 699 | || bIsOrthographic; 700 | 701 | float HalfFOVRad = FMath::DegreesToRadians(DefaultFOV * 0.5f); 702 | float AxisMult = static_cast(ViewportSize.X / ViewportSize.Y); 703 | 704 | if (bMaintainXFOV) 705 | { 706 | ScreenExtentResult.X = bIsOrthographic 707 | ? DefaultOrthoWidth * 0.5f 708 | : FMath::Abs(Depth * FMath::Tan(HalfFOVRad)); 709 | 710 | ScreenExtentResult = FVector2D(ScreenExtentResult.X, ScreenExtentResult.X / AxisMult); 711 | } 712 | else 713 | { 714 | HalfFOVRad = FMath::Atan(FMath::Tan(HalfFOVRad) / CameraComponent->AspectRatio); 715 | AxisMult = 1.f / AxisMult; 716 | 717 | ScreenExtentResult.Y = FMath::Abs(Depth * FMath::Tan(HalfFOVRad)); 718 | ScreenExtentResult = FVector2D(ScreenExtentResult.Y / AxisMult, ScreenExtentResult.Y); 719 | } 720 | } 721 | } 722 | } 723 | } 724 | 725 | return ScreenExtentResult; 726 | } 727 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Private/CameraVolumesCharacter.cpp: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #include "CameraVolumesCharacter.h" 4 | #include "Components/CapsuleComponent.h" 5 | #include "GameFramework/CharacterMovementComponent.h" 6 | #include "GameFramework/PlayerController.h" 7 | #include "CameraVolumeActor.h" 8 | #include "CameraVolumesCameraManager.h" 9 | #include "CameraVolumesFunctionLibrary.h" 10 | 11 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CameraVolumesCharacter) 12 | 13 | ACameraVolumesCharacter::ACameraVolumesCharacter() 14 | { 15 | // Create a camera 16 | CameraComponent = CreateDefaultSubobject(TEXT("Camera")); 17 | CameraComponent->bUsePawnControlRotation = false; // We don't want the controller rotating the camera 18 | 19 | // Configure character movement 20 | bUseControllerRotationPitch = false; 21 | bUseControllerRotationYaw = false; 22 | bUseControllerRotationRoll = false; 23 | GetCharacterMovement()->bOrientRotationToMovement = true; 24 | } 25 | 26 | ACameraVolumesCharacter::ACameraVolumesCharacter(const FObjectInitializer& ObjectInitializer) 27 | : Super(ObjectInitializer) 28 | { 29 | // Create a camera 30 | CameraComponent = CreateDefaultSubobject(TEXT("Camera")); 31 | CameraComponent->bUsePawnControlRotation = false; // We don't want the controller rotating the camera 32 | 33 | // Configure character movement 34 | bUseControllerRotationPitch = false; 35 | bUseControllerRotationYaw = false; 36 | bUseControllerRotationRoll = false; 37 | GetCharacterMovement()->bOrientRotationToMovement = true; 38 | } 39 | 40 | void ACameraVolumesCharacter::PostInitializeComponents() 41 | { 42 | Super::PostInitializeComponents(); 43 | 44 | // Bind overlap events 45 | UPrimitiveComponent* CollisionPrimitiveComponent = GetCollisionPrimitiveComponent(); 46 | if (IsValid(CollisionPrimitiveComponent)) 47 | { 48 | CollisionPrimitiveComponent->OnComponentBeginOverlap.AddDynamic(this, &ACameraVolumesCharacter::OnCollisionPrimitiveComponentBeginOverlap); 49 | CollisionPrimitiveComponent->OnComponentEndOverlap.AddDynamic(this, &ACameraVolumesCharacter::OnCollisionPrimitiveComponentEndOverlap); 50 | } 51 | } 52 | 53 | void ACameraVolumesCharacter::OnCollisionPrimitiveComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) 54 | { 55 | ACameraVolumeActor* CameraVolume = Cast(OtherActor); 56 | if (IsValid(CameraVolume)) 57 | { 58 | if (IsValid(CameraComponent)) 59 | { 60 | if (CameraComponent->OverlappingCameraVolumes.Num() == 0) 61 | { 62 | // Update camera volumes check condition in PlayerCameraManager 63 | APlayerController* PC = Cast(GetController()); 64 | if (IsValid(PC)) 65 | { 66 | ACameraVolumesCameraManager* CameraVolumePCM = Cast(PC->PlayerCameraManager); 67 | if (IsValid(CameraVolumePCM)) 68 | { 69 | CameraVolumePCM->SetProcessCameraVolumes(true); 70 | } 71 | } 72 | } 73 | 74 | CameraComponent->OverlappingCameraVolumes.Emplace(CameraVolume); 75 | } 76 | } 77 | } 78 | 79 | void ACameraVolumesCharacter::OnCollisionPrimitiveComponentEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) 80 | { 81 | ACameraVolumeActor* CameraVolume = Cast(OtherActor); 82 | if (IsValid(CameraVolume)) 83 | { 84 | if (IsValid(CameraComponent)) 85 | { 86 | CameraComponent->OverlappingCameraVolumes.Remove(CameraVolume); 87 | } 88 | } 89 | } 90 | 91 | UCameraVolumesCameraComponent* ACameraVolumesCharacter::GetCameraComponent() const 92 | { 93 | return CameraComponent; 94 | } 95 | 96 | UPrimitiveComponent* ACameraVolumesCharacter::GetCollisionPrimitiveComponent() const 97 | { 98 | return GetCapsuleComponent(); 99 | } 100 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Private/CameraVolumesFunctionLibrary.cpp: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #include "CameraVolumesFunctionLibrary.h" 4 | #include "CameraVolumesTypes.h" 5 | #include "CameraVolumeActor.h" 6 | 7 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CameraVolumesFunctionLibrary) 8 | 9 | const ACameraVolumeActor* UCameraVolumesFunctionLibrary::GetCurrentCameraVolume(const TSet& InCameraVolumes, const FVector& InPlayerPawnLocation) 10 | { 11 | const ACameraVolumeActor* Result = nullptr; 12 | int32 MaxPriority = -101; 13 | bool bInside = false; 14 | 15 | for (const ACameraVolumeActor* CameraVolume : InCameraVolumes) 16 | { 17 | if (IsValid(CameraVolume)) 18 | { 19 | FVector LocalPlayerPawnLocation = CameraVolume->GetActorTransform().InverseTransformPositionNoScale(InPlayerPawnLocation); 20 | 21 | if (CameraVolume->bUse6DOFVolume) 22 | { 23 | bInside = -CameraVolume->VolumeExtent.X <= LocalPlayerPawnLocation.X 24 | && LocalPlayerPawnLocation.X <= CameraVolume->VolumeExtent.X 25 | && -CameraVolume->VolumeExtent.Y <= LocalPlayerPawnLocation.Y 26 | && LocalPlayerPawnLocation.Y <= CameraVolume->VolumeExtent.Y 27 | && -CameraVolume->VolumeExtent.Z <= LocalPlayerPawnLocation.Z 28 | && LocalPlayerPawnLocation.Z <= CameraVolume->VolumeExtent.Z; 29 | } 30 | else 31 | { 32 | bInside = -CameraVolume->VolumeExtent.X <= LocalPlayerPawnLocation.X 33 | && LocalPlayerPawnLocation.X <= CameraVolume->VolumeExtent.X 34 | && -CameraVolume->VolumeExtent.Z <= LocalPlayerPawnLocation.Z 35 | && LocalPlayerPawnLocation.Z <= CameraVolume->VolumeExtent.Z; 36 | } 37 | } 38 | 39 | if (bInside 40 | && CameraVolume->Priority > MaxPriority) 41 | { 42 | MaxPriority = CameraVolume->Priority; 43 | Result = CameraVolume; 44 | } 45 | } 46 | 47 | return Result; 48 | } 49 | 50 | bool UCameraVolumesFunctionLibrary::CompareSidesPairs(ESide SideA, ESide SideB, bool b6DOFVolume) 51 | { 52 | if (b6DOFVolume) 53 | { 54 | if ((SideA == ESide::ES_Front && SideB == ESide::ES_Back) 55 | || (SideA == ESide::ES_Back && SideB == ESide::ES_Front) 56 | || (SideA == ESide::ES_Right && SideB == ESide::ES_Left) 57 | || (SideA == ESide::ES_Left && SideB == ESide::ES_Right) 58 | || (SideA == ESide::ES_Top && SideB == ESide::ES_Bottom) 59 | || (SideA == ESide::ES_Bottom && SideB == ESide::ES_Top)) 60 | { 61 | return true; 62 | } 63 | } 64 | else 65 | { 66 | if ((SideA == ESide::ES_Right && SideB == ESide::ES_Left) 67 | || (SideA == ESide::ES_Left && SideB == ESide::ES_Right) 68 | || (SideA == ESide::ES_Top && SideB == ESide::ES_Bottom) 69 | || (SideA == ESide::ES_Bottom && SideB == ESide::ES_Top)) 70 | { 71 | return true; 72 | } 73 | } 74 | 75 | return false; 76 | } 77 | 78 | FQuat UCameraVolumesFunctionLibrary::CalculateCameraRotation(const FVector& InCameraLocation, const FVector& InCameraFocalPoint, float InCameraRoll) 79 | { 80 | FQuat CameraRotation = FRotationMatrix::MakeFromX(InCameraFocalPoint - InCameraLocation).ToQuat(); 81 | CameraRotation = FQuat(CameraRotation.GetAxisX(), FMath::DegreesToRadians(InCameraRoll)) * CameraRotation; 82 | return CameraRotation; 83 | } 84 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Private/CameraVolumesModule.cpp: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #include "CameraVolumesModule.h" 4 | 5 | #define LOCTEXT_NAMESPACE "FCameraVolumesModule" 6 | 7 | void FCameraVolumesModule::StartupModule() 8 | { 9 | } 10 | 11 | void FCameraVolumesModule::ShutdownModule() 12 | { 13 | } 14 | 15 | #undef LOCTEXT_NAMESPACE 16 | 17 | IMPLEMENT_MODULE(FCameraVolumesModule, CameraVolumes) 18 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Private/CameraVolumesPaperCharacter.cpp: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #include "CameraVolumesPaperCharacter.h" 4 | #include "Components/CapsuleComponent.h" 5 | #include "GameFramework/CharacterMovementComponent.h" 6 | #include "GameFramework/PlayerController.h" 7 | #include "CameraVolumeActor.h" 8 | #include "CameraVolumesCameraManager.h" 9 | #include "CameraVolumesFunctionLibrary.h" 10 | 11 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CameraVolumesPaperCharacter) 12 | 13 | ACameraVolumesPaperCharacter::ACameraVolumesPaperCharacter() 14 | { 15 | // Create a camera 16 | CameraComponent = CreateDefaultSubobject(TEXT("Camera")); 17 | CameraComponent->bUsePawnControlRotation = false; // We don't want the controller rotating the camera 18 | 19 | // Configure character movement 20 | bUseControllerRotationPitch = false; 21 | bUseControllerRotationYaw = true; 22 | bUseControllerRotationRoll = false; 23 | GetCharacterMovement()->bOrientRotationToMovement = false; 24 | } 25 | 26 | ACameraVolumesPaperCharacter::ACameraVolumesPaperCharacter(const FObjectInitializer& ObjectInitializer) 27 | : Super(ObjectInitializer) 28 | { 29 | // Create a camera 30 | CameraComponent = CreateDefaultSubobject(TEXT("Camera")); 31 | CameraComponent->bUsePawnControlRotation = false; // We don't want the controller rotating the camera 32 | 33 | // Configure character movement 34 | bUseControllerRotationPitch = false; 35 | bUseControllerRotationYaw = true; 36 | bUseControllerRotationRoll = false; 37 | GetCharacterMovement()->bOrientRotationToMovement = false; 38 | } 39 | 40 | void ACameraVolumesPaperCharacter::PostInitializeComponents() 41 | { 42 | Super::PostInitializeComponents(); 43 | 44 | // Bind overlap events 45 | UPrimitiveComponent* CollisionPrimitiveComponent = GetCollisionPrimitiveComponent(); 46 | if (IsValid(CollisionPrimitiveComponent)) 47 | { 48 | CollisionPrimitiveComponent->OnComponentBeginOverlap.AddDynamic(this, &ACameraVolumesPaperCharacter::OnCollisionPrimitiveComponentBeginOverlap); 49 | CollisionPrimitiveComponent->OnComponentEndOverlap.AddDynamic(this, &ACameraVolumesPaperCharacter::OnCollisionPrimitiveComponentEndOverlap); 50 | } 51 | } 52 | 53 | void ACameraVolumesPaperCharacter::OnCollisionPrimitiveComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) 54 | { 55 | ACameraVolumeActor* CameraVolume = Cast(OtherActor); 56 | if (IsValid(CameraVolume)) 57 | { 58 | if (IsValid(CameraComponent)) 59 | { 60 | if (CameraComponent->OverlappingCameraVolumes.Num() == 0) 61 | { 62 | // Update camera volumes check condition in PlayerCameraManager 63 | APlayerController* PC = Cast(GetController()); 64 | if (IsValid(PC)) 65 | { 66 | ACameraVolumesCameraManager* CameraVolumePCM = Cast(PC->PlayerCameraManager); 67 | if (IsValid(CameraVolumePCM)) 68 | { 69 | CameraVolumePCM->SetProcessCameraVolumes(true); 70 | } 71 | } 72 | } 73 | 74 | CameraComponent->OverlappingCameraVolumes.Emplace(CameraVolume); 75 | } 76 | } 77 | } 78 | 79 | void ACameraVolumesPaperCharacter::OnCollisionPrimitiveComponentEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) 80 | { 81 | ACameraVolumeActor* CameraVolume = Cast(OtherActor); 82 | if (IsValid(CameraVolume)) 83 | { 84 | if (IsValid(CameraComponent)) 85 | { 86 | CameraComponent->OverlappingCameraVolumes.Remove(CameraVolume); 87 | } 88 | } 89 | } 90 | 91 | UCameraVolumesCameraComponent* ACameraVolumesPaperCharacter::GetCameraComponent() const 92 | { 93 | return CameraComponent; 94 | } 95 | 96 | UPrimitiveComponent* ACameraVolumesPaperCharacter::GetCollisionPrimitiveComponent() const 97 | { 98 | return GetCapsuleComponent(); 99 | } 100 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Public/CameraVolumeActor.h: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | /** 4 | * Camera volume actor stores desired camera parameters and volume information. 5 | * Calculates camera preview, side indicators and volume extents by itself when updated in Editor. 6 | * This actor is static in context of this algorithm, but it's parameters can be changed during runtime. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "CoreMinimal.h" 12 | #include "GameFramework/Actor.h" 13 | #include "CameraVolumesTypes.h" 14 | #include "Kismet/KismetMathLibrary.h" 15 | #include "CameraVolumeActor.generated.h" 16 | 17 | UCLASS(Config = CameraVolumes, AutoExpandCategories = ("Camera", "Camera|Location", "Camera|Rotation", "Camera|FOV/OrthoWidth", "Camera|Utils", "Volume", "VolumeSides", "VolumeSides|SmoothTransition", "VolumeSides|Right", "VolumeSides|Left", "VolumeSides|Top", "VolumeSides|Bottom", "VolumeSides|Front", "VolumeSides|Back")) 18 | class CAMERAVOLUMES_API ACameraVolumeActor : public AActor 19 | { 20 | GENERATED_BODY() 21 | 22 | public: 23 | ACameraVolumeActor(); 24 | 25 | 26 | // Components 27 | protected: 28 | UPROPERTY() 29 | class USceneComponent* DefaultSceneRoot; 30 | 31 | UPROPERTY(VisibleAnywhere, Category = Volume) 32 | class UBoxComponent* BoxComponent; 33 | 34 | 35 | #if WITH_EDITORONLY_DATA 36 | protected: 37 | UPROPERTY() 38 | class UBillboardComponent* BillboardComponent; 39 | 40 | UPROPERTY(Config) 41 | FString BillboardIconPath; 42 | 43 | UPROPERTY() 44 | class UCameraVolumesCameraComponent* CameraPreview; 45 | #endif 46 | 47 | 48 | // Volume 49 | public: 50 | // Camera volume priority (to handle overlapped volumes) 51 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Volume, Meta = (ClampMin = "-100", ClampMax = "100", UIMin = "-100", UIMax = "100")) 52 | int32 Priority; 53 | 54 | protected: 55 | UPROPERTY(Config) 56 | float OpenEdgeOffset; 57 | 58 | UPROPERTY(Config) 59 | FVector VolumeExtentDefault; 60 | 61 | public: 62 | // Volume extent 63 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Volume, Meta = (MakeEditWidget = true)) 64 | FVector VolumeExtent; 65 | 66 | // Set new VolumeExtent 67 | UFUNCTION(BlueprintCallable, Category = Volume) 68 | void SetVolumeExtent(FVector NewVolumeExtent); 69 | 70 | 71 | // Depth extent 72 | #if WITH_EDITORONLY_DATA 73 | protected: 74 | UPROPERTY() 75 | bool bUseZeroDepthExtentEditCond; 76 | #endif 77 | 78 | public: 79 | // (For 2D games) Should use zero volume extent (by depth) for camera blocking? 80 | UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category = Volume, Meta = (EditCondition = "bUseZeroDepthExtentEditCond")) 81 | bool bUseZeroDepthExtent; 82 | 83 | // Set new bUseZeroDepthExtent 84 | UFUNCTION(BlueprintCallable, Category = Volume) 85 | void SetUseZeroDepthExtent(bool bNewUseZeroDepthExtent); 86 | 87 | 88 | // 6 DOF volume 89 | public: 90 | // Should process all 6 volume sides? 91 | UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category = Volume) 92 | bool bUse6DOFVolume; 93 | 94 | // Set new bUse6DOFVolume 95 | UFUNCTION(BlueprintCallable, Category = Volume) 96 | void SetUse6DOFVolume(bool bNewUse6DOFVolume); 97 | 98 | 99 | // Camera blocking 100 | #if WITH_EDITORONLY_DATA 101 | protected: 102 | UPROPERTY() 103 | bool bPerformCameraBlockingEditCond; 104 | #endif 105 | 106 | public: 107 | // Should perform camera blocking calculations in this volume? 108 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Volume, Meta = (EditCondition = "bPerformCameraBlockingEditCond")) 109 | bool bPerformCameraBlocking; 110 | 111 | 112 | // Main box collision 113 | public: 114 | // Should disable collision for main box primitive? 115 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Volume) 116 | bool bDisableMainBoxCollision; 117 | 118 | // Disable main box collision 119 | UFUNCTION(BlueprintCallable, Category = Volume) 120 | void SetDisableMainBoxCollision(bool bNewDisableMainBoxCollision); 121 | 122 | 123 | #if WITH_EDITORONLY_DATA 124 | public: 125 | // Camera projection mode (for camera frustrum preview only!) 126 | UPROPERTY(Config, EditAnywhere, BlueprintReadWrite, Category = Camera) 127 | TEnumAsByte CameraProjectionMode; 128 | #endif 129 | 130 | 131 | // Camera mobility 132 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Camera) 133 | ECameraMobility CameraMobility; 134 | 135 | // Set new CameraMobility 136 | UFUNCTION(BlueprintCallable, Category = Camera) 137 | void SetCameraMobility(ECameraMobility NewCameraMobility); 138 | 139 | protected: 140 | UPROPERTY() 141 | bool bIsCameraStatic; 142 | 143 | public: 144 | // Returns is volume uses static camera mobility 145 | UFUNCTION(BlueprintPure, Category = Camera) 146 | bool GetIsCameraStatic() const { return bIsCameraStatic; } 147 | 148 | 149 | // Camera rotation axis 150 | #if WITH_EDITORONLY_DATA 151 | protected: 152 | UPROPERTY() 153 | bool bUseCameraRotationAxisEditCond; 154 | #endif 155 | 156 | public: 157 | // Should rotate camera around volume's central axis? 158 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Camera, Meta = (EditCondition = "bUseCameraRotationAxisEditCond")) 159 | bool bUseCameraRotationAxis; 160 | 161 | 162 | // Camera location 163 | public: 164 | // Should override camera location? 165 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Camera|Location") 166 | bool bOverrideCameraLocation; 167 | 168 | // Set new bOverrideCameraLocation 169 | UFUNCTION(BlueprintCallable, Category = Camera) 170 | void SetOverrideCameraLocation(bool bNewOverrideCameraLocation); 171 | 172 | // New camera location 173 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Camera|Location", Meta = (EditCondition = "bOverrideCameraLocation", MakeEditWidget = true)) 174 | FVector CameraLocation; 175 | 176 | // Set new CameraLocation 177 | UFUNCTION(BlueprintCallable, Category = Camera) 178 | void SetCameraLocation(FVector NewCameraLocation); 179 | 180 | // Should camera location be relative to volume or to player character? 181 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|Location") 182 | bool bCameraLocationRelativeToVolume; 183 | 184 | 185 | // Camera rotation 186 | public: 187 | // Should override camera focal point? 188 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Camera|Rotation") 189 | bool bOverrideCameraRotation; 190 | 191 | // Set new bOverrideCameraRotation 192 | UFUNCTION(BlueprintCallable, Category = Camera) 193 | void SetOverrideCameraRotation(bool bNewOverrideCameraRotation); 194 | 195 | // New camera focal point 196 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Camera|Rotation", Meta = (EditCondition = "bOverrideCameraRotation", MakeEditWidget = true)) 197 | FVector CameraFocalPoint; 198 | 199 | // Set new CameraFocalPoint 200 | UFUNCTION(BlueprintCallable, Category = Camera) 201 | void SetCameraFocalPoint(FVector NewCameraFocalPoint); 202 | 203 | // New camera roll 204 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "Camera|Rotation", Meta = (EditCondition = "bOverrideCameraRotation")) 205 | float CameraRoll; 206 | 207 | // Set new CameraRoll 208 | UFUNCTION(BlueprintCallable, Category = Camera) 209 | void SetCameraRoll(float NewCameraRoll); 210 | 211 | #if WITH_EDITORONLY_DATA 212 | protected: 213 | UPROPERTY() 214 | bool bFocalPointIsPlayerEditCond; 215 | #endif 216 | 217 | public: 218 | // Should camera look at player character? 219 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|Rotation", Meta = (EditCondition = "bFocalPointIsPlayerEditCond")) 220 | bool bFocalPointIsPlayer; 221 | 222 | protected: 223 | UPROPERTY() 224 | FQuat CameraRotation; 225 | 226 | public: 227 | const FQuat& GetCameraRotation() const { return CameraRotation; } 228 | 229 | // Camera FOV/OrthoWidth 230 | public: 231 | // Should override camera FOV? For perspective cameras. 232 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|FOV/OrthoWidth", Meta = (EditCondition = "CameraProjectionMode == ECameraProjectionMode::Perspective")) 233 | bool bOverrideCameraFieldOfView; 234 | 235 | // New camera FOV. For perspective cameras. 236 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|FOV/OrthoWidth", Meta = (EditCondition = "bOverrideCameraFieldOfView", UIMin = "5", UIMax = "170", ClampMin = "0.001", ClampMax = "360", Units = deg)) 237 | float CameraFieldOfView; 238 | 239 | // Should override camera OrthoWidth? For orthographic cameras. 240 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|FOV/OrthoWidth", Meta = (EditCondition = "CameraProjectionMode == ECameraProjectionMode::Orthographic")) 241 | bool bOverrideCameraOrthoWidth; 242 | 243 | // New camera OrthoWidth. For orthographic cameras. 244 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|FOV/OrthoWidth", Meta = (EditCondition = "bOverrideCameraOrthoWidth")) 245 | float CameraOrthoWidth; 246 | 247 | 248 | // Camera lag 249 | #if WITH_EDITORONLY_DATA 250 | protected: 251 | UPROPERTY() 252 | bool bDisableCameraLocationLagEditCond; 253 | 254 | UPROPERTY() 255 | bool bDisableCameraRotationLagEditCond; 256 | #endif 257 | 258 | public: 259 | // Should disable camera location lag in this particular volume? 260 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|Utils", Meta = (EditCondition = "bDisableCameraLocationLagEditCond")) 261 | bool bDisableCameraLocationLag; 262 | 263 | // Should disable camera rotation lag in this particular volume? 264 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|Utils", Meta = (EditCondition = "bDisableCameraRotationLagEditCond")) 265 | bool bDisableCameraRotationLag; 266 | 267 | // Speed of smooth camera transition 268 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VolumeSides|SmoothTransition", Meta = (ClampMin = "0.01", ClampMax = "10", UIMin = "0.01", UIMax = "10")) 269 | float CameraSmoothTransitionSpeed; 270 | 271 | // Smooth camera transition easing function 272 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VolumeSides|SmoothTransition") 273 | TEnumAsByte SmoothTransitionEasingFunc; 274 | 275 | // Easing function exponent 276 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VolumeSides|SmoothTransition") 277 | float EasingFuncBlendExp; 278 | 279 | // Easing function steps 280 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VolumeSides|SmoothTransition", Meta = (ClampMin = "1", UIMin = "1")) 281 | int32 EasingFuncSteps; 282 | 283 | 284 | // Camera collision 285 | #if WITH_EDITORONLY_DATA 286 | protected: 287 | UPROPERTY() 288 | bool bDoCollisionTestEditCond; 289 | #endif 290 | 291 | public: 292 | // Should do a camera collision test in this particular volume? 293 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Camera|Utils", Meta = (EditCondition = "bDoCollisionTestEditCond")) 294 | bool bDoCollisionTest; 295 | 296 | 297 | // Sides info 298 | public: 299 | // Right side info 300 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "VolumeSides|Right", Meta = (ShowOnlyInnerProperties)) 301 | FSideInfo RightSide; 302 | 303 | // Left side info 304 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "VolumeSides|Left", Meta = (ShowOnlyInnerProperties)) 305 | FSideInfo LeftSide; 306 | 307 | // Top side info 308 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "VolumeSides|Top", Meta = (ShowOnlyInnerProperties)) 309 | FSideInfo TopSide; 310 | 311 | // Bottom side info 312 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "VolumeSides|Bottom", Meta = (ShowOnlyInnerProperties)) 313 | FSideInfo BottomSide; 314 | 315 | // Front side info 316 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "VolumeSides|Front", Meta = (ShowOnlyInnerProperties)) 317 | FSideInfo FrontSide; 318 | 319 | // Back side info 320 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "VolumeSides|Back", Meta = (ShowOnlyInnerProperties)) 321 | FSideInfo BackSide; 322 | 323 | // Set new side info 324 | UFUNCTION(BlueprintCallable, Category = VolumeSides) 325 | void SetSide(ESide Side, FSideInfo NewSideInfo); 326 | 327 | // In-editor all sides setters 328 | #if WITH_EDITOR 329 | public: 330 | // Set all open 331 | UFUNCTION(CallInEditor, Category = VolumeSides) 332 | void SetAllOpen(); 333 | 334 | // Set all closed 335 | UFUNCTION(CallInEditor, Category = VolumeSides) 336 | void SetAllClosed(); 337 | 338 | // Set all normal 339 | UFUNCTION(CallInEditor, Category = VolumeSides) 340 | void SetAllNormal(); 341 | 342 | // Set all smooth 343 | UFUNCTION(CallInEditor, Category = VolumeSides) 344 | void SetAllSmooth(); 345 | 346 | // Set all cut 347 | UFUNCTION(CallInEditor, Category = VolumeSides) 348 | void SetAllCut(); 349 | #endif 350 | 351 | 352 | // Text indicators 353 | #if WITH_EDITOR 354 | protected: 355 | void CreateSidesIndicators(); 356 | void UpdateSidesIndicators(); 357 | #endif 358 | 359 | #if WITH_EDITORONLY_DATA 360 | public: 361 | // Text size of sides indicators 362 | UPROPERTY(Config, EditAnywhere, BlueprintReadOnly, Category = VolumeSides) 363 | float TextSize; 364 | 365 | protected: 366 | UPROPERTY() 367 | TArray Text_Indicators; 368 | 369 | const FText Text_Front = FText::FromString("FRONT"); 370 | const FText Text_Back = FText::FromString("BACK"); 371 | const FText Text_Right = FText::FromString("RIGHT"); 372 | const FText Text_Left = FText::FromString("LEFT"); 373 | const FText Text_Top = FText::FromString("TOP"); 374 | const FText Text_Bottom = FText::FromString("BOTTOM"); 375 | const FText Text_Open = FText::FromString("OPEN"); 376 | const FText Text_Closed = FText::FromString("CLOSED"); 377 | const FText Text_Normal = FText::FromString("NORMAL"); 378 | const FText Text_Smooth = FText::FromString("SMOOTH"); 379 | const FText Text_Cut = FText::FromString("CUT"); 380 | #endif 381 | 382 | protected: 383 | UPROPERTY() 384 | float CamVolAspectRatio; 385 | 386 | UPROPERTY() 387 | FVector CamVolMinCorrected; 388 | 389 | UPROPERTY() 390 | FVector CamVolMaxCorrected; 391 | 392 | UPROPERTY() 393 | FVector CamVolExtentCorrected; 394 | 395 | public: 396 | float GetCamVolAspectRatio() const { return CamVolAspectRatio; } 397 | const FVector& GetCamVolMinCorrected() const { return CamVolMinCorrected; } 398 | const FVector& GetCamVolMaxCorrected() const { return CamVolMaxCorrected; } 399 | const FVector& GetCamVolExtentCorrected() const { return CamVolExtentCorrected; } 400 | 401 | // Use this to update volume after made changes in editor, if they are not applied automatically 402 | UFUNCTION(CallInEditor, Category = Volume) 403 | void UpdateVolume(); 404 | 405 | // Calculate volume extents 406 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 407 | void CalculateVolumeExtents(); 408 | 409 | // Get side info for the volume side nearest to player location 410 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 411 | FSideInfo GetNearestVolumeSideInfo(const FVector& PlayerPawnLocation) const; 412 | 413 | #if WITH_EDITOR 414 | public: 415 | virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; 416 | virtual void EditorApplyTranslation(const FVector& DeltaTranslation, bool bAltDown, bool bShiftDown, bool bCtrlDown) override; 417 | virtual void EditorApplyRotation(const FRotator& DeltaRotation, bool bAltDown, bool bShiftDown, bool bCtrlDown) override; 418 | virtual void EditorApplyScale(const FVector& DeltaScale, const FVector* PivotLocation, bool bAltDown, bool bShiftDown, bool bCtrlDown) override; 419 | virtual void EditorApplyMirror(const FVector& MirrorScale, const FVector& PivotLocation) override; 420 | #endif 421 | }; 422 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Public/CameraVolumeDynamicActor.h: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | // Dynamic camera volume actor 4 | 5 | #pragma once 6 | 7 | #include "CoreMinimal.h" 8 | #include "CameraVolumeActor.h" 9 | #include "CameraVolumeDynamicActor.generated.h" 10 | 11 | UCLASS() 12 | class CAMERAVOLUMES_API ACameraVolumeDynamicActor : public ACameraVolumeActor 13 | { 14 | GENERATED_BODY() 15 | 16 | public: 17 | ACameraVolumeDynamicActor(); 18 | }; 19 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Public/CameraVolumesCameraComponent.h: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | /** 4 | * Camera component that must be used with camera volumes. 5 | * Contains various camera parameters. 6 | * Contains overlapped camera volumes. 7 | * Updates final camera parameters provided by camera manager. 8 | * Can do camera collision test and camera relative rotation similar to SpringArmComponent. 9 | */ 10 | 11 | #pragma once 12 | 13 | #include "CoreMinimal.h" 14 | #include "Camera/CameraComponent.h" 15 | #include "CameraVolumesTypes.h" 16 | #include "CameraVolumesCameraComponent.generated.h" 17 | 18 | UCLASS(Config = CameraVolumes, AutoExpandCategories = (CameraSettings, "CameraSettings | DefaultParameters", "CameraSettings | AdditionalParameters", "CameraSettings | CameraCollision", "CameraSettings | CameraControlRotation")) 19 | class CAMERAVOLUMES_API UCameraVolumesCameraComponent : public UCameraComponent 20 | { 21 | GENERATED_BODY() 22 | 23 | public: 24 | UCameraVolumesCameraComponent(); 25 | 26 | 27 | // Default parameters 28 | public: 29 | // Default camera RELATIVE location 30 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "CameraSettings | DefaultParameters") 31 | FVector DefaultCameraLocation; 32 | 33 | // Set default camera location 34 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 35 | void SetDefaultCameraLocation(FVector NewDefaultCameraLocation); 36 | 37 | // Default camera RELATIVE focal point 38 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "CameraSettings | DefaultParameters") 39 | FVector DefaultCameraFocalPoint; 40 | 41 | // Set default camera focal point 42 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 43 | void SetDefaultCameraFocalPoint(FVector NewDefaultCameraFocalPoint); 44 | 45 | // Default camera roll 46 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "CameraSettings | DefaultParameters") 47 | float DefaultCameraRoll; 48 | 49 | // Set default camera roll 50 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 51 | void SetDefaultCameraRoll(float NewDefaultCameraRoll); 52 | 53 | protected: 54 | UPROPERTY() 55 | FQuat DefaultCameraRotation; 56 | 57 | public: 58 | const FQuat& GetDefaultCameraRotation() const { return DefaultCameraRotation; } 59 | 60 | // Default camera FOV. For perspective cameras. 61 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | DefaultParameters", Meta = (UIMin = "5.0", UIMax = "170", ClampMin = "0.001", ClampMax = "360", Units = deg)) 62 | float DefaultCameraFieldOfView; 63 | 64 | // Default camera OrthoWidth. For orthographic cameras. 65 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | DefaultParameters") 66 | float DefaultCameraOrthoWidth; 67 | 68 | // Should camera use location lag? 69 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | DefaultParameters") 70 | bool bEnableCameraLocationLag; 71 | 72 | // Camera location lag speed 73 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | DefaultParameters", Meta = (EditCondition = "bEnableCameraLocationLag", ClampMin = "0", ClampMax = "1000", UIMin = "0", UIMax = "1000")) 74 | float CameraLocationLagSpeed; 75 | 76 | // Should camera use rotation lag? 77 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | DefaultParameters") 78 | bool bEnableCameraRotationLag; 79 | 80 | // Camera rotation lag speed 81 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | DefaultParameters", Meta = (EditCondition = "bEnableCameraRotationLag", ClampMin = "0", ClampMax = "1000", UIMin = "0", UIMax = "1000")) 82 | float CameraRotationLagSpeed; 83 | 84 | // Should camera use FOV interpolation? For perspective cameras. 85 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | DefaultParameters") 86 | bool bEnableCameraFOVInterp; 87 | 88 | // Camera FOV interpolation speed. For perspective cameras. 89 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | DefaultParameters", Meta = (EditCondition = "bEnableCameraFOVInterp", ClampMin = "0", ClampMax = "1000", UIMin = "0", UIMax = "1000")) 90 | float CameraFOVInterpSpeed; 91 | 92 | // Should camera use OrthoWidth interpolation? For orthographic cameras. 93 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | DefaultParameters") 94 | bool bEnableCameraOrthoWidthInterp; 95 | 96 | // Camera OrthoWidth interpolation speed. For orthographic cameras. 97 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | DefaultParameters", Meta = (EditCondition = "bEnableCameraOrthoWidthInterp", ClampMin = "0", ClampMax = "1000", UIMin = "0", UIMax = "1000")) 98 | float CameraOrthoWidthInterpSpeed; 99 | 100 | 101 | // Additional parameters 102 | public: 103 | // Should camera use additional (WORLD-SPACE) parameters? 104 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | AdditionalParameters") 105 | bool bUseAdditionalCameraParams; 106 | 107 | // Additional location 108 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | AdditionalParameters", Meta = (EditCondition = "bUseAdditionalCameraParams")) 109 | FVector AdditionalCameraLocation; 110 | 111 | // Additional rotation 112 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | AdditionalParameters", Meta = (EditCondition = "bUseAdditionalCameraParams")) 113 | FRotator AdditionalCameraRotation; 114 | 115 | // Additional FOV. For perspective cameras. 116 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | AdditionalParameters", Meta = (EditCondition = "bUseAdditionalCameraParams")) 117 | float AdditionalCameraFOV; 118 | 119 | // Additional OrthoWidth. For orthographic cameras. 120 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | AdditionalParameters", Meta = (EditCondition = "bUseAdditionalCameraParams")) 121 | float AdditionalCameraOrthoWidth; 122 | 123 | 124 | // Camera collision 125 | public: 126 | // Do a camera collision test using ProbeChannel and ProbeSize to prevent camera clipping into level 127 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | CameraCollision") 128 | bool bDoCollisionTest; 129 | 130 | // How big should the query probe sphere be (in unreal units) 131 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | CameraCollision", Meta = (EditCondition = "bDoCollisionTest")) 132 | float ProbeSize; 133 | 134 | // Collision channel of the query probe (defaults to ECC_Camera) 135 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | CameraCollision", Meta = (EditCondition = "bDoCollisionTest")) 136 | TEnumAsByte ProbeChannel; 137 | 138 | 139 | // Camera rotation 140 | public: 141 | // Should update control rotation from camera rotation when not in UsePawnControlRotation mode? 142 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | CameraControlRotation") 143 | bool bUpdateControlRotationFromCameraRotation; 144 | 145 | // Should use pawn control rotation when it's possible? 146 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | CameraControlRotation") 147 | bool bUsePawnControlRotationCV; 148 | 149 | // Should use pitch? 150 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | CameraControlRotation", Meta = (EditCondition = "bUsePawnControlRotationCV")) 151 | bool bInheritPitchCV; 152 | 153 | // Should use yaw? 154 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | CameraControlRotation", Meta = (EditCondition = "bUsePawnControlRotationCV")) 155 | bool bInheritYawCV; 156 | 157 | // Should use roll? 158 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "CameraSettings | CameraControlRotation", Meta = (EditCondition = "bUsePawnControlRotationCV")) 159 | bool bInheritRollCV; 160 | 161 | // Overlapping camera volumes 162 | UPROPERTY(BlueprintReadOnly, Category = CameraVolumes) 163 | TSet OverlappingCameraVolumes; 164 | 165 | // Should update camera parameters? 166 | UPROPERTY(BlueprintReadWrite, Category = CameraVolumes) 167 | bool bUpdateCamera; 168 | 169 | // Updates camera by camera manager 170 | void UpdateCamera(FMinimalViewInfo& InViewInfo); 171 | 172 | // Update camera component parameters 173 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 174 | void UpdateCameraComponent(); 175 | 176 | #if WITH_EDITOR 177 | public: 178 | virtual void PostEditChangeProperty(FPropertyChangedEvent& PropertyChangedEvent) override; 179 | #endif 180 | }; 181 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Public/CameraVolumesCameraManager.h: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | /** 4 | * Player camera manager performs camera calculations according to camera parameters from camera component or camera volume. 5 | * Contains OnCameraVolumeChanged delegate. 6 | */ 7 | 8 | #pragma once 9 | 10 | #include "CoreMinimal.h" 11 | #include "Camera/PlayerCameraManager.h" 12 | #include "CameraVolumesTypes.h" 13 | #include "CameraVolumesCameraManager.generated.h" 14 | 15 | // Delegate for notification when camera volume is changed 16 | DECLARE_DYNAMIC_MULTICAST_DELEGATE_TwoParams(FCameraVolumeChangedSignature, const class ACameraVolumeActor*, CameraVolume, FSideInfo, PassedSideInfo); 17 | 18 | UCLASS(Config = CameraVolumes) 19 | class CAMERAVOLUMES_API ACameraVolumesCameraManager : public APlayerCameraManager 20 | { 21 | GENERATED_BODY() 22 | 23 | public: 24 | ACameraVolumesCameraManager(const FObjectInitializer& ObjectInitializer); 25 | virtual void UpdateCamera(float DeltaTime) override; 26 | 27 | protected: 28 | // Calculate new camera parameters 29 | void CalculateCameraParams(float DeltaTime); 30 | 31 | // Set transition according to side info 32 | void SetTransitionBySideInfo(const ACameraVolumeActor* CameraVolume, const FSideInfo& SideInfo); 33 | 34 | // Calculate camera transitions and interpolations 35 | void CalculateTransitions(float DeltaTime); 36 | 37 | public: 38 | // Should perform camera updates? 39 | UPROPERTY(BlueprintReadOnly, Category = CameraVolumes) 40 | bool bUpdateCamera; 41 | 42 | // Set perform camera updates. 43 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 44 | void SetUpdateCamera(bool bShouldUpdateCamera) { bUpdateCamera = bShouldUpdateCamera; } 45 | 46 | // Should process camera volumes? 47 | UPROPERTY(BlueprintReadOnly, Category = CameraVolumes) 48 | bool bProcessCameraVolumes; 49 | 50 | // Set process camera volumes. Used by Player Character according to overlapping camera volumes. 51 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 52 | void SetProcessCameraVolumes(bool bShouldProcess) { bProcessCameraVolumes = bShouldProcess; } 53 | 54 | // Should perform camera blocking calculations? 55 | UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = CameraVolumes) 56 | bool bPerformBlockingCalculations; 57 | 58 | // Set perform camera blocking calculations 59 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 60 | virtual void SetPerformBlockingCalculations(bool bShouldPerformBlockingCalculations) { bPerformBlockingCalculations = bShouldPerformBlockingCalculations; } 61 | 62 | // Calculate screen world extent at depth 63 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 64 | FVector2D CalculateScreenWorldExtentAtDepth(float Depth); 65 | 66 | // Get new calculated camera location. 67 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = CameraVolumes) 68 | const FVector& GetCameraLocationNew() const { return CameraLocationNew; } 69 | 70 | // Get new calculated camera focal point. 71 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = CameraVolumes) 72 | const FVector& GetCameraFocalPointNew() const { return CameraFocalPointNew; } 73 | 74 | // Get new calculated camera rotation. 75 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = CameraVolumes) 76 | const FRotator GetCameraRotationNew() const { return CameraQuatNew.Rotator(); } 77 | 78 | // Get new calculated camera FOV. 79 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = CameraVolumes) 80 | const float GetCameraFOVNew() const { return CameraFOVNew; } 81 | 82 | // Get new calculated camera OrthoWidth. 83 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = CameraVolumes) 84 | const float GetCameraOrthoWidthNew() const { return CameraOrthoWidthNew; } 85 | 86 | // Get new calculated camera location (including additional camera params). 87 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = CameraVolumes) 88 | const FVector& GetCameraLocationFinal() const { return CameraLocationFinal; } 89 | 90 | // Get new calculated camera rotation (including additional camera params). 91 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = CameraVolumes) 92 | const FRotator GetCameraRotationFinal() const { return CameraQuatFinal.Rotator(); } 93 | 94 | // Get new calculated camera FOV (including additional camera params). 95 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = CameraVolumes) 96 | const float GetCameraFOVFinal() const { return CameraFOVFinal; } 97 | 98 | // Get new calculated camera OrthoWidth (including additional camera params). 99 | UFUNCTION(BlueprintCallable, BlueprintPure, Category = CameraVolumes) 100 | const float GetCameraOrthoWidthFinal() const { return CameraOrthoWidthFinal; } 101 | 102 | // Reset first pass calculations 103 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 104 | void ResetFirstPass() { bFirstPass = true; } 105 | 106 | // OnCameraVolumeChanged event signature 107 | UPROPERTY(BlueprintAssignable, Category = CameraVolumes) 108 | FCameraVolumeChangedSignature OnCameraVolumeChanged; 109 | 110 | protected: 111 | UPROPERTY() 112 | class APawn* PlayerPawn; 113 | 114 | FVector PlayerPawnLocation; 115 | bool bUsePlayerPawnControlRotation; 116 | 117 | UPROPERTY() 118 | class UCameraVolumesCameraComponent* CameraComponent; 119 | 120 | UPROPERTY(BlueprintReadOnly, Category = CameraVolumes) 121 | const ACameraVolumeActor* CameraVolumeCurrent; 122 | 123 | UPROPERTY() 124 | const ACameraVolumeActor* CameraVolumePrevious; 125 | 126 | UPROPERTY() 127 | FMinimalViewInfo CameraViewInfoFinal; 128 | 129 | FVector CameraLocationSourceOld; 130 | FVector CameraLocationSourceNew; 131 | FVector CameraLocationOld; 132 | FVector CameraLocationNew; 133 | FVector CameraLocationNewFixed; 134 | FVector CameraLocationFinal; 135 | 136 | FVector CameraFocalPointNew; 137 | FQuat CameraQuatOld; 138 | FQuat CameraQuatNew; 139 | FQuat CameraQuatFinal; 140 | 141 | float CameraFOVOld; 142 | float CameraFOVNew; 143 | float CameraFOVFinal; 144 | 145 | float CameraOrthoWidthOld; 146 | float CameraOrthoWidthNew; 147 | float CameraOrthoWidthFinal; 148 | 149 | bool bFirstPass; 150 | 151 | bool bIsCameraStatic; 152 | 153 | TEnumAsByte CameraProjectionModeOld; 154 | TEnumAsByte CameraProjectionModeNew; 155 | 156 | bool bNeedsSmoothTransition; 157 | bool bSmoothTransitionInterrupted; 158 | 159 | bool bSmoothTransitionJustStarted; 160 | float SmoothTransitionSpeed; 161 | float SmoothTransitionAlpha; 162 | float SmoothTransitionAlphaEase; 163 | 164 | uint8 SmoothTransitionEasingFunc; 165 | float EasingFuncBlendExp; 166 | int32 EasingFuncSteps; 167 | 168 | bool bNeedsCutTransition; 169 | 170 | bool bBlockingCalculations; 171 | 172 | bool bBroadcastOnCameraVolumeChanged; 173 | 174 | UPROPERTY() 175 | const ACameraVolumeActor* BroadcastCameraVolume; 176 | 177 | UPROPERTY() 178 | FSideInfo BroadcastSideInfo; 179 | }; 180 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Public/CameraVolumesCharacter.h: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | /** 4 | * Player character stores Camera component. 5 | * Player character uses BeginOverlap event of it's capsule collision primitive, to get overlapped camera volume and store it in special array of camera volume actors. 6 | * Player character uses EndOverlap event of it's capsule collision primitive, to remove camera volume from array of camera volume actors. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "GameFramework/Character.h" 12 | #include "CameraVolumesCharacterInterface.h" 13 | #include "CameraVolumesCharacter.generated.h" 14 | 15 | UCLASS() 16 | class CAMERAVOLUMES_API ACameraVolumesCharacter : public ACharacter, public ICameraVolumesCharacterInterface 17 | { 18 | GENERATED_BODY() 19 | 20 | public: 21 | ACameraVolumesCharacter(); 22 | ACameraVolumesCharacter(const FObjectInitializer& ObjectInitializer); 23 | virtual void PostInitializeComponents() override; 24 | virtual class UCameraVolumesCameraComponent* GetCameraComponent() const override; 25 | virtual class UPrimitiveComponent* GetCollisionPrimitiveComponent() const override; 26 | 27 | protected: 28 | // Camera component 29 | UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = CameraVolumes) 30 | class UCameraVolumesCameraComponent* CameraComponent; 31 | 32 | virtual void OnCollisionPrimitiveComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) override; 33 | 34 | virtual void OnCollisionPrimitiveComponentEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) override; 35 | }; 36 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Public/CameraVolumesCharacterInterface.h: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | /** 4 | * Interface for characters using camera volumes. 5 | * Returns camera component. 6 | * Returns collision primitive component and it's BeginOverlap and EndOverlap events. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "CoreMinimal.h" 12 | #include "CameraVolumesCameraComponent.h" 13 | #include "Components/PrimitiveComponent.h" 14 | #include "CameraVolumesCharacterInterface.generated.h" 15 | 16 | UINTERFACE(Meta = (CannotImplementInterfaceInBlueprint = true)) 17 | class CAMERAVOLUMES_API UCameraVolumesCharacterInterface : public UInterface 18 | { 19 | GENERATED_BODY() 20 | }; 21 | 22 | class CAMERAVOLUMES_API ICameraVolumesCharacterInterface 23 | { 24 | GENERATED_BODY() 25 | 26 | public: 27 | // Returns CameraComponent subobject 28 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 29 | virtual class UCameraVolumesCameraComponent* GetCameraComponent() const = 0; 30 | 31 | // Returns collision primitive subobject (CapsuleComponent for Characters) 32 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 33 | virtual class UPrimitiveComponent* GetCollisionPrimitiveComponent() const = 0; 34 | 35 | protected: 36 | UFUNCTION() 37 | virtual void OnCollisionPrimitiveComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) = 0; 38 | 39 | UFUNCTION() 40 | virtual void OnCollisionPrimitiveComponentEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) = 0; 41 | }; 42 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Public/CameraVolumesFunctionLibrary.h: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Kismet/BlueprintFunctionLibrary.h" 7 | #include "CameraVolumesFunctionLibrary.generated.h" 8 | 9 | UCLASS() 10 | class CAMERAVOLUMES_API UCameraVolumesFunctionLibrary : public UBlueprintFunctionLibrary 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | // Get current camera volume from array of volumes according to 6 sides, coordinates and priority 16 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 17 | static const class ACameraVolumeActor* GetCurrentCameraVolume(const TSet& InCameraVolumes, const FVector& InPlayerPawnLocation); 18 | 19 | // Check is sides are in pair Front/Back, Right/Left, Top/Bottom 20 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 21 | static bool CompareSidesPairs(ESide SideA, ESide SideB, bool b6DOFVolume); 22 | 23 | // Calculate camera rotation from camera position, focal point and roll 24 | UFUNCTION(BlueprintCallable, Category = CameraVolumes) 25 | static FQuat CalculateCameraRotation(const FVector& InCameraLocation, const FVector& InCameraFocalPoint, float InCameraRoll); 26 | }; 27 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Public/CameraVolumesModule.h: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "Modules/ModuleManager.h" 7 | 8 | class FCameraVolumesModule : public IModuleInterface 9 | { 10 | public: 11 | virtual void StartupModule() override; 12 | virtual void ShutdownModule() override; 13 | }; 14 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Public/CameraVolumesPaperCharacter.h: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | /** 4 | * Player character derived from PaperCharacter, stores default camera parameters and camera component. 5 | * Player character uses BeginOverlap event of it's capsule collision primitive, to get overlapped camera volume and store it in special array of camera volume actors. 6 | * Player character uses EndOverlap event of it's capsule collision primitive, to remove camera volume from array of camera volume actors. 7 | */ 8 | 9 | #pragma once 10 | 11 | #include "PaperCharacter.h" 12 | #include "CameraVolumesCharacterInterface.h" 13 | #include "CameraVolumesPaperCharacter.generated.h" 14 | 15 | UCLASS() 16 | class CAMERAVOLUMES_API ACameraVolumesPaperCharacter : public APaperCharacter, public ICameraVolumesCharacterInterface 17 | { 18 | GENERATED_BODY() 19 | 20 | public: 21 | ACameraVolumesPaperCharacter(); 22 | ACameraVolumesPaperCharacter(const FObjectInitializer& ObjectInitializer); 23 | virtual void PostInitializeComponents() override; 24 | virtual class UCameraVolumesCameraComponent* GetCameraComponent() const override; 25 | virtual class UPrimitiveComponent* GetCollisionPrimitiveComponent() const override; 26 | 27 | protected: 28 | // Camera component 29 | UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = CameraVolumes) 30 | class UCameraVolumesCameraComponent* CameraComponent; 31 | 32 | virtual void OnCollisionPrimitiveComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) override; 33 | 34 | virtual void OnCollisionPrimitiveComponentEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) override; 35 | }; 36 | -------------------------------------------------------------------------------- /Plugins/CameraVolumes/Source/CameraVolumes/Public/CameraVolumesTypes.h: -------------------------------------------------------------------------------- 1 | // redbox, 2024 2 | 3 | #pragma once 4 | 5 | #include "CoreMinimal.h" 6 | #include "CameraVolumesTypes.generated.h" 7 | 8 | // Camera mobility 9 | UENUM(BlueprintType) 10 | enum class ECameraMobility : uint8 11 | { 12 | ECM_Movable UMETA(DisplayName = "Movable"), 13 | ECM_Static UMETA(DisplayName = "Static") 14 | }; 15 | 16 | // Sides 17 | UENUM(BlueprintType) 18 | enum class ESide : uint8 19 | { 20 | ES_Front UMETA(DisplayName = "Front"), 21 | ES_Back UMETA(DisplayName = "Back"), 22 | ES_Right UMETA(DisplayName = "Right"), 23 | ES_Left UMETA(DisplayName = "Left"), 24 | ES_Top UMETA(DisplayName = "Top"), 25 | ES_Bottom UMETA(DisplayName = "Bottom") 26 | }; 27 | 28 | // Side type (Open or Closed) 29 | UENUM(BlueprintType) 30 | enum class ESideType : uint8 31 | { 32 | EST_Open UMETA(DisplayName = "Open"), 33 | EST_Closed UMETA(DisplayName = "Closed") 34 | }; 35 | 36 | // Side Transition Type (Smooth or Cut) 37 | UENUM(BlueprintType) 38 | enum class ESideTransitionType : uint8 39 | { 40 | ESTT_Normal UMETA(DisplayName = "Normal"), 41 | ESTT_Smooth UMETA(DisplayName = "Smooth"), 42 | ESTT_Cut UMETA(DisplayName = "Cut") 43 | }; 44 | 45 | // Side info 46 | USTRUCT(BlueprintType) 47 | struct FSideInfo 48 | { 49 | GENERATED_BODY() 50 | 51 | UPROPERTY(BlueprintReadOnly) 52 | ESide Side; 53 | 54 | UPROPERTY(EditAnywhere, BlueprintReadWrite) 55 | ESideType SideType; 56 | 57 | UPROPERTY(EditAnywhere, BlueprintReadWrite) 58 | ESideTransitionType SideTransitionType; 59 | 60 | FSideInfo() 61 | { 62 | Side = ESide::ES_Front; 63 | SideType = ESideType::EST_Open; 64 | SideTransitionType = ESideTransitionType::ESTT_Normal; 65 | } 66 | }; 67 | -------------------------------------------------------------------------------- /Source/CamVol.Target.cs: -------------------------------------------------------------------------------- 1 | 2 | using UnrealBuildTool; 3 | using System.Collections.Generic; 4 | 5 | public class CamVolTarget : TargetRules 6 | { 7 | public CamVolTarget(TargetInfo Target) : base(Target) 8 | { 9 | Type = TargetType.Game; 10 | DefaultBuildSettings = BuildSettingsVersion.Latest; 11 | IncludeOrderVersion = EngineIncludeOrderVersion.Latest; 12 | ExtraModuleNames.Add("CamVol"); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Source/CamVol/CamVol.Build.cs: -------------------------------------------------------------------------------- 1 | 2 | using UnrealBuildTool; 3 | 4 | public class CamVol : ModuleRules 5 | { 6 | public CamVol(ReadOnlyTargetRules Target) : base(Target) 7 | { 8 | PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs; 9 | 10 | PublicDependencyModuleNames.AddRange( 11 | new string[] { 12 | "Core", 13 | "CoreUObject", 14 | "Engine", 15 | "InputCore", 16 | "CameraVolumes", 17 | "Paper2D" 18 | } 19 | ); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Source/CamVol/CamVol.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "CamVol.h" 3 | #include "Modules/ModuleManager.h" 4 | 5 | IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, CamVol, "CamVol" ); 6 | -------------------------------------------------------------------------------- /Source/CamVol/CamVol.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "CoreMinimal.h" 5 | -------------------------------------------------------------------------------- /Source/CamVol/CamVolCharacter.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "CamVolCharacter.h" 3 | #include "Components/CapsuleComponent.h" 4 | #include "Components/InputComponent.h" 5 | #include "GameFramework/CharacterMovementComponent.h" 6 | #include "CameraVolumesCameraManager.h" 7 | 8 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CamVolCharacter) 9 | 10 | ACamVolCharacter::ACamVolCharacter() 11 | { 12 | // Set size for collision capsule 13 | GetCapsuleComponent()->InitCapsuleSize(42.f, 96.f); 14 | 15 | // Mesh 16 | GetMesh()->SetRelativeLocation(FVector(0.f, 0.f, -96.f)); 17 | GetMesh()->SetRelativeRotation(FRotator(0.f, -90.f, 0.f)); 18 | 19 | static ConstructorHelpers::FObjectFinder SkeletalMeshObj(TEXT("/Game/Mannequin/Character/Mesh/SK_Mannequin")); 20 | if (SkeletalMeshObj.Object) 21 | { 22 | GetMesh()->SetSkeletalMesh(SkeletalMeshObj.Object, true); 23 | } 24 | 25 | static ConstructorHelpers::FClassFinder AnimClass(TEXT("/Game/Mannequin/Animations/ThirdPerson_AnimBP")); 26 | if (AnimClass.Class) 27 | { 28 | GetMesh()->AnimClass = AnimClass.Class; 29 | } 30 | 31 | // Configure character movement 32 | GetCharacterMovement()->GravityScale = 2.f; 33 | GetCharacterMovement()->AirControl = 0.8f; 34 | GetCharacterMovement()->JumpZVelocity = 1000.f; 35 | GetCharacterMovement()->GroundFriction = 3.f; 36 | GetCharacterMovement()->MaxWalkSpeed = 600.f; 37 | GetCharacterMovement()->MaxFlySpeed = 600.f; 38 | 39 | // Camera lag 40 | ACamVolCharacter::GetCameraComponent()->bEnableCameraLocationLag = true; 41 | ACamVolCharacter::GetCameraComponent()->CameraLocationLagSpeed = 5.f; 42 | ACamVolCharacter::GetCameraComponent()->bEnableCameraRotationLag = true; 43 | ACamVolCharacter::GetCameraComponent()->CameraRotationLagSpeed = 5.f; 44 | ACamVolCharacter::GetCameraComponent()->bEnableCameraFOVInterp = true; 45 | ACamVolCharacter::GetCameraComponent()->CameraFOVInterpSpeed = 5.f; 46 | } 47 | 48 | // Input 49 | void ACamVolCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) 50 | { 51 | // set up gameplay key bindings 52 | PlayerInputComponent->BindAxis("MoveRight", this, &ACamVolCharacter::MoveRight); 53 | PlayerInputComponent->BindAxis("MoveForward", this, &ACamVolCharacter::MoveForward); 54 | PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump); 55 | PlayerInputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping); 56 | PlayerInputComponent->BindTouch(IE_Pressed, this, &ACamVolCharacter::TouchStarted); 57 | PlayerInputComponent->BindTouch(IE_Released, this, &ACamVolCharacter::TouchStopped); 58 | } 59 | 60 | void ACamVolCharacter::MoveRight(float Value) 61 | { 62 | // add movement in that direction 63 | AddMovementInput(FVector(1.f, 0.f, 0.f), Value); 64 | } 65 | 66 | void ACamVolCharacter::MoveForward(float Value) 67 | { 68 | // add movement in that direction 69 | AddMovementInput(FVector(0.f, 1.f, 0.f), Value); 70 | } 71 | 72 | void ACamVolCharacter::TouchStarted(const ETouchIndex::Type FingerIndex, const FVector Location) 73 | { 74 | // jump on any touch 75 | Jump(); 76 | } 77 | 78 | void ACamVolCharacter::TouchStopped(const ETouchIndex::Type FingerIndex, const FVector Location) 79 | { 80 | StopJumping(); 81 | } 82 | -------------------------------------------------------------------------------- /Source/CamVol/CamVolCharacter.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "CameraVolumesCharacter.h" 5 | #include "CamVolCharacter.generated.h" 6 | 7 | UCLASS(Config = Game) 8 | class ACamVolCharacter : public ACameraVolumesCharacter 9 | { 10 | GENERATED_BODY() 11 | 12 | public: 13 | ACamVolCharacter(); 14 | 15 | protected: 16 | // Called for side to side input 17 | void MoveRight(float Val); 18 | 19 | // Called for front to back input 20 | void MoveForward(float Val); 21 | 22 | // Handle touch inputs 23 | void TouchStarted(const ETouchIndex::Type FingerIndex, const FVector Location); 24 | 25 | // Handle touch stop event 26 | void TouchStopped(const ETouchIndex::Type FingerIndex, const FVector Location); 27 | 28 | // Setup input 29 | virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override; 30 | }; 31 | -------------------------------------------------------------------------------- /Source/CamVol/CamVolExamplePawn.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "CamVolExamplePawn.h" 3 | #include "Components/InputComponent.h" 4 | #include "Components/CapsuleComponent.h" 5 | #include "Components/StaticMeshComponent.h" 6 | #include "Engine/CollisionProfile.h" 7 | #include "CameraVolumesCameraManager.h" 8 | #include "CameraVolumeActor.h" 9 | 10 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CamVolExamplePawn) 11 | 12 | ACamVolExamplePawn::ACamVolExamplePawn() 13 | { 14 | PrimaryActorTick.bCanEverTick = true; 15 | 16 | // Create collision capsule 17 | CapsuleComponent = CreateDefaultSubobject(TEXT("CapsuleComponent")); 18 | CapsuleComponent->InitCapsuleSize(50.0f, 50.0f); 19 | CapsuleComponent->SetCollisionProfileName(UCollisionProfile::Pawn_ProfileName); 20 | CapsuleComponent->CanCharacterStepUpOn = ECB_No; 21 | CapsuleComponent->SetShouldUpdatePhysicsVolume(true); 22 | CapsuleComponent->SetCanEverAffectNavigation(false); 23 | CapsuleComponent->bDynamicObstacle = true; 24 | CapsuleComponent->bHiddenInGame = false; 25 | RootComponent = CapsuleComponent; 26 | 27 | StaticMeshComponent = CreateDefaultSubobject(TEXT("StaticMeshComponent")); 28 | StaticMeshComponent->SetupAttachment(CapsuleComponent); 29 | StaticMeshComponent->SetCollisionEnabled(ECollisionEnabled::NoCollision); 30 | static ConstructorHelpers::FObjectFinder StaticMeshObj(TEXT("/Game/Geometry/Meshes/1M_Cube")); 31 | if (StaticMeshObj.Object) 32 | { 33 | StaticMeshComponent->SetStaticMesh(StaticMeshObj.Object); 34 | } 35 | 36 | // Create a camera 37 | CameraComponent = CreateDefaultSubobject(TEXT("Camera")); 38 | CameraComponent->bUsePawnControlRotation = false; // We don't want the controller rotating the camera 39 | CameraComponent->bEnableCameraLocationLag = true; 40 | } 41 | 42 | void ACamVolExamplePawn::PostInitializeComponents() 43 | { 44 | Super::PostInitializeComponents(); 45 | 46 | // Bind overlap events 47 | GetCollisionPrimitiveComponent()->OnComponentBeginOverlap.AddDynamic(this, &ACamVolExamplePawn::OnCollisionPrimitiveComponentBeginOverlap); 48 | GetCollisionPrimitiveComponent()->OnComponentEndOverlap.AddDynamic(this, &ACamVolExamplePawn::OnCollisionPrimitiveComponentEndOverlap); 49 | } 50 | 51 | void ACamVolExamplePawn::BeginPlay() 52 | { 53 | Super::BeginPlay(); 54 | } 55 | 56 | void ACamVolExamplePawn::Tick(float DeltaTime) 57 | { 58 | Super::Tick(DeltaTime); 59 | } 60 | 61 | void ACamVolExamplePawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent) 62 | { 63 | // set up gameplay key bindings 64 | PlayerInputComponent->BindAxis("MoveRight", this, &ACamVolExamplePawn::MoveRight); 65 | PlayerInputComponent->BindAxis("MoveForward", this, &ACamVolExamplePawn::MoveForward); 66 | PlayerInputComponent->BindAxis("MoveUp", this, &ACamVolExamplePawn::MoveUp); 67 | } 68 | 69 | void ACamVolExamplePawn::MoveRight(float Value) 70 | { 71 | // add offset in that direction 72 | AddActorLocalOffset(FVector(1.f, 0.f, 0.f) * Value * 5.f, true); 73 | } 74 | 75 | void ACamVolExamplePawn::MoveForward(float Value) 76 | { 77 | // add offset in that direction 78 | AddActorLocalOffset(FVector(0.f, 1.f, 0.f) * Value * 5.f, true); 79 | } 80 | 81 | void ACamVolExamplePawn::MoveUp(float Value) 82 | { 83 | // add offset in that direction 84 | AddActorLocalOffset(FVector(0.f, 0.f, 1.f) * Value * 5.f, true); 85 | } 86 | 87 | void ACamVolExamplePawn::OnCollisionPrimitiveComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) 88 | { 89 | if (ACameraVolumeActor* CameraVolume = Cast(OtherActor)) 90 | { 91 | if (GetCameraComponent()->OverlappingCameraVolumes.Num() == 0) 92 | { 93 | // Update camera volumes check condition in PlayerCameraManager 94 | if (APlayerController* PC = Cast(GetController())) 95 | { 96 | if (ACameraVolumesCameraManager* CameraVolumePCM = Cast(PC->PlayerCameraManager)) 97 | { 98 | CameraVolumePCM->SetProcessCameraVolumes(true); 99 | } 100 | } 101 | } 102 | 103 | GetCameraComponent()->OverlappingCameraVolumes.Emplace(CameraVolume); 104 | } 105 | } 106 | 107 | void ACamVolExamplePawn::OnCollisionPrimitiveComponentEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) 108 | { 109 | if (ACameraVolumeActor* CameraVolume = Cast(OtherActor)) 110 | { 111 | GetCameraComponent()->OverlappingCameraVolumes.Remove(CameraVolume); 112 | } 113 | } 114 | 115 | UCameraVolumesCameraComponent* ACamVolExamplePawn::GetCameraComponent() const 116 | { 117 | return CameraComponent; 118 | } 119 | 120 | UPrimitiveComponent* ACamVolExamplePawn::GetCollisionPrimitiveComponent() const 121 | { 122 | return CapsuleComponent; 123 | } 124 | -------------------------------------------------------------------------------- /Source/CamVol/CamVolExamplePawn.h: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * Example pawn support. 4 | * Unlike Character, Pawn doesn't have collision primitive to process BeginOverlap and EndOverlap events, so it should be added. 5 | */ 6 | 7 | #pragma once 8 | 9 | #include "GameFramework/Pawn.h" 10 | #include "CameraVolumesCharacterInterface.h" 11 | #include "CamVolExamplePawn.generated.h" 12 | 13 | UCLASS() 14 | class CAMVOL_API ACamVolExamplePawn : public APawn, public ICameraVolumesCharacterInterface 15 | { 16 | GENERATED_BODY() 17 | 18 | public: 19 | ACamVolExamplePawn(); 20 | virtual void PostInitializeComponents() override; 21 | virtual void Tick(float DeltaTime) override; 22 | virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override; 23 | virtual class UCameraVolumesCameraComponent* GetCameraComponent() const override; 24 | virtual class UPrimitiveComponent* GetCollisionPrimitiveComponent() const override; 25 | 26 | // Returns CapsuleComponent subobject 27 | FORCEINLINE class UCapsuleComponent* GetCapsuleComponent() const { return CapsuleComponent; } 28 | 29 | protected: 30 | virtual void BeginPlay() override; 31 | void MoveRight(float Val); 32 | void MoveForward(float Val); 33 | void MoveUp(float Val); 34 | 35 | // Camera component 36 | UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "CameraVolumes", Meta = (AllowPrivateAccess = "true")) 37 | class UCameraVolumesCameraComponent* CameraComponent; 38 | 39 | virtual void OnCollisionPrimitiveComponentBeginOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex, bool bFromSweep, const FHitResult& SweepResult) override; 40 | 41 | virtual void OnCollisionPrimitiveComponentEndOverlap(UPrimitiveComponent* OverlappedComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, int32 OtherBodyIndex) override; 42 | 43 | private: 44 | // The CapsuleComponent being used for movement collision (by CharacterMovement). Always treated as being vertically aligned in simple collision check functions. 45 | UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) 46 | UCapsuleComponent* CapsuleComponent; 47 | 48 | UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true")) 49 | UStaticMeshComponent* StaticMeshComponent; 50 | }; 51 | -------------------------------------------------------------------------------- /Source/CamVol/CamVolGameMode.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "CamVolGameMode.h" 3 | #include "CamVolCharacter.h" 4 | #include "CamVolPlayerController.h" 5 | 6 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CamVolGameMode) 7 | 8 | ACamVolGameMode::ACamVolGameMode() 9 | { 10 | DefaultPawnClass = ACamVolCharacter::StaticClass(); 11 | PlayerControllerClass = ACamVolPlayerController::StaticClass(); 12 | } 13 | -------------------------------------------------------------------------------- /Source/CamVol/CamVolGameMode.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "GameFramework/GameModeBase.h" 5 | #include "CamVolGameMode.generated.h" 6 | 7 | UCLASS(minimalapi) 8 | class ACamVolGameMode : public AGameModeBase 9 | { 10 | GENERATED_BODY() 11 | 12 | public: 13 | ACamVolGameMode(); 14 | }; 15 | -------------------------------------------------------------------------------- /Source/CamVol/CamVolPaperCharacter.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "CamVolPaperCharacter.h" 3 | #include "Components/CapsuleComponent.h" 4 | #include "Components/InputComponent.h" 5 | #include "GameFramework/CharacterMovementComponent.h" 6 | #include "GameFramework/Controller.h" 7 | 8 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CamVolPaperCharacter) 9 | 10 | ACamVolPaperCharacter::ACamVolPaperCharacter() 11 | { 12 | // Set the size of our collision capsule. 13 | GetCapsuleComponent()->SetCapsuleHalfHeight(96.f); 14 | GetCapsuleComponent()->SetCapsuleRadius(40.f); 15 | 16 | // Flipbooks 17 | static ConstructorHelpers::FObjectFinder IdleAnimationObj(TEXT("/Game/2DSideScroller/Sprites/IdleAnimation.IdleAnimation")); 18 | if (IdleAnimationObj.Object) 19 | { 20 | IdleAnimation = IdleAnimationObj.Object; 21 | } 22 | 23 | static ConstructorHelpers::FObjectFinder RunningAnimationObj(TEXT("/Game/2DSideScroller/Sprites/RunningAnimation.RunningAnimation")); 24 | if (RunningAnimationObj.Object) 25 | { 26 | RunningAnimation = RunningAnimationObj.Object; 27 | } 28 | 29 | GetSprite()->SetFlipbook(IdleAnimation); 30 | 31 | // Configure character movement 32 | GetCharacterMovement()->GravityScale = 2.f; 33 | GetCharacterMovement()->AirControl = 0.8f; 34 | GetCharacterMovement()->JumpZVelocity = 1000.f; 35 | GetCharacterMovement()->GroundFriction = 3.f; 36 | GetCharacterMovement()->MaxWalkSpeed = 600.f; 37 | GetCharacterMovement()->MaxFlySpeed = 600.f; 38 | GetCharacterMovement()->bConstrainToPlane = true; 39 | GetCharacterMovement()->SetPlaneConstraintNormal(FVector(0.f, -1.f, 0.f)); 40 | 41 | // Behave like a traditional 2D platformer character, with a flat bottom instead of a curved capsule bottom 42 | // Note: This can cause a little floating when going up inclines; you can choose the tradeoff between better 43 | // behavior on the edge of a ledge versus inclines by setting this to true or false 44 | GetCharacterMovement()->bUseFlatBaseForFloorChecks = true; 45 | 46 | // Enable replication on the Sprite component so animations show up when networked 47 | GetSprite()->SetIsReplicated(true); 48 | bReplicates = true; 49 | 50 | // Orthographic camera 51 | ACamVolPaperCharacter::GetCameraComponent()->ProjectionMode = ECameraProjectionMode::Orthographic; 52 | ACamVolPaperCharacter::GetCameraComponent()->OrthoWidth = 2048.f; 53 | 54 | // Camera lag 55 | ACamVolPaperCharacter::GetCameraComponent()->bEnableCameraLocationLag = true; 56 | ACamVolPaperCharacter::GetCameraComponent()->CameraLocationLagSpeed = 5.f; 57 | ACamVolPaperCharacter::GetCameraComponent()->bEnableCameraRotationLag = true; 58 | ACamVolPaperCharacter::GetCameraComponent()->CameraRotationLagSpeed = 5.f; 59 | ACamVolPaperCharacter::GetCameraComponent()->bEnableCameraOrthoWidthInterp = true; 60 | ACamVolPaperCharacter::GetCameraComponent()->CameraOrthoWidthInterpSpeed = 5.f; 61 | } 62 | 63 | // Animation 64 | void ACamVolPaperCharacter::UpdateAnimation() 65 | { 66 | const FVector PlayerVelocity = GetVelocity(); 67 | const float PlayerSpeedSqr = PlayerVelocity.SizeSquared(); 68 | 69 | // Are we moving or standing still? 70 | UPaperFlipbook* DesiredAnimation = (PlayerSpeedSqr > 0.0f) ? RunningAnimation : IdleAnimation; 71 | if(GetSprite()->GetFlipbook() != DesiredAnimation) 72 | { 73 | GetSprite()->SetFlipbook(DesiredAnimation); 74 | } 75 | } 76 | 77 | void ACamVolPaperCharacter::Tick(float DeltaSeconds) 78 | { 79 | Super::Tick(DeltaSeconds); 80 | UpdateCharacter(); 81 | } 82 | 83 | // Input 84 | void ACamVolPaperCharacter::SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) 85 | { 86 | PlayerInputComponent->BindAction("Jump", IE_Pressed, this, &ACharacter::Jump); 87 | PlayerInputComponent->BindAction("Jump", IE_Released, this, &ACharacter::StopJumping); 88 | PlayerInputComponent->BindAxis("MoveRight", this, &ACamVolPaperCharacter::MoveRight); 89 | PlayerInputComponent->BindTouch(IE_Pressed, this, &ACamVolPaperCharacter::TouchStarted); 90 | PlayerInputComponent->BindTouch(IE_Released, this, &ACamVolPaperCharacter::TouchStopped); 91 | } 92 | 93 | void ACamVolPaperCharacter::MoveRight(float Value) 94 | { 95 | // Apply the input to the character motion 96 | AddMovementInput(FVector(1.f, 0.f, 0.f), Value); 97 | } 98 | 99 | void ACamVolPaperCharacter::TouchStarted(const ETouchIndex::Type FingerIndex, const FVector Location) 100 | { 101 | // jump on any touch 102 | Jump(); 103 | } 104 | 105 | void ACamVolPaperCharacter::TouchStopped(const ETouchIndex::Type FingerIndex, const FVector Location) 106 | { 107 | StopJumping(); 108 | } 109 | 110 | void ACamVolPaperCharacter::UpdateCharacter() 111 | { 112 | // Update animation to match the motion 113 | UpdateAnimation(); 114 | 115 | // Now setup the rotation of the controller based on the direction we are travelling 116 | const FVector PlayerVelocity = GetVelocity(); 117 | const float TravelDirection = PlayerVelocity.X; 118 | 119 | // Set the rotation so that the character faces his direction of travel. 120 | if (Controller) 121 | { 122 | if (TravelDirection > 0.f) 123 | { 124 | Controller->SetControlRotation(FRotator(0.f, 0.f, 0.f)); 125 | } 126 | else if (TravelDirection < 0.f) 127 | { 128 | Controller->SetControlRotation(FRotator(0.f, 180.f, 0.f)); 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /Source/CamVol/CamVolPaperCharacter.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "CameraVolumesPaperCharacter.h" 5 | #include "PaperFlipbook.h" 6 | #include "PaperFlipbookComponent.h" 7 | #include "CamVolPaperCharacter.generated.h" 8 | 9 | UCLASS(Config = Game) 10 | class ACamVolPaperCharacter : public ACameraVolumesPaperCharacter 11 | { 12 | GENERATED_BODY() 13 | 14 | public: 15 | ACamVolPaperCharacter(); 16 | virtual void Tick(float DeltaSeconds) override; 17 | 18 | protected: 19 | // The animation to play while running around 20 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Animations") 21 | class UPaperFlipbook* RunningAnimation; 22 | 23 | // The animation to play while idle (standing still) 24 | UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Animations") 25 | class UPaperFlipbook* IdleAnimation; 26 | 27 | // Called to choose the correct animation to play based on the character's movement state 28 | void UpdateAnimation(); 29 | 30 | // Called for side to side input 31 | void MoveRight(float Value); 32 | 33 | // Handle touch inputs. 34 | void TouchStarted(const ETouchIndex::Type FingerIndex, const FVector Location); 35 | 36 | // Handle touch stop event. 37 | void TouchStopped(const ETouchIndex::Type FingerIndex, const FVector Location); 38 | 39 | // APawn interface 40 | virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override; 41 | // End of APawn interface 42 | 43 | void UpdateCharacter(); 44 | }; 45 | -------------------------------------------------------------------------------- /Source/CamVol/CamVolPlayerController.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "CamVolPlayerController.h" 3 | #include "CameraVolumesCameraManager.h" 4 | 5 | #include UE_INLINE_GENERATED_CPP_BY_NAME(CamVolPlayerController) 6 | 7 | ACamVolPlayerController::ACamVolPlayerController() 8 | { 9 | PlayerCameraManagerClass = ACameraVolumesCameraManager::StaticClass(); 10 | } 11 | -------------------------------------------------------------------------------- /Source/CamVol/CamVolPlayerController.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "GameFramework/PlayerController.h" 5 | #include "CamVolPlayerController.generated.h" 6 | 7 | UCLASS() 8 | class ACamVolPlayerController : public APlayerController 9 | { 10 | GENERATED_BODY() 11 | 12 | public: 13 | ACamVolPlayerController(); 14 | }; 15 | -------------------------------------------------------------------------------- /Source/CamVolEditor.Target.cs: -------------------------------------------------------------------------------- 1 | 2 | using UnrealBuildTool; 3 | using System.Collections.Generic; 4 | 5 | public class CamVolEditorTarget : TargetRules 6 | { 7 | public CamVolEditorTarget(TargetInfo Target) : base(Target) 8 | { 9 | Type = TargetType.Editor; 10 | DefaultBuildSettings = BuildSettingsVersion.Latest; 11 | IncludeOrderVersion = EngineIncludeOrderVersion.Latest; 12 | ExtraModuleNames.Add("CamVol"); 13 | } 14 | } 15 | --------------------------------------------------------------------------------