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
0d76172a
Commit
0d76172a
authored
1 year ago
by
David Gilbert
Browse files
Options
Downloads
Patches
Plain Diff
style(utilities): const correctness & return statements
parent
a9757405
No related branches found
No related tags found
1 merge request
!53
refactor(utilities): Cleanup virtual reality utilities
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp
+30
-16
30 additions, 16 deletions
...RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp
with
30 additions
and
16 deletions
Source/RWTHVRToolkit/Private/Utility/VirtualRealityUtilities.cpp
+
30
−
16
View file @
0d76172a
...
@@ -44,7 +44,8 @@ bool UVirtualRealityUtilities::IsHeadMountedMode()
...
@@ -44,7 +44,8 @@ bool UVirtualRealityUtilities::IsHeadMountedMode()
bool
UVirtualRealityUtilities
::
IsCave
()
bool
UVirtualRealityUtilities
::
IsCave
()
{
{
#if PLATFORM_SUPPORTS_NDISPLAY
#if PLATFORM_SUPPORTS_NDISPLAY
if
(
!
IsRoomMountedMode
())
return
false
;
if
(
!
IsRoomMountedMode
())
return
false
;
const
UDisplayClusterConfigurationData
*
ClusterConfig
=
IDisplayCluster
::
Get
().
GetConfigMgr
()
->
GetConfig
();
const
UDisplayClusterConfigurationData
*
ClusterConfig
=
IDisplayCluster
::
Get
().
GetConfigMgr
()
->
GetConfig
();
return
ClusterConfig
->
CustomParameters
.
Contains
(
"Hardware_Platform"
)
return
ClusterConfig
->
CustomParameters
.
Contains
(
"Hardware_Platform"
)
...
@@ -57,7 +58,8 @@ bool UVirtualRealityUtilities::IsCave()
...
@@ -57,7 +58,8 @@ bool UVirtualRealityUtilities::IsCave()
bool
UVirtualRealityUtilities
::
IsRolv
()
bool
UVirtualRealityUtilities
::
IsRolv
()
{
{
#if PLATFORM_SUPPORTS_NDISPLAY
#if PLATFORM_SUPPORTS_NDISPLAY
if
(
!
IsRoomMountedMode
())
return
false
;
if
(
!
IsRoomMountedMode
())
return
false
;
const
UDisplayClusterConfigurationData
*
ClusterConfig
=
IDisplayCluster
::
Get
().
GetConfigMgr
()
->
GetConfig
();
const
UDisplayClusterConfigurationData
*
ClusterConfig
=
IDisplayCluster
::
Get
().
GetConfigMgr
()
->
GetConfig
();
return
ClusterConfig
->
CustomParameters
.
Contains
(
"Hardware_Platform"
)
return
ClusterConfig
->
CustomParameters
.
Contains
(
"Hardware_Platform"
)
...
@@ -109,7 +111,7 @@ float UVirtualRealityUtilities::GetEyeDistance()
...
@@ -109,7 +111,7 @@ float UVirtualRealityUtilities::GetEyeDistance()
else
else
{
{
#if PLATFORM_SUPPORTS_NDISPLAY
#if PLATFORM_SUPPORTS_NDISPLAY
ADisplayClusterRootActor
*
RootActor
=
IDisplayCluster
::
Get
().
GetGameMgr
()
->
GetRootActor
();
const
ADisplayClusterRootActor
*
RootActor
=
IDisplayCluster
::
Get
().
GetGameMgr
()
->
GetRootActor
();
return
(
RootActor
)
?
RootActor
->
GetDefaultCamera
()
->
GetInterpupillaryDistance
()
:
0.0f
;
return
(
RootActor
)
?
RootActor
->
GetDefaultCamera
()
->
GetInterpupillaryDistance
()
:
0.0f
;
#else
#else
return
0.0f
;
return
0.0f
;
...
@@ -120,7 +122,7 @@ float UVirtualRealityUtilities::GetEyeDistance()
...
@@ -120,7 +122,7 @@ float UVirtualRealityUtilities::GetEyeDistance()
EEyeStereoOffset
UVirtualRealityUtilities
::
GetNodeEyeType
()
EEyeStereoOffset
UVirtualRealityUtilities
::
GetNodeEyeType
()
{
{
#if PLATFORM_SUPPORTS_NDISPLAY
#if PLATFORM_SUPPORTS_NDISPLAY
ADisplayClusterRootActor
*
RootActor
=
IDisplayCluster
::
Get
().
GetGameMgr
()
->
GetRootActor
();
const
ADisplayClusterRootActor
*
RootActor
=
IDisplayCluster
::
Get
().
GetGameMgr
()
->
GetRootActor
();
return
static_cast
<
EEyeStereoOffset
>
((
RootActor
)
return
static_cast
<
EEyeStereoOffset
>
((
RootActor
)
?
RootActor
->
GetDefaultCamera
()
->
GetStereoOffset
()
?
RootActor
->
GetDefaultCamera
()
->
GetStereoOffset
()
:
EDisplayClusterEyeStereoOffset
::
None
);
:
EDisplayClusterEyeStereoOffset
::
None
);
...
@@ -143,21 +145,33 @@ USceneComponent* UVirtualRealityUtilities::GetNamedClusterComponent(const ENamed
...
@@ -143,21 +145,33 @@ USceneComponent* UVirtualRealityUtilities::GetNamedClusterComponent(const ENamed
{
{
switch
(
Component
)
switch
(
Component
)
{
{
case
ENamedClusterComponent
::
NCC_CAVE_ORIGIN
:
return
GetClusterComponent
(
"cave_origin"
);
case
ENamedClusterComponent
::
NCC_CAVE_ORIGIN
:
case
ENamedClusterComponent
::
NCC_CAVE_CENTER
:
return
GetClusterComponent
(
"cave_center"
);
return
GetClusterComponent
(
"cave_origin"
);
case
ENamedClusterComponent
::
NCC_CAVE_LHT
:
return
GetClusterComponent
(
"left_hand_target"
);
case
ENamedClusterComponent
::
NCC_CAVE_CENTER
:
case
ENamedClusterComponent
::
NCC_CAVE_RHT
:
return
GetClusterComponent
(
"right_hand_target"
);
return
GetClusterComponent
(
"cave_center"
);
case
ENamedClusterComponent
::
NCC_SHUTTERGLASSES
:
return
GetClusterComponent
(
"shutter_glasses"
);
case
ENamedClusterComponent
::
NCC_CAVE_LHT
:
case
ENamedClusterComponent
::
NCC_ROLV_ORIGIN
:
return
GetClusterComponent
(
"rolv_origin"
);
return
GetClusterComponent
(
"left_hand_target"
);
case
ENamedClusterComponent
::
NCC_FLYSTICK
:
return
GetClusterComponent
(
"flystick"
);
case
ENamedClusterComponent
::
NCC_CAVE_RHT
:
case
ENamedClusterComponent
::
NCC_CALIBRATIO
:
return
GetClusterComponent
(
"calibratio"
);
return
GetClusterComponent
(
"right_hand_target"
);
case
ENamedClusterComponent
::
NCC_SHUTTERGLASSES
:
return
GetClusterComponent
(
"shutter_glasses"
);
case
ENamedClusterComponent
::
NCC_ROLV_ORIGIN
:
return
GetClusterComponent
(
"rolv_origin"
);
case
ENamedClusterComponent
::
NCC_FLYSTICK
:
return
GetClusterComponent
(
"flystick"
);
case
ENamedClusterComponent
::
NCC_CALIBRATIO
:
return
GetClusterComponent
(
"calibratio"
);
case
ENamedClusterComponent
::
NCC_TRACKING_ORIGIN
:
case
ENamedClusterComponent
::
NCC_TRACKING_ORIGIN
:
USceneComponent
*
Result
;
USceneComponent
*
Result
;
if
((
Result
=
GetClusterComponent
(
"cave_origin"
)))
return
Result
;
if
((
Result
=
GetClusterComponent
(
"cave_origin"
)))
if
((
Result
=
GetClusterComponent
(
"rolv_origin"
)))
return
Result
;
return
Result
;
if
((
Result
=
GetClusterComponent
(
"tdw_origin_floor"
)))
return
Result
;
if
((
Result
=
GetClusterComponent
(
"rolv_origin"
)))
return
Result
;
if
((
Result
=
GetClusterComponent
(
"tdw_origin_floor"
)))
return
Result
;
return
nullptr
;
default:
return
nullptr
;
return
nullptr
;
default:
return
nullptr
;
}
}
}
}
...
...
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