Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
RWTH VR Toolkit
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Unreal-Development
Plugins
RWTH VR Toolkit
Commits
23a36444
Commit
23a36444
authored
Feb 2, 2021
by
Sebastian Pape
Browse files
Options
Downloads
Patches
Plain Diff
Renaming EVRNavigationModes to conform to Coding Standards
parent
10a6ed64
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/DisplayClusterExtensions/Private/VRPawnMovement.cpp
+4
-7
4 additions, 7 deletions
Source/DisplayClusterExtensions/Private/VRPawnMovement.cpp
Source/DisplayClusterExtensions/Public/VRPawnMovement.h
+5
-5
5 additions, 5 deletions
Source/DisplayClusterExtensions/Public/VRPawnMovement.h
with
9 additions
and
12 deletions
Source/DisplayClusterExtensions/Private/VRPawnMovement.cpp
+
4
−
7
View file @
23a36444
...
@@ -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
::
N
one
)
if
(
NavigationMode
==
EVRNavigationModes
::
N
AV_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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Source/DisplayClusterExtensions/Public/VRPawnMovement.h
+
5
−
5
View file @
23a36444
...
@@ -22,10 +22,10 @@
...
@@ -22,10 +22,10 @@
UENUM
(
BlueprintType
)
UENUM
(
BlueprintType
)
enum
class
EVRNavigationModes
:
uint8
enum
class
EVRNavigationModes
:
uint8
{
{
N
one
UMETA
(
DisplayName
=
"None (no controller movement)"
),
N
AV_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
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment