Compare commits

..

No commits in common. "fef6bd8e3e60832ec356fdd52552689dfe0f9a48" and "6c2e8fc1638e85091b5015ae8ef0648f815a18cf" have entirely different histories.

21 changed files with 35 additions and 156 deletions

Binary file not shown.

View File

@ -8,7 +8,7 @@ public class Aura : ModuleRules
{
PCHUsage = PCHUsageMode.UseExplicitOrSharedPCHs;
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore", "EnhancedInput" });
PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
PrivateDependencyModuleNames.AddRange(new string[] { });

View File

@ -3,35 +3,3 @@
#include "Character/AuraCharacter.h"
#include "Camera/CameraComponent.h"
#include "GameFramework/CharacterMovementComponent.h"
#include "GameFramework/SpringArmComponent.h"
AAuraCharacter::AAuraCharacter()
{
SpringArm = CreateDefaultSubobject<USpringArmComponent>("SpringArm");
SpringArm->TargetArmLength = 700.f;
SpringArm->bEnableCameraLag = true;
SpringArm->CameraLagSpeed = 10;
SpringArm->bUsePawnControlRotation = false;
SpringArm->bInheritPitch = false;
SpringArm->bInheritRoll = false;
SpringArm->bInheritYaw = false;
SpringArm->SetRelativeRotation (FRotator (0.f, -45.f, 0.f));
SpringArm->SetupAttachment(GetRootComponent ());
Camera = CreateDefaultSubobject<UCameraComponent>("Camera");
Camera->bUsePawnControlRotation = false;
Camera->SetupAttachment(SpringArm);
GetCharacterMovement()->bOrientRotationToMovement = true;
GetCharacterMovement()->RotationRate = FRotator (0.f, 400.f, 0.f);
GetCharacterMovement()->bConstrainToPlane = true;
GetCharacterMovement()->bSnapToPlaneAtStart = true;
bUseControllerRotationPitch = false;
bUseControllerRotationYaw = false;
bUseControllerRotationRoll = false;
}

View File

@ -1,5 +0,0 @@
// Copyright; GhostPacket Games
#include "Game/AuraGameModeBase.h"

View File

@ -1,55 +0,0 @@
// Copyright; GhostPacket Games
#include "Player/AuraPlayerController.h"
#include "EnhancedInputSubsystems.h"
#include "EnhancedInputComponent.h"
AAuraPlayerController::AAuraPlayerController()
{
bReplicates = true;
}
void AAuraPlayerController::BeginPlay()
{
Super::BeginPlay();
check(AuraContext); // checks it's set
UEnhancedInputLocalPlayerSubsystem *Subsystem = ULocalPlayer::GetSubsystem <UEnhancedInputLocalPlayerSubsystem>(GetLocalPlayer ());
check (Subsystem);
Subsystem->AddMappingContext (AuraContext, 0);
bShowMouseCursor = true;
DefaultMouseCursor = EMouseCursor::Default;
FInputModeGameAndUI InputModeData;
InputModeData.SetLockMouseToViewportBehavior(EMouseLockMode::DoNotLock);
InputModeData.SetHideCursorDuringCapture(false);
SetInputMode (InputModeData);
}
void AAuraPlayerController::SetupInputComponent()
{
Super::SetupInputComponent();
UEnhancedInputComponent *EnhancedInputComponent = CastChecked<UEnhancedInputComponent>(InputComponent);
EnhancedInputComponent->BindAction (MoveAction, ETriggerEvent::Triggered, this, &AAuraPlayerController::Move);
}
void AAuraPlayerController::Move(const FInputActionValue& InputActionValue)
{
const FVector2D InputAxisVector = InputActionValue.Get<FVector2D>();
const FRotator Rotation = GetControlRotation ();
const FRotator YawRotation(0.f, Rotation.Yaw, 0.f);
const FVector ForwardDirection = FRotationMatrix (YawRotation).GetUnitAxis(EAxis::X);
const FVector RightDirection = FRotationMatrix (YawRotation).GetUnitAxis (EAxis::Y);
APawn *ControlledPawn = GetPawn<APawn>();
if (!ControlledPawn)
return;
ControlledPawn->AddMovementInput(ForwardDirection, InputAxisVector.Y);
ControlledPawn->AddMovementInput(RightDirection, InputAxisVector.X);
}

View File

@ -6,21 +6,12 @@
#include "Character/AuraCharacterBase.h"
#include "AuraCharacter.generated.h"
class USpringArmComponent;
class UCameraComponent;
/**
*
*/
UCLASS()
class AURA_API AAuraCharacter : public AAuraCharacterBase
{
GENERATED_BODY()
public:
AAuraCharacter ();
private:
UPROPERTY (EditAnywhere)
TObjectPtr<USpringArmComponent> SpringArm;
UPROPERTY (EditAnywhere)
TObjectPtr<UCameraComponent> Camera;
};

View File

@ -1,17 +0,0 @@
// Copyright; GhostPacket Games
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/GameModeBase.h"
#include "AuraGameModeBase.generated.h"
/**
*
*/
UCLASS()
class AURA_API AAuraGameModeBase : public AGameModeBase
{
GENERATED_BODY()
};

View File

@ -1,34 +0,0 @@
// Copyright; GhostPacket Games
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/PlayerController.h"
#include "AuraPlayerController.generated.h"
class UInputMappingContext;
class UInputAction;
struct FInputActionValue;
UCLASS()
class AURA_API AAuraPlayerController : public APlayerController
{
GENERATED_BODY()
public:
AAuraPlayerController ();
protected:
virtual void BeginPlay() override;
virtual void SetupInputComponent() override;
private:
UPROPERTY (EditAnywhere, Category = "Input")
TObjectPtr<UInputMappingContext> AuraContext;
UPROPERTY (EditAnywhere, Category = "Input")
TObjectPtr<UInputAction> MoveAction;
void Move (const FInputActionValue &InputActionValue);
};

View File

@ -0,0 +1,19 @@
// Copyright; GhostPacket Games
#pragma once
#include "CoreMinimal.h"
#include "GameFramework/Character.h"
#include "AuraCharacterBase.generated.h"
UCLASS(Abstract) // Abstract so that it cannot be dragged to a level
class AURA_API AAuraCharacterBase : public ACharacter
{
GENERATED_BODY()
public:
AAuraCharacterBase();
protected:
virtual void BeginPlay() override;
};

View File

@ -0,0 +1,12 @@
// Copyright; GhostPacket Games
#include "Character/AuraCharacterBase.h"
AAuraCharacterBase::AAuraCharacterBase()
{
PrimaryActorTick.bCanEverTick = false;
}
void AAuraCharacterBase::BeginPlay()
{
Super::BeginPlay();
}