Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Character Plugin
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
Character Plugin
Commits
7fab33e6
Commit
7fab33e6
authored
Jan 22, 2022
by
Klara Tyroller
Browse files
Options
Downloads
Patches
Plain Diff
mimick delay in eye movement implemented
parent
4eb49c53
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Source/CharacterPlugin/Private/VHListenerBackchannels.cpp
+52
-0
52 additions, 0 deletions
Source/CharacterPlugin/Private/VHListenerBackchannels.cpp
Source/CharacterPlugin/Public/VHListenerBackchannels.h
+3
-0
3 additions, 0 deletions
Source/CharacterPlugin/Public/VHListenerBackchannels.h
with
55 additions
and
0 deletions
Source/CharacterPlugin/Private/VHListenerBackchannels.cpp
+
52
−
0
View file @
7fab33e6
...
@@ -417,8 +417,58 @@ FRotator UVHListenerBackchannels::MyFindLookAtRotaion(FVector Start, FVector Tar
...
@@ -417,8 +417,58 @@ FRotator UVHListenerBackchannels::MyFindLookAtRotaion(FVector Start, FVector Tar
void
UVHListenerBackchannels
::
GazeController
(
FRotator
HeadRotation
)
void
UVHListenerBackchannels
::
GazeController
(
FRotator
HeadRotation
)
{
{
float
TimePassed
=
GetWorld
()
->
GetRealTimeSeconds
();
FVector
point
=
GetPlayerLookAtTarget
(
10000
);
FVector
point
=
GetPlayerLookAtTarget
(
10000
);
if
(
chameleon
)
{
if
(
in_VH_FieldofView
(
point
,
HeadRotation
))
{
EyeMimickQueue
.
push
(
point
);
}
else
{
EyeMimickQueue
.
push
(
FVector
(
0.0
,
0.0
,
0.0
));
}
if
(
TimePassed
>
mimick_delay
)
{
if
(
EyeMimickQueue
.
front
()
==
FVector
(
0.0
,
0.0
,
0.0
))
{
EyeMimickQueue
.
pop
();
SetEyeLookAtTarget
(
Player_vr_pawn
->
Head
->
GetComponentLocation
(),
HeadRotation
,
true
);
SetEyeLookAtTarget
(
Player_vr_pawn
->
Head
->
GetComponentLocation
(),
HeadRotation
,
false
);
}
else
{
point
=
EyeMimickQueue
.
front
();
EyeMimickQueue
.
pop
();
SetEyeLookAtTarget
(
point
,
HeadRotation
,
true
);
SetEyeLookAtTarget
(
point
,
HeadRotation
,
false
);
}
}
else
{
SetEyeLookAtTarget
(
Player_vr_pawn
->
Head
->
GetComponentLocation
(),
HeadRotation
,
true
);
SetEyeLookAtTarget
(
Player_vr_pawn
->
Head
->
GetComponentLocation
(),
HeadRotation
,
false
);
}
}
else
{
if
(
in_VH_FieldofView
(
point
,
HeadRotation
))
{
SetEyeLookAtTarget
(
GetPlayerLookAtTarget
(
10000
),
HeadRotation
,
true
);
SetEyeLookAtTarget
(
GetPlayerLookAtTarget
(
10000
),
HeadRotation
,
false
);
}
else
{
SetEyeLookAtTarget
(
Player_vr_pawn
->
Head
->
GetComponentLocation
(),
HeadRotation
,
true
);
SetEyeLookAtTarget
(
Player_vr_pawn
->
Head
->
GetComponentLocation
(),
HeadRotation
,
false
);
}
}
/*
if (in_VH_FieldofView(point,HeadRotation ))
if (in_VH_FieldofView(point,HeadRotation ))
{
{
SetEyeLookAtTarget(GetPlayerLookAtTarget(10000), HeadRotation, true);
SetEyeLookAtTarget(GetPlayerLookAtTarget(10000), HeadRotation, true);
...
@@ -429,6 +479,7 @@ void UVHListenerBackchannels::GazeController(FRotator HeadRotation)
...
@@ -429,6 +479,7 @@ void UVHListenerBackchannels::GazeController(FRotator HeadRotation)
SetEyeLookAtTarget(Player_vr_pawn->Head->GetComponentLocation(), HeadRotation, true);
SetEyeLookAtTarget(Player_vr_pawn->Head->GetComponentLocation(), HeadRotation, true);
SetEyeLookAtTarget(Player_vr_pawn->Head->GetComponentLocation(), HeadRotation, false);
SetEyeLookAtTarget(Player_vr_pawn->Head->GetComponentLocation(), HeadRotation, false);
}
}
*/
}
}
...
@@ -436,6 +487,7 @@ bool UVHListenerBackchannels::in_VH_FieldofView(FVector Point, FRotator HeadRota
...
@@ -436,6 +487,7 @@ bool UVHListenerBackchannels::in_VH_FieldofView(FVector Point, FRotator HeadRota
{
{
FRotator
LookAtTargetRot
=
LookAtTarget
(
Point
);
FRotator
LookAtTargetRot
=
LookAtTarget
(
Point
);
FRotator
difference
=
LookAtTargetRot
-
HeadRotation
;
FRotator
difference
=
LookAtTargetRot
-
HeadRotation
;
//if ((abs(difference.Yaw) > 107.0) || (abs(difference.Roll) > 70.0))
if
((
abs
(
difference
.
Yaw
)
>
107.0
)
||
(
abs
(
difference
.
Roll
)
>
70.0
))
if
((
abs
(
difference
.
Yaw
)
>
107.0
)
||
(
abs
(
difference
.
Roll
)
>
70.0
))
{
{
return
false
;
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Source/CharacterPlugin/Public/VHListenerBackchannels.h
+
3
−
0
View file @
7fab33e6
...
@@ -60,8 +60,11 @@ private:
...
@@ -60,8 +60,11 @@ private:
float
BlinkValue
=
0.0
;
float
BlinkValue
=
0.0
;
float
mimick_delay
=
4.0
;
//in s
float
mimick_delay
=
4.0
;
//in s
std
::
queue
<
FRotator
>
MimickQueue
;
std
::
queue
<
FRotator
>
MimickQueue
;
std
::
queue
<
FVector
>
EyeMimickQueue
;
std
::
array
<
FRotator
,
50
>
a1
=
{
FRotator
(
0.0
,
0.0
,
0.0
)};
std
::
array
<
FRotator
,
50
>
a1
=
{
FRotator
(
0.0
,
0.0
,
0.0
)};
int
counter
=
0
;
int
counter
=
0
;
std
::
array
<
FVector
,
50
>
a2
=
{
FVector
(
0.0
,
0.0
,
0.0
)
};
//int counter2 = 0;
FRotator
NodRotator
=
FRotator
(
0.0f
,
0.0f
,
0.0f
);
FRotator
NodRotator
=
FRotator
(
0.0f
,
0.0f
,
0.0f
);
...
...
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