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
612e8e2d
Commit
612e8e2d
authored
Nov 3, 2023
by
David Gilbert
Browse files
Options
Downloads
Patches
Plain Diff
refactor(navigation): const correctness & brief code cleanup
parent
1df731ff
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!43
refactor(movement): extracts turning logic from MovementCommponentBase to own Component
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp
+5
-8
5 additions, 8 deletions
...e/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp
Source/RWTHVRToolkit/Public/Pawn/Navigation/TurnComponent.h
+1
-1
1 addition, 1 deletion
Source/RWTHVRToolkit/Public/Pawn/Navigation/TurnComponent.h
with
6 additions
and
9 deletions
Source/RWTHVRToolkit/Private/Pawn/Navigation/TurnComponent.cpp
+
5
−
8
View file @
612e8e2d
...
...
@@ -124,20 +124,17 @@ void UTurnComponent::OnBeginSnapTurn(const FInputActionValue& Value)
}
void
UTurnComponent
::
RotateCameraAndPawn
(
float
Yaw
)
void
UTurnComponent
::
RotateCameraAndPawn
(
float
Yaw
)
const
{
FVector
NewLocation
;
FRotator
NewRotation
;
FVector
OrigLocation
=
VRPawn
->
GetActorLocation
();
const
FVector
OrigLocation
=
VRPawn
->
GetActorLocation
();
FVector
PivotPoint
=
VRPawn
->
GetActorTransform
().
InverseTransformPosition
(
OrigLocation
);
PivotPoint
.
Z
=
0.0f
;
FRotator
OrigRotation
=
VRPawn
->
GetActorRotation
();
const
FRotator
OrigRotation
=
VRPawn
->
GetActorRotation
();
NewRotation
=
FRotator
(
0
,
VRPawn
->
GetActorRotation
().
Yaw
+
Yaw
,
0
);
const
FRotator
NewRotation
=
FRotator
(
0
,
VRPawn
->
GetActorRotation
().
Yaw
+
Yaw
,
0
);
NewLocation
=
OrigLocation
+
OrigRotation
.
RotateVector
(
PivotPoint
);
const
FVector
NewLocation
=
OrigLocation
+
OrigRotation
.
RotateVector
(
PivotPoint
);
VRPawn
->
Controller
->
SetControlRotation
(
NewRotation
);
VRPawn
->
SetActorLocationAndRotation
(
NewLocation
,
NewRotation
);
...
...
This diff is collapsed.
Click to expand it.
Source/RWTHVRToolkit/Public/Pawn/Navigation/TurnComponent.h
+
1
−
1
View file @
612e8e2d
...
...
@@ -74,6 +74,6 @@ private:
* If we just use VRPawn->AddControllerYawInput(Yaw), rotation is around tracking origin instead of the actual player position
* This function updates the pawns rotation and location to result in a rotation around the users tracked position.
*/
void
RotateCameraAndPawn
(
float
Yaw
);
void
RotateCameraAndPawn
(
float
Yaw
)
const
;
bool
bApplyDesktopRotation
;
};
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