Skip to content
Snippets Groups Projects
Commit 23a36444 authored by Sebastian Pape's avatar Sebastian Pape
Browse files

Renaming EVRNavigationModes to conform to Coding Standards

parent 10a6ed64
No related branches found
No related tags found
No related merge requests found
......@@ -4,8 +4,6 @@
UVRPawnMovement::UVRPawnMovement(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{
CapsuleColliderComponent = CreateDefaultSubobject<UCapsuleComponent>(TEXT("CapsuleCollider"));
CapsuleColliderComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
CapsuleColliderComponent->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);
......@@ -19,14 +17,14 @@ void UVRPawnMovement::TickComponent(float DeltaTime, enum ELevelTick TickType, F
FVector PositionChange = GetPendingInputVector();
if (NavigationMode == EVRNavigationModes::Walk)
if (NavigationMode == EVRNavigationModes::NAV_WALK)
{
PositionChange.Z = 0.0f;
ConsumeInputVector();
AddInputVector(PositionChange);
}
if(NavigationMode == EVRNavigationModes::Fly || NavigationMode == EVRNavigationModes::Walk)
if(NavigationMode == EVRNavigationModes::NAV_FLY || NavigationMode == EVRNavigationModes::NAV_WALK)
{
MoveByGravityOrStepUp(DeltaTime);
CheckForPhysWalkingCollision();
......@@ -37,7 +35,7 @@ void UVRPawnMovement::TickComponent(float DeltaTime, enum ELevelTick TickType, F
}
}
if(NavigationMode == EVRNavigationModes::None)
if(NavigationMode == EVRNavigationModes::NAV_NONE)
{
ConsumeInputVector();
}
......@@ -65,7 +63,6 @@ void UVRPawnMovement::SetCameraComponent(UCameraComponent* NewCameraComponent)
CapsuleColliderComponent->SetupAttachment(CameraComponent);
}
void UVRPawnMovement::SetCapsuleColliderToUserSize()
{
float CharachterSize = abs(UpdatedComponent->GetComponentLocation().Z - CameraComponent->GetComponentLocation().Z);
......@@ -120,7 +117,7 @@ void UVRPawnMovement::MoveByGravityOrStepUp(float DeltaSeconds)
ShiftVertically(DistanceDifference, UpSteppingAcceleration, DeltaSeconds, 1);
}
//Gravity (only in Walk Mode)
else if (NavigationMode==EVRNavigationModes::Walk && ((HitDetailsMultiLineTrace.bBlockingHit && HitDetailsMultiLineTrace.Distance > MaxStepHeight) || (HitDetailsMultiLineTrace.Actor == nullptr && HitDetailsMultiLineTrace.Distance != -1.0f)))
else if (NavigationMode==EVRNavigationModes::NAV_WALK && ((HitDetailsMultiLineTrace.bBlockingHit && HitDetailsMultiLineTrace.Distance > MaxStepHeight) || (HitDetailsMultiLineTrace.Actor == nullptr && HitDetailsMultiLineTrace.Distance != -1.0f)))
{
ShiftVertically(DistanceDifference, GravityAcceleration, DeltaSeconds, -1);
}
......
......@@ -22,10 +22,10 @@
UENUM(BlueprintType)
enum class EVRNavigationModes : uint8
{
None UMETA(DisplayName = "None (no controller movement)"),
Ghost UMETA(DisplayName = "Ghost (flying, also through walls)"),
Fly UMETA(DisplayName = "Fly (prohibiting collisions)"),
Walk UMETA(DisplayName = "Walk (gravity and prohibiting collisions)")
NAV_NONE UMETA(DisplayName = "None (no controller movement)"),
NAV_GHOST UMETA(DisplayName = "Ghost (flying, also through walls)"),
NAV_FLY UMETA(DisplayName = "Fly (prohibiting collisions)"),
NAV_WALK UMETA(DisplayName = "Walk (gravity and prohibiting collisions)")
};
UCLASS()
......@@ -41,7 +41,7 @@ public:
void SetCameraComponent(UCameraComponent* NewCameraComponent);
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement")
EVRNavigationModes NavigationMode = EVRNavigationModes::Walk;
EVRNavigationModes NavigationMode = EVRNavigationModes::NAV_WALK;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement")
float MaxStepHeight = 40.0f;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment