More settings for eyebrow tracking.
This commit is contained in:
parent
d8d0b0bff0
commit
8d2df41d24
2 changed files with 20 additions and 2 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
|
@ -5,4 +5,4 @@ Samples/*
|
||||||
*.zip
|
*.zip
|
||||||
*.7z
|
*.7z
|
||||||
CSharp/*
|
CSharp/*
|
||||||
OpenSeeFaceDemo/*
|
VSeeFace/*
|
||||||
|
|
@ -48,6 +48,12 @@ public class OpenSeeVRMDriver : MonoBehaviour {
|
||||||
public float eyebrowStrength = 1.0f;
|
public float eyebrowStrength = 1.0f;
|
||||||
[Tooltip("This is the eyebrow smoothing factor, with 0 being no smoothing and 1 being fixed eyebrows.")]
|
[Tooltip("This is the eyebrow smoothing factor, with 0 being no smoothing and 1 being fixed eyebrows.")]
|
||||||
public float eyebrowSmoothing = 0.65f;
|
public float eyebrowSmoothing = 0.65f;
|
||||||
|
[Tooltip("This is the zero point of the eyebrow value. It can be used to offset the eyebrow tracking value.")]
|
||||||
|
[Range(-1, 1)]
|
||||||
|
public float eyebrowZero = 0.0f;
|
||||||
|
[Tooltip("This is the sensitivity of the eyebrow tracking, with 0 meaning no eyebrow movement.")]
|
||||||
|
[Range(0, 2)]
|
||||||
|
public float eyebrowSensitivity = 1.0f;
|
||||||
[Tooltip("This is the gaze smoothing factor, with 0 being no smoothing and 1 being a fixed gaze.")]
|
[Tooltip("This is the gaze smoothing factor, with 0 being no smoothing and 1 being a fixed gaze.")]
|
||||||
[Range(0, 1)]
|
[Range(0, 1)]
|
||||||
public float gazeSmoothing = 0.6f;
|
public float gazeSmoothing = 0.6f;
|
||||||
|
|
@ -356,7 +362,19 @@ public class OpenSeeVRMDriver : MonoBehaviour {
|
||||||
lastBrows = openSeeData.time;
|
lastBrows = openSeeData.time;
|
||||||
float upDownStrength = (openSeeData.features.EyebrowUpDownLeft + openSeeData.features.EyebrowUpDownRight) / 2f;
|
float upDownStrength = (openSeeData.features.EyebrowUpDownLeft + openSeeData.features.EyebrowUpDownRight) / 2f;
|
||||||
float stabilizer = 0.3f;
|
float stabilizer = 0.3f;
|
||||||
float magnitude = Mathf.Abs(upDownStrength - lastBrowUpDown);
|
if (eyebrowZero > 0) {
|
||||||
|
if (upDownStrength > eyebrowZero)
|
||||||
|
upDownStrength = (upDownStrength - eyebrowZero) / (1f - eyebrowZero);
|
||||||
|
else
|
||||||
|
upDownStrength = (upDownStrength - eyebrowZero) / (1f + eyebrowZero);
|
||||||
|
} else if (eyebrowZero < 0) {
|
||||||
|
if (upDownStrength < eyebrowZero)
|
||||||
|
upDownStrength = (upDownStrength - eyebrowZero) / (1f + eyebrowZero);
|
||||||
|
else
|
||||||
|
upDownStrength = (upDownStrength - eyebrowZero) / (1f - eyebrowZero);
|
||||||
|
}
|
||||||
|
|
||||||
|
float magnitude = Mathf.Clamp(Mathf.Abs(upDownStrength - lastBrowUpDown) * eyebrowSensitivity, -1f, 1f);
|
||||||
float factor = 1f;
|
float factor = 1f;
|
||||||
if (openSeeData.rawEuler.y < turnLeftBoundaryAngle || openSeeData.rawEuler.y > turnRightBoundaryAngle) {
|
if (openSeeData.rawEuler.y < turnLeftBoundaryAngle || openSeeData.rawEuler.y > turnRightBoundaryAngle) {
|
||||||
factor = 0.7f;
|
factor = 0.7f;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue