This commit is contained in:
Sara Montecino 2022-11-05 13:50:04 -07:00
parent 0606deaccb
commit 74a0f0b906
6 changed files with 86 additions and 77 deletions

BIN
Content/PlayerPawn_BP.uasset Executable file

Binary file not shown.

View File

@ -3,85 +3,67 @@ 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}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Engine", "Engine", "{5103C5E3-315C-4C37-874B-8D40FB0C4DF2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Games", "Games", "{CDA30B7C-8F9F-48AB-A6AA-CB3B41DCE083}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Games", "Games", "{EF25ABC6-4E6A-47FF-8F19-D9F362F20975}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PresidentsBrigade", "Intermediate\ProjectFiles\PresidentsBrigade.vcxproj", "{F2C85DE9-5426-412A-8D2E-10FE7F5CF11B}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UE4", "Intermediate\ProjectFiles\UE4.vcxproj", "{D9382F70-7D46-4890-A609-A45B932320FF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UE4", "Intermediate\ProjectFiles\UE4.vcxproj", "{B0F8FF12-D021-4217-B1B9-F5627A14FB59}"
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PresidentsBrigade", "Intermediate\ProjectFiles\PresidentsBrigade.vcxproj", "{2CF5761D-D1F4-42C9-A423-DA654E7A8611}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Visualizers", "Visualizers", "{1AC9C2E0-EF4E-4F8C-9F40-1C4BD6DECBCB}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Visualizers", "Visualizers", "{7AC2C1EC-1EDE-4E55-8432-75A0A78B8D96}"
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
..\..\..\..\..\Program Files\Epic Games\UE_4.24\Engine\Extras\VisualStudioDebugging\UE4.natvis = ..\..\..\..\..\Program Files\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
{D9382F70-7D46-4890-A609-A45B932320FF}.DebugGame Editor|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32
{D9382F70-7D46-4890-A609-A45B932320FF}.DebugGame Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32
{D9382F70-7D46-4890-A609-A45B932320FF}.DebugGame|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32
{D9382F70-7D46-4890-A609-A45B932320FF}.DebugGame|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32
{D9382F70-7D46-4890-A609-A45B932320FF}.Development Editor|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32
{D9382F70-7D46-4890-A609-A45B932320FF}.Development Editor|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32
{D9382F70-7D46-4890-A609-A45B932320FF}.Development|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32
{D9382F70-7D46-4890-A609-A45B932320FF}.Development|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32
{D9382F70-7D46-4890-A609-A45B932320FF}.Shipping|Win32.ActiveCfg = BuiltWithUnrealBuildTool|Win32
{D9382F70-7D46-4890-A609-A45B932320FF}.Shipping|Win64.ActiveCfg = BuiltWithUnrealBuildTool|Win32
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.DebugGame Editor|Win32.ActiveCfg = Invalid|Win32
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.DebugGame Editor|Win64.ActiveCfg = DebugGame_Editor|x64
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.DebugGame Editor|Win64.Build.0 = DebugGame_Editor|x64
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.DebugGame|Win32.ActiveCfg = DebugGame|Win32
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.DebugGame|Win32.Build.0 = DebugGame|Win32
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.DebugGame|Win64.ActiveCfg = DebugGame|x64
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.DebugGame|Win64.Build.0 = DebugGame|x64
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Development Editor|Win32.ActiveCfg = Invalid|Win32
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Development Editor|Win64.ActiveCfg = Development_Editor|x64
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Development Editor|Win64.Build.0 = Development_Editor|x64
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Development|Win32.ActiveCfg = Development|Win32
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Development|Win32.Build.0 = Development|Win32
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Development|Win64.ActiveCfg = Development|x64
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Development|Win64.Build.0 = Development|x64
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Shipping|Win32.ActiveCfg = Shipping|Win32
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Shipping|Win32.Build.0 = Shipping|Win32
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Shipping|Win64.ActiveCfg = Shipping|x64
{2CF5761D-D1F4-42C9-A423-DA654E7A8611}.Shipping|Win64.Build.0 = Shipping|x64
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}
{D9382F70-7D46-4890-A609-A45B932320FF} = {5103C5E3-315C-4C37-874B-8D40FB0C4DF2}
{2CF5761D-D1F4-42C9-A423-DA654E7A8611} = {EF25ABC6-4E6A-47FF-8F19-D9F362F20975}
EndGlobalSection
EndGlobal

View File

@ -2,7 +2,6 @@
#include "BasePawn.h"
#include "Camera/CameraComponent.h"
#include "Components/StaticMeshComponent.h"
#include "GameFramework/FloatingPawnMovement.h"
@ -12,13 +11,11 @@ ABasePawn::ABasePawn(const FObjectInitializer &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;
@ -29,7 +26,6 @@ ABasePawn::ABasePawn(const FObjectInitializer &object_initializer):
void ABasePawn::BeginPlay()
{
Super::BeginPlay();
}
UPawnMovementComponent* ABasePawn::GetMovementComponent() const
@ -43,14 +39,6 @@ void ABasePawn::Tick(float DeltaTime)
Super::Tick(DeltaTime);
}
// Called to bind functionality to input
void ABasePawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
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();

View File

@ -6,7 +6,6 @@
#include "GameFramework/Pawn.h"
#include "BasePawn.generated.h"
class UCameraComponent;
class UFloatingPawnMovement;
UCLASS()
@ -20,27 +19,19 @@ public:
// Called every frame
virtual void Tick(float DeltaTime) override;
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
virtual void handle_move_right(float axis);
virtual void handle_move_forward(float axis);
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;
private:
USceneComponent* root_component;
void handle_move_right(float axis);
void handle_move_forward(float axis);
};

View File

@ -0,0 +1,21 @@
// Fill out your copyright notice in the Description page of Project Settings.
#include "PlayerPawn.h"
#include "Camera/CameraComponent.h"
APlayerPawn::APlayerPawn(const FObjectInitializer &object_initializer):
ABasePawn(object_initializer)
{
main_camera = object_initializer.CreateDefaultSubobject<UCameraComponent>(this, FName("MainCamera"));
main_camera->SetupAttachment(root_component);
}
// Called to bind functionality to input
void APlayerPawn::SetupPlayerInputComponent(UInputComponent* PlayerInputComponent)
{
Super::SetupPlayerInputComponent(PlayerInputComponent);
PlayerInputComponent->BindAxis("MoveForward", this, &ABasePawn::handle_move_forward);
PlayerInputComponent->BindAxis("MoveRight", this, &ABasePawn::handle_move_right);
}

View File

@ -0,0 +1,27 @@
// Fill out your copyright notice in the Description page of Project Settings.
#pragma once
#include "CoreMinimal.h"
#include "BasePawn.h"
#include "PlayerPawn.generated.h"
class UCameraComponent;
/**
*
*/
UCLASS()
class PRESIDENTSBRIGADE_API APlayerPawn : public ABasePawn
{
GENERATED_BODY()
public:
// Sets default values for this pawn's properties
APlayerPawn(const FObjectInitializer &object_initializer);
// Called to bind functionality to input
virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;
protected:
UPROPERTY(EditAnywhere, Category="Player")
UCameraComponent* main_camera;
};