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
Branches
Tags
No related merge requests found
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
UVRPawnMovement::UVRPawnMovement(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer) UVRPawnMovement::UVRPawnMovement(const FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
{ {
CapsuleColliderComponent = CreateDefaultSubobject<UCapsuleComponent>(TEXT("CapsuleCollider")); CapsuleColliderComponent = CreateDefaultSubobject<UCapsuleComponent>(TEXT("CapsuleCollider"));
CapsuleColliderComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics); CapsuleColliderComponent->SetCollisionEnabled(ECollisionEnabled::QueryAndPhysics);
CapsuleColliderComponent->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore); CapsuleColliderComponent->SetCollisionResponseToAllChannels(ECollisionResponse::ECR_Ignore);
...@@ -19,14 +17,14 @@ void UVRPawnMovement::TickComponent(float DeltaTime, enum ELevelTick TickType, F ...@@ -19,14 +17,14 @@ void UVRPawnMovement::TickComponent(float DeltaTime, enum ELevelTick TickType, F
FVector PositionChange = GetPendingInputVector(); FVector PositionChange = GetPendingInputVector();
if (NavigationMode == EVRNavigationModes::Walk) if (NavigationMode == EVRNavigationModes::NAV_WALK)
{ {
PositionChange.Z = 0.0f; PositionChange.Z = 0.0f;
ConsumeInputVector(); ConsumeInputVector();
AddInputVector(PositionChange); AddInputVector(PositionChange);
} }
if(NavigationMode == EVRNavigationModes::Fly || NavigationMode == EVRNavigationModes::Walk) if(NavigationMode == EVRNavigationModes::NAV_FLY || NavigationMode == EVRNavigationModes::NAV_WALK)
{ {
MoveByGravityOrStepUp(DeltaTime); MoveByGravityOrStepUp(DeltaTime);
CheckForPhysWalkingCollision(); CheckForPhysWalkingCollision();
...@@ -37,7 +35,7 @@ void UVRPawnMovement::TickComponent(float DeltaTime, enum ELevelTick TickType, F ...@@ -37,7 +35,7 @@ void UVRPawnMovement::TickComponent(float DeltaTime, enum ELevelTick TickType, F
} }
} }
if(NavigationMode == EVRNavigationModes::None) if(NavigationMode == EVRNavigationModes::NAV_NONE)
{ {
ConsumeInputVector(); ConsumeInputVector();
} }
...@@ -65,7 +63,6 @@ void UVRPawnMovement::SetCameraComponent(UCameraComponent* NewCameraComponent) ...@@ -65,7 +63,6 @@ void UVRPawnMovement::SetCameraComponent(UCameraComponent* NewCameraComponent)
CapsuleColliderComponent->SetupAttachment(CameraComponent); CapsuleColliderComponent->SetupAttachment(CameraComponent);
} }
void UVRPawnMovement::SetCapsuleColliderToUserSize() void UVRPawnMovement::SetCapsuleColliderToUserSize()
{ {
float CharachterSize = abs(UpdatedComponent->GetComponentLocation().Z - CameraComponent->GetComponentLocation().Z); float CharachterSize = abs(UpdatedComponent->GetComponentLocation().Z - CameraComponent->GetComponentLocation().Z);
...@@ -120,7 +117,7 @@ void UVRPawnMovement::MoveByGravityOrStepUp(float DeltaSeconds) ...@@ -120,7 +117,7 @@ void UVRPawnMovement::MoveByGravityOrStepUp(float DeltaSeconds)
ShiftVertically(DistanceDifference, UpSteppingAcceleration, DeltaSeconds, 1); ShiftVertically(DistanceDifference, UpSteppingAcceleration, DeltaSeconds, 1);
} }
//Gravity (only in Walk Mode) //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); ShiftVertically(DistanceDifference, GravityAcceleration, DeltaSeconds, -1);
} }
......
...@@ -22,10 +22,10 @@ ...@@ -22,10 +22,10 @@
UENUM(BlueprintType) UENUM(BlueprintType)
enum class EVRNavigationModes : uint8 enum class EVRNavigationModes : uint8
{ {
None UMETA(DisplayName = "None (no controller movement)"), NAV_NONE UMETA(DisplayName = "None (no controller movement)"),
Ghost UMETA(DisplayName = "Ghost (flying, also through walls)"), NAV_GHOST UMETA(DisplayName = "Ghost (flying, also through walls)"),
Fly UMETA(DisplayName = "Fly (prohibiting collisions)"), NAV_FLY UMETA(DisplayName = "Fly (prohibiting collisions)"),
Walk UMETA(DisplayName = "Walk (gravity and prohibiting collisions)") NAV_WALK UMETA(DisplayName = "Walk (gravity and prohibiting collisions)")
}; };
UCLASS() UCLASS()
...@@ -41,7 +41,7 @@ public: ...@@ -41,7 +41,7 @@ public:
void SetCameraComponent(UCameraComponent* NewCameraComponent); void SetCameraComponent(UCameraComponent* NewCameraComponent);
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement")
EVRNavigationModes NavigationMode = EVRNavigationModes::Walk; EVRNavigationModes NavigationMode = EVRNavigationModes::NAV_WALK;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement") UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "VR Movement")
float MaxStepHeight = 40.0f; 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