Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
Widget Interaction Plugin
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
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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LuFG VR VIS
VR-Group
Unreal-Development
Plugins
Widget Interaction Plugin
Commits
13fcd5a3
Commit
13fcd5a3
authored
6 years ago
by
Jonathan Wendt
Browse files
Options
Downloads
Patches
Plain Diff
add desktop interaction
parent
67cf10cf
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/WidgetInteraction/Private/WidgetInteraction.cpp
+59
-38
59 additions, 38 deletions
Source/WidgetInteraction/Private/WidgetInteraction.cpp
with
59 additions
and
38 deletions
Source/WidgetInteraction/Private/WidgetInteraction.cpp
+
59
−
38
View file @
13fcd5a3
...
...
@@ -2,6 +2,8 @@
#include
"WidgetInteraction.h"
#include
"HeadMountedDisplayFunctionLibrary.h"
#include
"IDisplayCluster.h"
#include
"IDisplayClusterClusterManager.h"
#include
"Engine.h"
#define LOCTEXT_NAMESPACE "FWidgetInteractionModule"
...
...
@@ -21,9 +23,14 @@ void FWidgetInteractionModule::OnWorldTickStart(ELevelTick level_tick, float val
{
auto
worlds
=
GEngine
->
GetWorldContexts
();
if
(
widget_interaction_cmp_
!=
nullptr
&&
widget_interaction_cmp_
->
IsValidLowLevel
()
==
true
)
if
(
widget_interaction_cmp_
!=
nullptr
)
{
if
(
widget_interaction_cmp_
->
IsValidLowLevel
()
==
true
)
{
return
;
}
else
{
widget_interaction_cmp_
=
nullptr
;
}
}
for
(
auto
&
world_context
:
worlds
)
{
...
...
@@ -36,14 +43,28 @@ void FWidgetInteractionModule::OnWorldTickStart(ELevelTick level_tick, float val
if
(
vr_pawn
==
nullptr
)
continue
;
FString
name
=
FString
(
"flystick"
);
auto
component_class
=
UMotionControllerComponent
::
StaticClass
();
if
(
UHeadMountedDisplayFunctionLibrary
::
IsHeadMountedDisplayEnabled
())
{
FString
name
=
""
;
UClass
*
component_class
=
UMotionControllerComponent
::
StaticClass
();
if
(
IDisplayCluster
::
Get
().
GetClusterMgr
()
->
IsStandalone
())
{
//if this is a standalone setup ...
if
(
UHeadMountedDisplayFunctionLibrary
::
IsHeadMountedDisplayEnabled
())
{
//.. with an HMD, we attach the intercation component to the right hand
name
=
FString
(
"RightMotionController"
);
component_class
=
UMotionControllerComponent
::
StaticClass
();
}
else
{
//... without an HMD, we also attach it to the virtual right hand, since it exists in this case
name
=
TEXT
(
"RightMotionController"
);
component_class
=
UMotionControllerComponent
::
StaticClass
();
}
}
else
{
//if this is a cluster setup we attach it to the flystick
name
=
TEXT
(
"flystick"
);
component_class
=
UMotionControllerComponent
::
StaticClass
();
}
auto
parent_vec
=
vr_pawn
->
GetComponentsByClass
(
component_class
);
for
(
auto
parent
:
parent_vec
)
...
...
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