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
0fa38996
Commit
0fa38996
authored
4 years ago
by
Ehret
Browse files
Options
Downloads
Patches
Plain Diff
minor changes to make extraction of walking movement into a movement component work
parent
cfd9e902
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
+13
-9
13 additions, 9 deletions
...e/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
Source/DisplayClusterExtensions/Public/VirtualRealityPawn.h
+3
-1
3 additions, 1 deletion
Source/DisplayClusterExtensions/Public/VirtualRealityPawn.h
with
16 additions
and
10 deletions
Source/DisplayClusterExtensions/Private/VirtualRealityPawn.cpp
+
13
−
9
View file @
0fa38996
...
@@ -27,9 +27,9 @@ AVirtualRealityPawn::AVirtualRealityPawn(const FObjectInitializer& ObjectInitial
...
@@ -27,9 +27,9 @@ AVirtualRealityPawn::AVirtualRealityPawn(const FObjectInitializer& ObjectInitial
AutoPossessPlayer
=
EAutoReceiveInput
::
Player0
;
// Necessary for receiving motion controller events.
AutoPossessPlayer
=
EAutoReceiveInput
::
Player0
;
// Necessary for receiving motion controller events.
Movement
=
CreateDefaultSubobject
<
UWalkingPawnMovement
>
(
TEXT
(
"WalkingMovement"
));
Walking
Movement
=
CreateDefaultSubobject
<
UWalkingPawnMovement
>
(
TEXT
(
"WalkingMovement"
));
Movement
->
SetUpdatedComponent
(
RootComponent
);
Walking
Movement
->
SetUpdatedComponent
(
RootComponent
);
Movement
->
SetCameraComponent
(
CameraComponent
);
Walking
Movement
->
SetCameraComponent
(
CameraComponent
);
RotatingMovement
=
CreateDefaultSubobject
<
URotatingMovementComponent
>
(
TEXT
(
"RotatingMovement"
));
RotatingMovement
=
CreateDefaultSubobject
<
URotatingMovementComponent
>
(
TEXT
(
"RotatingMovement"
));
RotatingMovement
->
UpdatedComponent
=
RootComponent
;
RotatingMovement
->
UpdatedComponent
=
RootComponent
;
...
@@ -210,10 +210,10 @@ void AVirtualRealityPawn::BeginPlay()
...
@@ -210,10 +210,10 @@ void AVirtualRealityPawn::BeginPlay()
if
(
SettingsActors
.
Num
()
>
0
)
if
(
SettingsActors
.
Num
()
>
0
)
{
{
ADisplayClusterSettings
*
Settings
=
Cast
<
ADisplayClusterSettings
>
(
SettingsActors
[
0
]);
ADisplayClusterSettings
*
Settings
=
Cast
<
ADisplayClusterSettings
>
(
SettingsActors
[
0
]);
Movement
->
MaxSpeed
=
Settings
->
MovementMaxSpeed
;
Walking
Movement
->
MaxSpeed
=
Settings
->
MovementMaxSpeed
;
Movement
->
Acceleration
=
Settings
->
MovementAcceleration
;
Walking
Movement
->
Acceleration
=
Settings
->
MovementAcceleration
;
Movement
->
Deceleration
=
Settings
->
MovementDeceleration
;
Walking
Movement
->
Deceleration
=
Settings
->
MovementDeceleration
;
Movement
->
TurningBoost
=
Settings
->
MovementTurningBoost
;
Walking
Movement
->
TurningBoost
=
Settings
->
MovementTurningBoost
;
BaseTurnRate
=
Settings
->
RotationSpeed
;
BaseTurnRate
=
Settings
->
RotationSpeed
;
}
}
...
@@ -277,6 +277,9 @@ void AVirtualRealityPawn::BeginPlay()
...
@@ -277,6 +277,9 @@ void AVirtualRealityPawn::BeginPlay()
CollisionComponent
->
SetCollisionProfileName
(
FName
(
"NoCollision"
));
CollisionComponent
->
SetCollisionProfileName
(
FName
(
"NoCollision"
));
CollisionComponent
->
SetCollisionEnabled
(
ECollisionEnabled
::
NoCollision
);
CollisionComponent
->
SetCollisionEnabled
(
ECollisionEnabled
::
NoCollision
);
//if the navigation mode was changed in the editor, it should be updated in the actual movement component
SetNavigationMode
(
NavigationMode
);
}
}
void
AVirtualRealityPawn
::
EndPlay
(
const
EEndPlayReason
::
Type
EndPlayReason
)
void
AVirtualRealityPawn
::
EndPlay
(
const
EEndPlayReason
::
Type
EndPlayReason
)
...
@@ -417,7 +420,7 @@ FTwoVectors AVirtualRealityPawn::GetHandRay(float Length)
...
@@ -417,7 +420,7 @@ FTwoVectors AVirtualRealityPawn::GetHandRay(float Length)
UPawnMovementComponent
*
AVirtualRealityPawn
::
GetMovementComponent
()
const
UPawnMovementComponent
*
AVirtualRealityPawn
::
GetMovementComponent
()
const
{
{
return
Movement
;
return
Walking
Movement
;
}
}
void
AVirtualRealityPawn
::
InitRoomMountedComponentReferences
()
void
AVirtualRealityPawn
::
InitRoomMountedComponentReferences
()
...
@@ -457,5 +460,6 @@ void AVirtualRealityPawn::InitRoomMountedComponentReferences()
...
@@ -457,5 +460,6 @@ void AVirtualRealityPawn::InitRoomMountedComponentReferences()
void
AVirtualRealityPawn
::
SetNavigationMode
(
EVRNavigationModes
Mode
)
void
AVirtualRealityPawn
::
SetNavigationMode
(
EVRNavigationModes
Mode
)
{
{
Movement
->
NavigationMode
=
Mode
;
NavigationMode
=
Mode
;
WalkingMovement
->
NavigationMode
=
Mode
;
}
}
This diff is collapsed.
Click to expand it.
Source/DisplayClusterExtensions/Public/VirtualRealityPawn.h
+
3
−
1
View file @
0fa38996
...
@@ -56,6 +56,8 @@ public:
...
@@ -56,6 +56,8 @@ public:
UFUNCTION
(
Category
=
"Pawn"
)
USceneComponent
*
GetTrackingOriginComponent
();
UFUNCTION
(
Category
=
"Pawn"
)
USceneComponent
*
GetTrackingOriginComponent
();
UFUNCTION
(
Category
=
"Pawn"
)
void
SetNavigationMode
(
EVRNavigationModes
Mode
);
UFUNCTION
(
Category
=
"Pawn"
)
void
SetNavigationMode
(
EVRNavigationModes
Mode
);
//we also add this property so the navigation mode can be changed easier in the editor, will get forwarded to the movment comp on BeginPlay
UPROPERTY
(
Category
=
"Pawn"
,
EditAnywhere
,
BlueprintReadOnly
)
EVRNavigationModes
NavigationMode
=
EVRNavigationModes
::
nav_mode_fly
;
private:
private:
UFUNCTION
(
Category
=
"Pawn"
)
USceneComponent
*
GetCaveCenterComponent
();
UFUNCTION
(
Category
=
"Pawn"
)
USceneComponent
*
GetCaveCenterComponent
();
...
@@ -78,7 +80,7 @@ protected:
...
@@ -78,7 +80,7 @@ protected:
virtual
UPawnMovementComponent
*
GetMovementComponent
()
const
override
;
virtual
UPawnMovementComponent
*
GetMovementComponent
()
const
override
;
UPROPERTY
(
EditAnywhere
,
BlueprintReadWrite
,
Category
=
"Pawn"
,
meta
=
(
AllowPrivateAccess
=
"true"
))
float
BaseTurnRate
=
45.0f
;
UPROPERTY
(
EditAnywhere
,
BlueprintReadWrite
,
Category
=
"Pawn"
,
meta
=
(
AllowPrivateAccess
=
"true"
))
float
BaseTurnRate
=
45.0f
;
UPROPERTY
(
VisibleAnywhere
,
BlueprintReadOnly
,
Category
=
"Pawn"
,
meta
=
(
AllowPrivateAccess
=
"true"
))
UWalkingPawnMovement
*
Movement
=
nullptr
;
UPROPERTY
(
VisibleAnywhere
,
BlueprintReadOnly
,
Category
=
"Pawn"
,
meta
=
(
AllowPrivateAccess
=
"true"
))
UWalkingPawnMovement
*
Walking
Movement
=
nullptr
;
UPROPERTY
(
VisibleAnywhere
,
BlueprintReadOnly
,
Category
=
"Pawn"
,
meta
=
(
AllowPrivateAccess
=
"true"
))
URotatingMovementComponent
*
RotatingMovement
=
nullptr
;
UPROPERTY
(
VisibleAnywhere
,
BlueprintReadOnly
,
Category
=
"Pawn"
,
meta
=
(
AllowPrivateAccess
=
"true"
))
URotatingMovementComponent
*
RotatingMovement
=
nullptr
;
// Use only when handling cross-device (PC, HMD, CAVE/ROLV) compatibility manually. CAVE/ROLV flystick.
// Use only when handling cross-device (PC, HMD, CAVE/ROLV) compatibility manually. CAVE/ROLV flystick.
...
...
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