Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
DasherVR
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
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
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
DasherVR
Commits
118b7985
Commit
118b7985
authored
10 months ago
by
Sebastian Pape
Browse files
Options
Downloads
Patches
Plain Diff
Using different EventIDs for different purposes
parent
3142c8a5
Branches
Branches containing commit
No related tags found
1 merge request
!2
Backporting many features from the study on top of the Dasher3D-Core
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/DasherVR/Private/SDasherWidget.cpp
+14
-24
14 additions, 24 deletions
Source/DasherVR/Private/SDasherWidget.cpp
Source/DasherVR/Public/SDasherWidget.h
+1
-1
1 addition, 1 deletion
Source/DasherVR/Public/SDasherWidget.h
with
15 additions
and
25 deletions
Source/DasherVR/Private/SDasherWidget.cpp
+
14
−
24
View file @
118b7985
...
...
@@ -60,11 +60,9 @@ FReply SDasherWidget::HandleMouseDownEvent(const FGeometry& Geometry, const FPoi
if
(
URWTHVRUtilities
::
IsRoomMountedMode
())
{
FDisplayClusterClusterEventBinary
ClusterEvent
;
ClusterEvent
.
EventId
=
DasherEventID
;
ClusterEvent
.
EventData
.
SetNumUninitialized
(
1
);
ClusterEvent
.
EventData
[
0
]
=
static_cast
<
uint8
>
(
DasherEventType
::
Input_MouseDown
);
ClusterEvent
.
EventId
=
DasherEventID
+
static_cast
<
uint8
>
(
DasherEventType
::
Input_MouseDown
);
IDisplayCluster
::
Get
().
GetClusterMgr
()
->
EmitClusterEventBinary
(
ClusterEvent
,
false
);
UE_LOG
(
LogTemp
,
Log
,
TEXT
(
"MouseDownSend"
));
return
FReply
::
Handled
().
LockMouseToWidget
(
AsShared
());
}
...
...
@@ -84,9 +82,7 @@ FReply SDasherWidget::HandleMouseUpEvent(const FGeometry& Geometry, const FPoint
if
(
URWTHVRUtilities
::
IsRoomMountedMode
())
{
FDisplayClusterClusterEventBinary
ClusterEvent
;
ClusterEvent
.
EventId
=
DasherEventID
;
ClusterEvent
.
EventData
.
SetNumUninitialized
(
1
);
ClusterEvent
.
EventData
[
0
]
=
static_cast
<
uint8
>
(
DasherEventType
::
Input_MouseUp
);
ClusterEvent
.
EventId
=
ClusterEvent
.
EventId
=
DasherEventID
+
static_cast
<
uint8
>
(
DasherEventType
::
Input_MouseUp
);
IDisplayCluster
::
Get
().
GetClusterMgr
()
->
EmitClusterEventBinary
(
ClusterEvent
,
false
);
return
FReply
::
Handled
().
ReleaseMouseLock
();
}
...
...
@@ -110,9 +106,7 @@ FReply SDasherWidget::HandleMouseDoubleClickEvent(const FGeometry& Geometry, con
if
(
URWTHVRUtilities
::
IsRoomMountedMode
())
{
FDisplayClusterClusterEventBinary
ClusterEvent
;
ClusterEvent
.
EventId
=
DasherEventID
;
ClusterEvent
.
EventData
.
SetNumUninitialized
(
1
);
ClusterEvent
.
EventData
[
0
]
=
static_cast
<
uint8
>
(
DasherEventType
::
Input_MouseDown
);
ClusterEvent
.
EventId
=
ClusterEvent
.
EventId
=
DasherEventID
+
static_cast
<
uint8
>
(
DasherEventType
::
Input_MouseDown
);
IDisplayCluster
::
Get
().
GetClusterMgr
()
->
EmitClusterEventBinary
(
ClusterEvent
,
false
);
return
FReply
::
Handled
();
}
...
...
@@ -146,13 +140,12 @@ bool SDasherWidget::GetScreenCoords(screenint& iX, screenint& iY, Dasher::CDashe
void
SDasherWidget
::
HandleClusterEvent
(
const
FDisplayClusterClusterEventBinary
&
Event
)
{
if
(
Event
.
EventId
!=
DasherEventID
)
return
;
switch
(
static_cast
<
DasherEventType
>
(
Event
.
EventData
[
0
]))
switch
(
static_cast
<
DasherEventType
>
(
Event
.
EventId
-
DasherEventID
))
{
case
DasherEventType
::
Input_MouseDown
:
DasherMainInterface
->
KeyDown
(
FDateTime
::
Now
().
GetSecond
()
+
FDateTime
::
Now
().
GetMillisecond
(),
Dasher
::
Keys
::
Primary_Input
);
MouseDownListeners
.
ExecuteIfBound
();
UE_LOG
(
LogTemp
,
Log
,
TEXT
(
"MouseDownReceived"
));
break
;
case
DasherEventType
::
Input_MouseUp
:
DasherMainInterface
->
KeyUp
(
FDateTime
::
Now
().
GetSecond
()
+
FDateTime
::
Now
().
GetMillisecond
(),
Dasher
::
Keys
::
Primary_Input
);
...
...
@@ -161,9 +154,9 @@ void SDasherWidget::HandleClusterEvent(const FDisplayClusterClusterEventBinary&
case
DasherEventType
::
Tick
:
double
currentTime
=
0
;
FMemory
::
Memcpy
(
&
currentTime
,
&
Event
.
EventData
[
1
]
,
sizeof
(
currentTime
));
FMemory
::
Memcpy
(
&
CursorPosition
.
x
,
&
Event
.
EventData
[
1
]
+
sizeof
(
currentTime
),
sizeof
(
CursorPosition
.
x
));
FMemory
::
Memcpy
(
&
CursorPosition
.
y
,
&
Event
.
EventData
[
1
]
+
sizeof
(
currentTime
)
+
sizeof
(
CursorPosition
.
x
),
sizeof
(
CursorPosition
.
y
));
FMemory
::
Memcpy
(
&
currentTime
,
Event
.
EventData
.
GetData
()
,
sizeof
(
currentTime
));
FMemory
::
Memcpy
(
&
CursorPosition
.
x
,
Event
.
EventData
.
GetData
()
+
sizeof
(
currentTime
),
sizeof
(
CursorPosition
.
x
));
FMemory
::
Memcpy
(
&
CursorPosition
.
y
,
Event
.
EventData
.
GetData
()
+
sizeof
(
currentTime
)
+
sizeof
(
CursorPosition
.
x
),
sizeof
(
CursorPosition
.
y
));
DasherMainInterface
->
Tick
(
static_cast
<
unsigned
long
>
(
currentTime
*
1000.0
));
break
;
...
...
@@ -305,16 +298,13 @@ void SDasherWidget::Tick(const FGeometry& AllottedGeometry, const double InCurre
else
if
(
URWTHVRUtilities
::
IsPrimaryNode
())
{
UE_LOG
(
LogTemp
,
Log
,
TEXT
(
"EventSend: %d, %d"
),
CursorPosition
.
x
,
CursorPosition
.
y
);
FDisplayClusterClusterEventBinary
ClusterEvent
;
ClusterEvent
.
EventId
=
DasherEventID
;
ClusterEvent
.
EventData
.
SetNumUninitialized
(
sizeof
(
InCurrentTime
)
+
sizeof
(
CursorPosition
.
x
)
+
sizeof
(
CursorPosition
.
y
)
+
1
);
ClusterEvent
.
EventId
=
ClusterEvent
.
EventId
=
DasherEventID
+
static_cast
<
uint8
>
(
DasherEventType
::
Tick
)
;
ClusterEvent
.
EventData
.
SetNumUninitialized
(
sizeof
(
InCurrentTime
)
+
sizeof
(
CursorPosition
.
x
)
+
sizeof
(
CursorPosition
.
y
));
ClusterEvent
.
EventData
[
0
]
=
static_cast
<
uint8
>
(
DasherEventType
::
Tick
);
FMemory
::
Memcpy
(
&
ClusterEvent
.
EventData
[
1
],
&
InCurrentTime
,
sizeof
(
InCurrentTime
));
FMemory
::
Memcpy
(
&
ClusterEvent
.
EventData
[
1
]
+
sizeof
(
InCurrentTime
),
&
CursorPosition
.
x
,
sizeof
(
CursorPosition
.
x
));
FMemory
::
Memcpy
(
&
ClusterEvent
.
EventData
[
1
]
+
sizeof
(
InCurrentTime
)
+
sizeof
(
CursorPosition
.
x
),
&
CursorPosition
.
y
,
sizeof
(
CursorPosition
.
y
));
FMemory
::
Memcpy
(
ClusterEvent
.
EventData
.
GetData
(),
&
InCurrentTime
,
sizeof
(
InCurrentTime
));
FMemory
::
Memcpy
(
ClusterEvent
.
EventData
.
GetData
()
+
sizeof
(
InCurrentTime
),
&
CursorPosition
.
x
,
sizeof
(
CursorPosition
.
x
));
FMemory
::
Memcpy
(
ClusterEvent
.
EventData
.
GetData
()
+
sizeof
(
InCurrentTime
)
+
sizeof
(
CursorPosition
.
x
),
&
CursorPosition
.
y
,
sizeof
(
CursorPosition
.
y
));
IDisplayCluster
::
Get
().
GetClusterMgr
()
->
EmitClusterEventBinary
(
ClusterEvent
,
false
);
}
...
...
This diff is collapsed.
Click to expand it.
Source/DasherVR/Public/SDasherWidget.h
+
1
−
1
View file @
118b7985
...
...
@@ -175,7 +175,7 @@ private:
//CAVE Sync
FOnClusterEventBinaryListener
ClusterEventListener
;
inline
static
int32
DasherEventID
=
42424
2
;
inline
static
int32
DasherEventID
=
42424
0
;
protected
:
// stores color information
...
...
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