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
2dc017ba
Commit
2dc017ba
authored
Oct 23, 2023
by
Jonathan Ehret
Browse files
Options
Downloads
Patches
Plain Diff
make desktop hand movement configurable
parent
2b47149f
Branches
Branches containing commit
No related tags found
1 merge request
!33
extract rotation movement to reduce code duplication
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp
+10
-2
10 additions, 2 deletions
Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp
Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h
+6
-0
6 additions, 0 deletions
Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h
with
16 additions
and
2 deletions
Source/RWTHVRToolkit/Private/Pawn/VirtualRealityPawn.cpp
+
10
−
2
View file @
2dc017ba
...
@@ -93,9 +93,17 @@ void AVirtualRealityPawn::UpdateRightHandForDesktopInteraction()
...
@@ -93,9 +93,17 @@ void AVirtualRealityPawn::UpdateRightHandForDesktopInteraction()
FVector
MouseLocation
,
MouseDirection
;
FVector
MouseLocation
,
MouseDirection
;
PC
->
DeprojectMousePositionToWorld
(
MouseLocation
,
MouseDirection
);
PC
->
DeprojectMousePositionToWorld
(
MouseLocation
,
MouseDirection
);
FRotator
HandOrientation
=
MouseDirection
.
ToOrientationRotator
();
FRotator
HandOrientation
=
MouseDirection
.
ToOrientationRotator
();
if
(
bMoveRightHandWithMouse
)
{
RightHand
->
SetWorldRotation
(
HandOrientation
);
RightHand
->
SetWorldRotation
(
HandOrientation
);
RightHand
->
SetRelativeLocation
(
HeadCameraComponent
->
GetRelativeLocation
());
RightHand
->
SetRelativeLocation
(
HeadCameraComponent
->
GetRelativeLocation
());
}
}
if
(
bMoveLeftHandWithMouse
)
{
LeftHand
->
SetWorldRotation
(
HandOrientation
);
LeftHand
->
SetRelativeLocation
(
HeadCameraComponent
->
GetRelativeLocation
());
}
}
}
}
void
AVirtualRealityPawn
::
SetCameraOffset
()
const
void
AVirtualRealityPawn
::
SetCameraOffset
()
const
...
...
This diff is collapsed.
Click to expand it.
Source/RWTHVRToolkit/Public/Pawn/VirtualRealityPawn.h
+
6
−
0
View file @
2dc017ba
...
@@ -41,6 +41,12 @@ public:
...
@@ -41,6 +41,12 @@ public:
UPROPERTY
(
VisibleAnywhere
,
BlueprintReadOnly
,
Category
=
"Pawn|Camera"
)
UPROPERTY
(
VisibleAnywhere
,
BlueprintReadOnly
,
Category
=
"Pawn|Camera"
)
UCameraComponent
*
HeadCameraComponent
;
UCameraComponent
*
HeadCameraComponent
;
UPROPERTY
(
EditAnywhere
,
BlueprintReadWrite
,
Category
=
"Pawn|Desktop Movement"
)
bool
bMoveRightHandWithMouse
=
true
;
UPROPERTY
(
EditAnywhere
,
BlueprintReadWrite
,
Category
=
"Pawn|Desktop Movement"
)
bool
bMoveLeftHandWithMouse
=
false
;
protected:
protected:
virtual
void
SetupPlayerInputComponent
(
UInputComponent
*
PlayerInputComponent
)
override
;
virtual
void
SetupPlayerInputComponent
(
UInputComponent
*
PlayerInputComponent
)
override
;
...
...
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