Initial commit
This commit is contained in:
commit
93926be25b
5
.gitignore
vendored
Normal file
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
.vs/
|
||||
Binaries/
|
||||
enc_temp_folder/
|
||||
Intermediate/
|
||||
Saved/
|
7
Config/Android/AndroidEngine.ini
Executable file
7
Config/Android/AndroidEngine.ini
Executable file
@ -0,0 +1,7 @@
|
||||
[/Script/AndroidRuntimeSettings.AndroidRuntimeSettings]
|
||||
;AudioSampleRate=48000
|
||||
AudioMaxChannels=12
|
||||
;AudioCallbackBufferFrameSize=1024
|
||||
;AudioNumBuffersToEnqueue=2
|
||||
;AudioNumSourceWorkers=0
|
||||
|
0
Config/DefaultEditor.ini
Executable file
0
Config/DefaultEditor.ini
Executable file
12
Config/DefaultEngine.ini
Executable file
12
Config/DefaultEngine.ini
Executable file
@ -0,0 +1,12 @@
|
||||
[/Script/Engine.RendererSettings]
|
||||
r.DefaultFeature.AutoExposure.ExtendDefaultLuminanceRange=True
|
||||
|
||||
[/Script/HardwareTargeting.HardwareTargetingSettings]
|
||||
TargetedHardwareClass=Desktop
|
||||
AppliedTargetedHardwareClass=Desktop
|
||||
DefaultGraphicsPerformance=Maximum
|
||||
AppliedDefaultGraphicsPerformance=Maximum
|
||||
|
||||
[/Script/EngineSettings.GameMapsSettings]
|
||||
GlobalDefaultGameMode=/Game/GameModeBase_BP.GameModeBase_BP_C
|
||||
|
2
Config/DefaultGame.ini
Executable file
2
Config/DefaultGame.ini
Executable file
@ -0,0 +1,2 @@
|
||||
[/Script/EngineSettings.GeneralProjectSettings]
|
||||
ProjectID=ACC4683049BAA83CD626BA81B3543C3D
|
94
Config/DefaultInput.ini
Executable file
94
Config/DefaultInput.ini
Executable file
@ -0,0 +1,94 @@
|
||||
|
||||
[/Script/Engine.InputSettings]
|
||||
+AxisConfig=(AxisKeyName="Gamepad_LeftX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_LeftY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_RightX",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_RightY",AxisProperties=(DeadZone=0.250000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MouseX",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MouseY",AxisProperties=(DeadZone=0.000000,Sensitivity=0.070000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MouseWheelAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_LeftTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_RightTriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MotionController_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MotionController_Left_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MotionController_Left_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MotionController_Left_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MotionController_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MotionController_Right_TriggerAxis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MotionController_Right_Grip1Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MotionController_Right_Grip2Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Gamepad_Special_Left_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Daydream_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Daydream_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Daydream_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Daydream_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Vive_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Vive_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Vive_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="Vive_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MixedReality_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MixedReality_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MixedReality_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MixedReality_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MixedReality_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="MixedReality_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusGo_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusGo_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusGo_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusGo_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusTouch_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusTouch_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusTouch_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusTouch_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusTouch_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="OculusTouch_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Left_Trackpad_Touch",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Grip_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trigger_Axis",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Thumbstick_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_X",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Y",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
+AxisConfig=(AxisKeyName="ValveIndex_Right_Trackpad_Force",AxisProperties=(DeadZone=0.000000,Sensitivity=1.000000,Exponent=1.000000,bInvert=False))
|
||||
bAltEnterTogglesFullscreen=True
|
||||
bF11TogglesFullscreen=True
|
||||
bUseMouseForTouch=False
|
||||
bEnableMouseSmoothing=True
|
||||
bEnableFOVScaling=True
|
||||
bCaptureMouseOnLaunch=True
|
||||
bAlwaysShowTouchInterface=False
|
||||
bShowConsoleOnFourFingerTap=True
|
||||
bEnableGestureRecognizer=False
|
||||
bUseAutocorrect=False
|
||||
DefaultViewportMouseCaptureMode=CapturePermanently_IncludingInitialMouseDown
|
||||
DefaultViewportMouseLockMode=LockOnCapture
|
||||
FOVScale=0.011110
|
||||
DoubleClickTime=0.200000
|
||||
+AxisMappings=(AxisName="MoveForward",Scale=1.000000,Key=W)
|
||||
+AxisMappings=(AxisName="MoveForward",Scale=-1.000000,Key=S)
|
||||
+AxisMappings=(AxisName="MoveRight",Scale=1.000000,Key=D)
|
||||
+AxisMappings=(AxisName="MoveRight",Scale=-1.000000,Key=A)
|
||||
DefaultTouchInterface=/Engine/MobileResources/HUD/DefaultVirtualJoysticks.DefaultVirtualJoysticks
|
||||
+ConsoleKeys=Tilde
|
||||
|
||||
|
7
Config/IOS/IOSEngine.ini
Executable file
7
Config/IOS/IOSEngine.ini
Executable file
@ -0,0 +1,7 @@
|
||||
[/Script/IOSRuntimeSettings.IOSRuntimeSettings]
|
||||
;AudioSampleRate=48000
|
||||
AudioMaxChannels=16
|
||||
;AudioCallbackBufferFrameSize=1024
|
||||
;AudioNumBuffersToEnqueue=2
|
||||
;AudioNumSourceWorkers=0
|
||||
|
7
Config/Linux/LinuxEngine.ini
Executable file
7
Config/Linux/LinuxEngine.ini
Executable file
@ -0,0 +1,7 @@
|
||||
[/Script/LinuxTargetPlatform.LinuxTargetSettings]
|
||||
;AudioSampleRate=48000
|
||||
AudioMaxChannels=16
|
||||
;AudioCallbackBufferFrameSize=1024
|
||||
;AudioNumBuffersToEnqueue=2
|
||||
;AudioNumSourceWorkers=0
|
||||
|
7
Config/Mac/MacEngine.ini
Executable file
7
Config/Mac/MacEngine.ini
Executable file
@ -0,0 +1,7 @@
|
||||
[/Script/MacTargetPlatform.MacTargetSettings]
|
||||
;AudioSampleRate=48000
|
||||
;AudioMaxChannels=32
|
||||
;AudioCallbackBufferFrameSize=1024
|
||||
;AudioNumBuffersToEnqueue=2
|
||||
;AudioNumSourceWorkers=0
|
||||
|
7
Config/PS4/PS4Engine.ini
Executable file
7
Config/PS4/PS4Engine.ini
Executable file
@ -0,0 +1,7 @@
|
||||
[/Script/PS4PlatformEditor.PS4TargetSettings]
|
||||
;AudioSampleRate=48000
|
||||
;AudioMaxChannels=32
|
||||
AudioCallbackBufferFrameSize=256
|
||||
AudioNumBuffersToEnqueue=7
|
||||
AudioNumSourceWorkers=4
|
||||
|
7
Config/Switch/SwitchEngine.ini
Executable file
7
Config/Switch/SwitchEngine.ini
Executable file
@ -0,0 +1,7 @@
|
||||
[/Script/SwitchRuntimeSettings.SwitchRuntimeSettings]
|
||||
;AudioSampleRate=48000
|
||||
AudioMaxChannels=16
|
||||
;AudioCallbackBufferFrameSize=1024
|
||||
;AudioNumBuffersToEnqueue=2
|
||||
;AudioNumSourceWorkers=0
|
||||
|
7
Config/Windows/WindowsEngine.ini
Executable file
7
Config/Windows/WindowsEngine.ini
Executable file
@ -0,0 +1,7 @@
|
||||
[/Script/WindowsTargetPlatform.WindowsTargetSettings]
|
||||
;AudioSampleRate=48000
|
||||
;AudioMaxChannels=32
|
||||
AudioCallbackBufferFrameSize=256
|
||||
AudioNumBuffersToEnqueue=7
|
||||
;AudioNumSourceWorkers=0
|
||||
|
7
Config/XboxOne/XboxOneEngine.ini
Executable file
7
Config/XboxOne/XboxOneEngine.ini
Executable file
@ -0,0 +1,7 @@
|
||||
[/Script/XboxOnePlatformEditor.XboxOneTargetSettings]
|
||||
;AudioSampleRate=48000
|
||||
;AudioMaxChannels=32
|
||||
AudioCallbackBufferFrameSize=256
|
||||
AudioNumBuffersToEnqueue=7
|
||||
;AudioNumSourceWorkers=0
|
||||
|
BIN
Content/BasePawn_BP.uasset
Executable file
BIN
Content/BasePawn_BP.uasset
Executable file
Binary file not shown.
BIN
Content/GameModeBase_BP.uasset
Executable file
BIN
Content/GameModeBase_BP.uasset
Executable file
Binary file not shown.
BIN
Content/PlayerMaterial.uasset
Executable file
BIN
Content/PlayerMaterial.uasset
Executable file
Binary file not shown.
BIN
Content/RoadMaterial.uasset
Executable file
BIN
Content/RoadMaterial.uasset
Executable file
Binary file not shown.
BIN
Content/TestMap.umap
Executable file
BIN
Content/TestMap.umap
Executable file
Binary file not shown.
BIN
Content/TestMap_BuiltData.uasset
Executable file
BIN
Content/TestMap_BuiltData.uasset
Executable file
Binary file not shown.
87
PresidentsBrigade.sln
Executable file
87
PresidentsBrigade.sln
Executable file
@ -0,0 +1,87 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28315.86
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{417AE356-0628-4071-8D33-40C078947CC9}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Games", "Games", "{CDA30B7C-8F9F-48AB-A6AA-CB3B41DCE083}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PresidentsBrigade", "Intermediate\ProjectFiles\PresidentsBrigade.vcxproj", "{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UE4", "Intermediate\ProjectFiles\UE4.vcxproj", "{B0F8FF12-D021-4217-B1B9-F5627A14FB59}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Visualizers", "Visualizers", "{1AC9C2E0-EF4E-4F8C-9F40-1C4BD6DECBCB}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
D:\Games\Epic Games\UE_4.24\Engine\Extras\VisualStudioDebugging\UE4.natvis = D:\Games\Epic Games\UE_4.24\Engine\Extras\VisualStudioDebugging\UE4.natvis
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
DebugGame Editor|Android = DebugGame Editor|Android
|
||||
DebugGame Editor|Win32 = DebugGame Editor|Win32
|
||||
DebugGame Editor|Win64 = DebugGame Editor|Win64
|
||||
DebugGame|Android = DebugGame|Android
|
||||
DebugGame|Win32 = DebugGame|Win32
|
||||
DebugGame|Win64 = DebugGame|Win64
|
||||
Development Editor|Android = Development Editor|Android
|
||||
Development Editor|Win32 = Development Editor|Win32
|
||||
Development Editor|Win64 = Development Editor|Win64
|
||||
Development|Android = Development|Android
|
||||
Development|Win32 = Development|Win32
|
||||
Development|Win64 = Development|Win64
|
||||
Shipping|Android = Shipping|Android
|
||||
Shipping|Win32 = Shipping|Win32
|
||||
Shipping|Win64 = Shipping|Win64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame Editor|Android.ActiveCfg = Invalid|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame Editor|Win32.ActiveCfg = Invalid|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame Editor|Win64.ActiveCfg = DebugGame_Editor|x64
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame Editor|Win64.Build.0 = DebugGame_Editor|x64
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Android.ActiveCfg = Android_DebugGame|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Android.Build.0 = Android_DebugGame|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Win32.ActiveCfg = DebugGame|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Win32.Build.0 = DebugGame|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Win64.ActiveCfg = DebugGame|x64
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.DebugGame|Win64.Build.0 = DebugGame|x64
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development Editor|Android.ActiveCfg = Invalid|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development Editor|Win32.ActiveCfg = Invalid|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development Editor|Win64.ActiveCfg = Development_Editor|x64
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development Editor|Win64.Build.0 = Development_Editor|x64
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Android.ActiveCfg = Android_Development|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Android.Build.0 = Android_Development|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Win32.ActiveCfg = Development|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Win32.Build.0 = Development|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Win64.ActiveCfg = Development|x64
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Development|Win64.Build.0 = Development|x64
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Android.ActiveCfg = Android_Shipping|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Android.Build.0 = Android_Shipping|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Win32.ActiveCfg = Shipping|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Win32.Build.0 = Shipping|Win32
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Win64.ActiveCfg = Shipping|x64
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}.Shipping|Win64.Build.0 = Shipping|x64
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame Editor|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame Editor|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.DebugGame|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development Editor|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development Editor|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Development|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Shipping|Android.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Shipping|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59}.Shipping|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{B0F8FF12-D021-4217-B1B9-F5627A14FB59} = {417AE356-0628-4071-8D33-40C078947CC9}
|
||||
{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B} = {CDA30B7C-8F9F-48AB-A6AA-CB3B41DCE083}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
16
PresidentsBrigade.uproject
Executable file
16
PresidentsBrigade.uproject
Executable file
@ -0,0 +1,16 @@
|
||||
{
|
||||
"FileVersion": 3,
|
||||
"EngineAssociation": "4.24",
|
||||
"Category": "",
|
||||
"Description": "",
|
||||
"Modules": [
|
||||
{
|
||||
"Name": "PresidentsBrigade",
|
||||
"Type": "Runtime",
|
||||
"LoadingPhase": "Default",
|
||||
"AdditionalDependencies": [
|
||||
"Engine"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
15
Source/PresidentsBrigade.Target.cs
Executable file
15
Source/PresidentsBrigade.Target.cs
Executable file
@ -0,0 +1,15 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
using UnrealBuildTool;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class PresidentsBrigadeTarget : TargetRules
|
||||
{
|
||||
public PresidentsBrigadeTarget(TargetInfo Target) : base(Target)
|
||||
{
|
||||
Type = TargetType.Game;
|
||||
DefaultBuildSettings = BuildSettingsVersion.V2;
|
||||
|
||||
ExtraModuleNames.AddRange( new string[] { "PresidentsBrigade" } );
|
||||
}
|
||||
}
|
122
Source/PresidentsBrigade/BasePawn.cpp
Executable file
122
Source/PresidentsBrigade/BasePawn.cpp
Executable file
@ -0,0 +1,122 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "BasePawn.h"
|
||||
#include "Camera/CameraComponent.h"
|
||||
#include "Components/StaticMeshComponent.h"
|
||||
|
||||
// Sets default values
|
||||
ABasePawn::ABasePawn(const FObjectInitializer &object_initializer):
|
||||
APawn(object_initializer)
|
||||
{
|
||||
// Create default components.
|
||||
root_component = object_initializer.CreateDefaultSubobject<USceneComponent>(this, FName("Root"));
|
||||
main_camera = object_initializer.CreateDefaultSubobject<UCameraComponent>(this, FName("MainCamera"));
|
||||
player_mesh = object_initializer.CreateDefaultSubobject<UStaticMeshComponent>(this, FName("PlayerMesh"));
|
||||
movement_component = object_initializer.CreateDefaultSubobject<UFloatingPawnMovement>(this, FName("MovementComponent"));
|
||||
|
||||
// Setup component hierarchy.
|
||||
RootComponent = root_component;
|
||||
main_camera->SetupAttachment(root_component);
|
||||
player_mesh->SetupAttachment(root_component);
|
||||
movement_component->UpdatedComponent = player_mesh;
|
||||
|
||||
PrimaryActorTick.bCanEverTick = true;
|
||||
|
||||
// Set defaults.
|
||||
accel_max_time = 0.25;
|
||||
horizontal_speed_max = 100;
|
||||
vertical_speed_max = 100;
|
||||
}
|
||||
|
||||
// Called when the game starts or when spawned
|
||||
void ABasePawn::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
|
||||
}
|
||||
|
||||
UPawnMovementComponent* ABasePawn::GetMovementComponent() const
|
||||
{
|
||||
return movement_component;
|
||||
}
|
||||
|
||||
// Called every frame
|
||||
void ABasePawn::Tick(float DeltaTime)
|
||||
{
|
||||
Super::Tick(DeltaTime);
|
||||
|
||||
// Move the player.
|
||||
//vertical_speed = vertical_accel.update(DeltaTime);
|
||||
//horizontal_speed = horizontal_accel.update(DeltaTime);
|
||||
|
||||
//// "X" is up, "Y" is right.
|
||||
//const FVector location = player_mesh->GetComponentLocation();
|
||||
//const float new_vertical = (DeltaTime * vertical_speed) + location.X;
|
||||
//const float new_horizontal = (DeltaTime * horizontal_speed) + location.Y;
|
||||
//player_mesh->SetWorldLocation(FVector(new_vertical, new_horizontal, location.Z));
|
||||
}
|
||||
|
||||
// Called to bind functionality to input
|
||||
void ABasePawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||||
{
|
||||
Super::SetupPlayerInputComponent(PlayerInputComponent);
|
||||
|
||||
//PlayerInputComponent->BindAction<FMovementDelegate>("MoveUp", EInputEvent::IE_Pressed, this, &ABasePawn::handle_move_input, movement_t::UP, 1);
|
||||
//PlayerInputComponent->BindAction<FMovementDelegate>("MoveUp", EInputEvent::IE_Released, this, &ABasePawn::handle_move_input, movement_t::UP, 0);
|
||||
|
||||
//PlayerInputComponent->BindAction<FMovementDelegate>("MoveDown", EInputEvent::IE_Pressed, this, &ABasePawn::handle_move_input, movement_t::DOWN, -1);
|
||||
//PlayerInputComponent->BindAction<FMovementDelegate>("MoveDown", EInputEvent::IE_Released, this, &ABasePawn::handle_move_input, movement_t::DOWN, 0);
|
||||
|
||||
//PlayerInputComponent->BindAction<FMovementDelegate>("MoveRight", EInputEvent::IE_Pressed, this, &ABasePawn::handle_move_input, movement_t::RIGHT, 1);
|
||||
//PlayerInputComponent->BindAction<FMovementDelegate>("MoveRight", EInputEvent::IE_Released, this, &ABasePawn::handle_move_input, movement_t::RIGHT, 0);
|
||||
|
||||
//PlayerInputComponent->BindAction<FMovementDelegate>("MoveLeft", EInputEvent::IE_Pressed, this, &ABasePawn::handle_move_input, movement_t::LEFT, -1);
|
||||
//PlayerInputComponent->BindAction<FMovementDelegate>("MoveLeft", EInputEvent::IE_Released, this, &ABasePawn::handle_move_input, movement_t::LEFT, 0);
|
||||
|
||||
PlayerInputComponent->BindAxis("MoveForward", this, &ABasePawn::handle_move_forward);
|
||||
PlayerInputComponent->BindAxis("MoveRight", this, &ABasePawn::handle_move_right);
|
||||
}
|
||||
|
||||
void ABasePawn::handle_move_forward(float axis)
|
||||
{
|
||||
FRotator rotation = Controller->GetControlRotation();
|
||||
FRotator yaw(0.0f, rotation.Yaw, 0.0f);
|
||||
|
||||
FVector forward = FRotationMatrix(yaw).GetUnitAxis(EAxis::X);
|
||||
AddMovementInput(forward, axis);
|
||||
}
|
||||
|
||||
void ABasePawn::handle_move_right(float axis)
|
||||
{
|
||||
FRotator rotation = Controller->GetControlRotation();
|
||||
FRotator yaw(0.0f, rotation.Yaw, 0.0f);
|
||||
|
||||
FVector right = FRotationMatrix(yaw).GetUnitAxis(EAxis::Y);
|
||||
AddMovementInput(right, axis);
|
||||
}
|
||||
//void ABasePawn::handle_move_input(const movement_t move_type, const int direction)
|
||||
//{
|
||||
// if (move_type == movement_t::UP || move_type == movement_t::DOWN)
|
||||
// {
|
||||
// // Prevent two vertical inputs entered at the same time.
|
||||
// if (vertical_accel.end != 0 && direction != 0)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// const float new_speed = direction * vertical_speed_max;
|
||||
// vertical_accel.set(vertical_speed, new_speed, accel_max_time);
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // Prevent two horizontal inputs entered at the same time.
|
||||
// if (horizontal_accel.end != 0 && direction != 0)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// const float new_speed = direction * horizontal_speed_max;
|
||||
// horizontal_accel.set(horizontal_speed, new_speed, accel_max_time);
|
||||
// }
|
||||
//}
|
107
Source/PresidentsBrigade/BasePawn.h
Executable file
107
Source/PresidentsBrigade/BasePawn.h
Executable file
@ -0,0 +1,107 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Pawn.h"
|
||||
#include "Kismet/KismetMathLibrary.h"
|
||||
#include "GameFramework/CharacterMovementComponent.h"
|
||||
#include "GameFramework/FloatingPawnMovement.h"
|
||||
#include "BasePawn.generated.h"
|
||||
|
||||
class UCameraComponent;
|
||||
|
||||
//enum movement_t : uint8
|
||||
//{
|
||||
// UP,
|
||||
// DOWN,
|
||||
// LEFT,
|
||||
// RIGHT
|
||||
//};
|
||||
|
||||
UCLASS()
|
||||
class PRESIDENTSBRIGADE_API ABasePawn : public APawn
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
// Sets default values for this pawn's properties
|
||||
ABasePawn(const FObjectInitializer &object_initializer);
|
||||
|
||||
// Called every frame
|
||||
virtual void Tick(float DeltaTime) override;
|
||||
|
||||
// Called to bind functionality to input
|
||||
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
|
||||
protected:
|
||||
// Called when the game starts or when spawned
|
||||
virtual void BeginPlay() override;
|
||||
|
||||
virtual UPawnMovementComponent* GetMovementComponent() const;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="Player")
|
||||
UCameraComponent* main_camera;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="Player")
|
||||
UStaticMeshComponent* player_mesh;
|
||||
|
||||
UPROPERTY(EditAnywhere, Category="Player")
|
||||
UFloatingPawnMovement* movement_component;
|
||||
|
||||
// Accel max time.
|
||||
UPROPERTY(EditDefaultsOnly, Category="Gameplay")
|
||||
float accel_max_time;
|
||||
|
||||
// Maximum horizontal speed.
|
||||
UPROPERTY(EditDefaultsOnly, Category="Gameplay")
|
||||
float horizontal_speed_max;
|
||||
|
||||
// Maximum vertical speed.
|
||||
UPROPERTY(EditDefaultsOnly, Category="Gameplay")
|
||||
float vertical_speed_max;
|
||||
|
||||
private:
|
||||
struct AccelerationAnim
|
||||
{
|
||||
float start;
|
||||
float end;
|
||||
float max_time;
|
||||
|
||||
float time_elapsed;
|
||||
|
||||
void set(float _start, float _end, float _max_time)
|
||||
{
|
||||
start = _start;
|
||||
end = _end;
|
||||
max_time = _max_time;
|
||||
time_elapsed = 0;
|
||||
};
|
||||
|
||||
float update(const float delta_time)
|
||||
{
|
||||
float percentage = time_elapsed / max_time;
|
||||
|
||||
// Animation is complete.
|
||||
if (time_elapsed > max_time)
|
||||
{
|
||||
percentage = 1;
|
||||
}
|
||||
|
||||
time_elapsed += delta_time;
|
||||
return UKismetMathLibrary::Lerp(start, end, percentage);
|
||||
};
|
||||
};
|
||||
|
||||
USceneComponent* root_component;
|
||||
|
||||
// DECLARE_DELEGATE_TwoParams(FMovementDelegate, const movement_t, const int);
|
||||
// void handle_move_input(const movement_t move_type, const int direction);
|
||||
void handle_move_right(float axis);
|
||||
void handle_move_forward(float axis);
|
||||
|
||||
float horizontal_speed;
|
||||
float vertical_speed;
|
||||
|
||||
AccelerationAnim horizontal_accel;
|
||||
AccelerationAnim vertical_accel;
|
||||
};
|
201
Source/PresidentsBrigade/MyDefaultPawn.cpp
Executable file
201
Source/PresidentsBrigade/MyDefaultPawn.cpp
Executable file
@ -0,0 +1,201 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
#include "MyDefaultPawn.h"
|
||||
|
||||
#include "UObject/ConstructorHelpers.h"
|
||||
#include "Engine/World.h"
|
||||
#include "Components/StaticMeshComponent.h"
|
||||
#include "GameFramework/PlayerController.h"
|
||||
#include "Engine/CollisionProfile.h"
|
||||
#include "Engine/StaticMesh.h"
|
||||
#include "Components/SphereComponent.h"
|
||||
#include "GameFramework/PawnMovementComponent.h"
|
||||
#include "GameFramework/FloatingPawnMovement.h"
|
||||
#include "GameFramework/CharacterMovementComponent.h"
|
||||
#include "GameFramework/PlayerInput.h"
|
||||
|
||||
FName AMyDefaultPawn::MovementComponentName(TEXT("MovementComponent0"));
|
||||
FName AMyDefaultPawn::CollisionComponentName(TEXT("CollisionComponent0"));
|
||||
FName AMyDefaultPawn::MeshComponentName(TEXT("MeshComponent0"));
|
||||
|
||||
|
||||
AMyDefaultPawn::AMyDefaultPawn(const FObjectInitializer& ObjectInitializer) : APawn(ObjectInitializer)
|
||||
{
|
||||
SetCanBeDamaged(true);
|
||||
|
||||
SetRemoteRoleForBackwardsCompat(ROLE_SimulatedProxy);
|
||||
bReplicates = true;
|
||||
NetPriority = 3.0f;
|
||||
|
||||
BaseEyeHeight = 0.0f;
|
||||
bCollideWhenPlacing = false;
|
||||
SpawnCollisionHandlingMethod = ESpawnActorCollisionHandlingMethod::AlwaysSpawn;
|
||||
|
||||
CollisionComponent = CreateDefaultSubobject<USphereComponent>(AMyDefaultPawn::CollisionComponentName);
|
||||
CollisionComponent->InitSphereRadius(35.0f);
|
||||
CollisionComponent->SetCollisionProfileName(UCollisionProfile::Pawn_ProfileName);
|
||||
|
||||
CollisionComponent->CanCharacterStepUpOn = ECB_No;
|
||||
CollisionComponent->SetShouldUpdatePhysicsVolume(true);
|
||||
CollisionComponent->SetCanEverAffectNavigation(false);
|
||||
CollisionComponent->bDynamicObstacle = true;
|
||||
|
||||
RootComponent = CollisionComponent;
|
||||
|
||||
MovementComponent = CreateDefaultSubobject<UPawnMovementComponent, UCharacterMovementComponent>(AMyDefaultPawn::MovementComponentName);
|
||||
MovementComponent->UpdatedComponent = CollisionComponent;
|
||||
|
||||
// Structure to hold one-time initialization
|
||||
struct FConstructorStatics
|
||||
{
|
||||
ConstructorHelpers::FObjectFinder<UStaticMesh> SphereMesh;
|
||||
FConstructorStatics()
|
||||
: SphereMesh(TEXT("/Engine/EngineMeshes/Sphere")) {}
|
||||
};
|
||||
|
||||
static FConstructorStatics ConstructorStatics;
|
||||
|
||||
MeshComponent = CreateOptionalDefaultSubobject<UStaticMeshComponent>(AMyDefaultPawn::MeshComponentName);
|
||||
if (MeshComponent)
|
||||
{
|
||||
MeshComponent->SetStaticMesh(ConstructorStatics.SphereMesh.Object);
|
||||
MeshComponent->AlwaysLoadOnClient = true;
|
||||
MeshComponent->AlwaysLoadOnServer = true;
|
||||
MeshComponent->bOwnerNoSee = true;
|
||||
MeshComponent->bCastDynamicShadow = true;
|
||||
MeshComponent->bAffectDynamicIndirectLighting = false;
|
||||
MeshComponent->bAffectDistanceFieldLighting = false;
|
||||
MeshComponent->bVisibleInRayTracing = false;
|
||||
MeshComponent->PrimaryComponentTick.TickGroup = TG_PrePhysics;
|
||||
MeshComponent->SetupAttachment(RootComponent);
|
||||
MeshComponent->SetCollisionProfileName(UCollisionProfile::Pawn_ProfileName);
|
||||
const float Scale = CollisionComponent->GetUnscaledSphereRadius() / 160.f; // @TODO: hardcoding known size of EngineMeshes.Sphere. Should use a unit sphere instead.
|
||||
MeshComponent->SetRelativeScale3D(FVector(Scale));
|
||||
MeshComponent->SetGenerateOverlapEvents(false);
|
||||
MeshComponent->SetCanEverAffectNavigation(false);
|
||||
}
|
||||
|
||||
// This is the default pawn class, we want to have it be able to move out of the box.
|
||||
bAddDefaultMovementBindings = true;
|
||||
}
|
||||
|
||||
void InitializeDefaultPawnInputBindings()
|
||||
{
|
||||
static bool bBindingsAdded = false;
|
||||
if (!bBindingsAdded)
|
||||
{
|
||||
bBindingsAdded = true;
|
||||
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveForward", EKeys::W, 1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveForward", EKeys::S, -1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveForward", EKeys::Up, 1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveForward", EKeys::Down, -1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveForward", EKeys::Gamepad_LeftY, 1.f));
|
||||
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveRight", EKeys::A, -1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveRight", EKeys::D, 1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveRight", EKeys::Gamepad_LeftX, 1.f));
|
||||
|
||||
// HACK: Android controller bindings in ini files seem to not work
|
||||
// Direct overrides here some to work
|
||||
#if !PLATFORM_ANDROID
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Gamepad_LeftThumbstick, 1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Gamepad_RightThumbstick, -1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Gamepad_FaceButton_Bottom, 1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::LeftControl, -1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::SpaceBar, 1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::C, -1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::E, 1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Q, -1.f));
|
||||
#else
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Gamepad_LeftTriggerAxis, -0.5f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_MoveUp", EKeys::Gamepad_RightTriggerAxis, 0.5f));
|
||||
#endif
|
||||
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_TurnRate", EKeys::Gamepad_RightX, 1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_TurnRate", EKeys::Left, -1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_TurnRate", EKeys::Right, 1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_Turn", EKeys::MouseX, 1.f));
|
||||
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_LookUpRate", EKeys::Gamepad_RightY, 1.f));
|
||||
UPlayerInput::AddEngineDefinedAxisMapping(FInputAxisKeyMapping("DefaultPawn_LookUp", EKeys::MouseY, -1.f));
|
||||
}
|
||||
}
|
||||
|
||||
void AMyDefaultPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
|
||||
{
|
||||
check(PlayerInputComponent);
|
||||
|
||||
if (bAddDefaultMovementBindings)
|
||||
{
|
||||
InitializeDefaultPawnInputBindings();
|
||||
|
||||
PlayerInputComponent->BindAxis("DefaultPawn_MoveForward", this, &AMyDefaultPawn::MoveForward);
|
||||
PlayerInputComponent->BindAxis("DefaultPawn_MoveRight", this, &AMyDefaultPawn::MoveRight);
|
||||
PlayerInputComponent->BindAxis("DefaultPawn_MoveUp", this, &AMyDefaultPawn::MoveUp_World);
|
||||
PlayerInputComponent->BindAxis("DefaultPawn_Turn", this, &AMyDefaultPawn::AddControllerYawInput);
|
||||
PlayerInputComponent->BindAxis("DefaultPawn_TurnRate", this, &AMyDefaultPawn::TurnAtRate);
|
||||
PlayerInputComponent->BindAxis("DefaultPawn_LookUp", this, &AMyDefaultPawn::AddControllerPitchInput);
|
||||
PlayerInputComponent->BindAxis("DefaultPawn_LookUpRate", this, &AMyDefaultPawn::LookUpAtRate);
|
||||
}
|
||||
}
|
||||
|
||||
void AMyDefaultPawn::UpdateNavigationRelevance()
|
||||
{
|
||||
if (CollisionComponent)
|
||||
{
|
||||
CollisionComponent->SetCanEverAffectNavigation(bCanAffectNavigationGeneration);
|
||||
}
|
||||
}
|
||||
|
||||
void AMyDefaultPawn::MoveRight(float Val)
|
||||
{
|
||||
if (Val != 0.f)
|
||||
{
|
||||
if (Controller)
|
||||
{
|
||||
FRotator const ControlSpaceRot = Controller->GetControlRotation();
|
||||
|
||||
// transform to world space and add it
|
||||
AddMovementInput(FRotationMatrix(ControlSpaceRot).GetScaledAxis(EAxis::Y), Val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AMyDefaultPawn::MoveForward(float Val)
|
||||
{
|
||||
if (Val != 0.f)
|
||||
{
|
||||
if (Controller)
|
||||
{
|
||||
FRotator const ControlSpaceRot = Controller->GetControlRotation();
|
||||
|
||||
// transform to world space and add it
|
||||
AddMovementInput(FRotationMatrix(ControlSpaceRot).GetScaledAxis(EAxis::X), Val);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AMyDefaultPawn::MoveUp_World(float Val)
|
||||
{
|
||||
if (Val != 0.f)
|
||||
{
|
||||
AddMovementInput(FVector::UpVector, Val);
|
||||
}
|
||||
}
|
||||
|
||||
void AMyDefaultPawn::TurnAtRate(float Rate)
|
||||
{
|
||||
// calculate delta for this frame from the rate information
|
||||
AddControllerYawInput(Rate * GetWorld()->GetDeltaSeconds() * CustomTimeDilation);
|
||||
}
|
||||
|
||||
void AMyDefaultPawn::LookUpAtRate(float Rate)
|
||||
{
|
||||
// calculate delta for this frame from the rate information
|
||||
AddControllerPitchInput(Rate * GetWorld()->GetDeltaSeconds() * CustomTimeDilation);
|
||||
}
|
||||
|
||||
UPawnMovementComponent* AMyDefaultPawn::GetMovementComponent() const
|
||||
{
|
||||
return MovementComponent;
|
||||
}
|
102
Source/PresidentsBrigade/MyDefaultPawn.h
Executable file
102
Source/PresidentsBrigade/MyDefaultPawn.h
Executable file
@ -0,0 +1,102 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/Pawn.h"
|
||||
#include "MyDefaultPawn.generated.h"
|
||||
|
||||
class UInputComponent;
|
||||
class UPawnMovementComponent;
|
||||
class USphereComponent;
|
||||
class UStaticMeshComponent;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS(config = Game, Blueprintable, BlueprintType)
|
||||
class PRESIDENTSBRIGADE_API AMyDefaultPawn : public APawn
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
AMyDefaultPawn(const FObjectInitializer& ObjectInitializer);
|
||||
|
||||
// Begin Pawn overrides
|
||||
virtual UPawnMovementComponent* GetMovementComponent() const override;
|
||||
virtual void SetupPlayerInputComponent(UInputComponent* InInputComponent) override;
|
||||
virtual void UpdateNavigationRelevance() override;
|
||||
|
||||
/**
|
||||
* Input callback to move forward in local space (or backward if Val is negative).
|
||||
* @param Val Amount of movement in the forward direction (or backward if negative).
|
||||
* @see APawn::AddMovementInput()
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Pawn")
|
||||
virtual void MoveForward(float Val);
|
||||
|
||||
/**
|
||||
* Input callback to strafe right in local space (or left if Val is negative).
|
||||
* @param Val Amount of movement in the right direction (or left if negative).
|
||||
* @see APawn::AddMovementInput()
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Pawn")
|
||||
virtual void MoveRight(float Val);
|
||||
|
||||
/**
|
||||
* Input callback to move up in world space (or down if Val is negative).
|
||||
* @param Val Amount of movement in the world up direction (or down if negative).
|
||||
* @see APawn::AddMovementInput()
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Pawn")
|
||||
virtual void MoveUp_World(float Val);
|
||||
|
||||
/**
|
||||
* Called via input to turn at a given rate.
|
||||
* @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Pawn")
|
||||
virtual void TurnAtRate(float Rate);
|
||||
|
||||
/**
|
||||
* Called via input to look up at a given rate (or down if Rate is negative).
|
||||
* @param Rate This is a normalized rate, i.e. 1.0 means 100% of desired turn rate
|
||||
*/
|
||||
UFUNCTION(BlueprintCallable, Category = "Pawn")
|
||||
virtual void LookUpAtRate(float Rate);
|
||||
|
||||
public:
|
||||
/** Name of the MovementComponent. Use this name if you want to use a different class (with ObjectInitializer.SetDefaultSubobjectClass). */
|
||||
static FName MovementComponentName;
|
||||
|
||||
protected:
|
||||
/** DefaultPawn movement component */
|
||||
UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
|
||||
UPawnMovementComponent* MovementComponent;
|
||||
|
||||
public:
|
||||
/** Name of the CollisionComponent. */
|
||||
static FName CollisionComponentName;
|
||||
|
||||
private:
|
||||
/** DefaultPawn collision component */
|
||||
UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
|
||||
USphereComponent* CollisionComponent;
|
||||
public:
|
||||
|
||||
/** Name of the MeshComponent. Use this name if you want to prevent creation of the component (with ObjectInitializer.DoNotCreateDefaultSubobject). */
|
||||
static FName MeshComponentName;
|
||||
|
||||
private:
|
||||
/** The mesh associated with this Pawn. */
|
||||
UPROPERTY(Category = Pawn, VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
|
||||
UStaticMeshComponent* MeshComponent;
|
||||
public:
|
||||
|
||||
/** If true, adds default input bindings for movement and camera look. */
|
||||
UPROPERTY(Category = Pawn, EditAnywhere, BlueprintReadOnly)
|
||||
uint32 bAddDefaultMovementBindings : 1;
|
||||
|
||||
/** Returns CollisionComponent subobject **/
|
||||
USphereComponent* GetCollisionComponent() const { return CollisionComponent; }
|
||||
/** Returns MeshComponent subobject **/
|
||||
UStaticMeshComponent* GetMeshComponent() const { return MeshComponent; }
|
||||
};
|
23
Source/PresidentsBrigade/PresidentsBrigade.Build.cs
Executable file
23
Source/PresidentsBrigade/PresidentsBrigade.Build.cs
Executable file
@ -0,0 +1,23 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
using UnrealBuildTool;
|
||||
|
||||
public class PresidentsBrigade : ModuleRules
|
||||
{
|
||||
public PresidentsBrigade(ReadOnlyTargetRules Target) : base(Target)
|
||||
{
|
||||
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
|
||||
|
||||
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
|
||||
|
||||
PrivateDependencyModuleNames.AddRange(new string[] { });
|
||||
|
||||
// Uncomment if you are using Slate UI
|
||||
// PrivateDependencyModuleNames.AddRange(new string[] { "Slate", "SlateCore" });
|
||||
|
||||
// Uncomment if you are using online features
|
||||
// PrivateDependencyModuleNames.Add("OnlineSubsystem");
|
||||
|
||||
// To include OnlineSubsystemSteam, add it to the plugins section in your uproject file with the Enabled attribute set to true
|
||||
}
|
||||
}
|
6
Source/PresidentsBrigade/PresidentsBrigade.cpp
Executable file
6
Source/PresidentsBrigade/PresidentsBrigade.cpp
Executable file
@ -0,0 +1,6 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#include "PresidentsBrigade.h"
|
||||
#include "Modules/ModuleManager.h"
|
||||
|
||||
IMPLEMENT_PRIMARY_GAME_MODULE( FDefaultGameModuleImpl, PresidentsBrigade, "PresidentsBrigade" );
|
6
Source/PresidentsBrigade/PresidentsBrigade.h
Executable file
6
Source/PresidentsBrigade/PresidentsBrigade.h
Executable file
@ -0,0 +1,6 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
|
10
Source/PresidentsBrigade/PresidentsBrigadeGameModeBase.cpp
Executable file
10
Source/PresidentsBrigade/PresidentsBrigadeGameModeBase.cpp
Executable file
@ -0,0 +1,10 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
|
||||
#include "PresidentsBrigadeGameModeBase.h"
|
||||
#include "BasePawn.h"
|
||||
|
||||
APresidentsBrigadeGameModeBase::APresidentsBrigadeGameModeBase()
|
||||
{
|
||||
}
|
||||
|
19
Source/PresidentsBrigade/PresidentsBrigadeGameModeBase.h
Executable file
19
Source/PresidentsBrigade/PresidentsBrigadeGameModeBase.h
Executable file
@ -0,0 +1,19 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CoreMinimal.h"
|
||||
#include "GameFramework/GameModeBase.h"
|
||||
#include "PresidentsBrigadeGameModeBase.generated.h"
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
UCLASS()
|
||||
class PRESIDENTSBRIGADE_API APresidentsBrigadeGameModeBase : public AGameModeBase
|
||||
{
|
||||
GENERATED_BODY()
|
||||
|
||||
public:
|
||||
APresidentsBrigadeGameModeBase();
|
||||
};
|
15
Source/PresidentsBrigadeEditor.Target.cs
Executable file
15
Source/PresidentsBrigadeEditor.Target.cs
Executable file
@ -0,0 +1,15 @@
|
||||
// Fill out your copyright notice in the Description page of Project Settings.
|
||||
|
||||
using UnrealBuildTool;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class PresidentsBrigadeEditorTarget : TargetRules
|
||||
{
|
||||
public PresidentsBrigadeEditorTarget(TargetInfo Target) : base(Target)
|
||||
{
|
||||
Type = TargetType.Editor;
|
||||
DefaultBuildSettings = BuildSettingsVersion.V2;
|
||||
|
||||
ExtraModuleNames.AddRange( new string[] { "PresidentsBrigade" } );
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user