Added manual look and blink control

Added ability to override "random" look, blink, and behaviour change operation, so that look direction and blink can be set with, e.g. a joystick control.
This commit is contained in:
alastaira
2023-09-18 15:47:47 +01:00
parent 6392643a2b
commit 17412d86cc
4 changed files with 100 additions and 61 deletions

View File

@@ -27,6 +27,7 @@ void LookAssistant::LookAt(float x, float y)
float scaleY_x;
float scaleY_y;
// What is this witchcraft...?!
moveX_x = -25 * x;
moveY_x = -3 * x;
moveY_y = 20 * y;
@@ -51,18 +52,14 @@ void LookAssistant::LookAt(float x, float y)
_face.LeftEye.Transformation.Animation.Restart();
}
void LookAssistant::Update()
{
void LookAssistant::Update() {
Timer.Update();
if (Timer.IsExpired())
{
if (Timer.IsExpired()) {
Timer.Reset();
auto x = random(-50, 50);
auto y = random(-50, 50);
LookAt((float)x / 100, (float)y / 100);
}
}