-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LookAt の整理 #2138
LookAt の整理 #2138
Conversation
@@ -51,46 +51,46 @@ public Vector3 ExternalForce | |||
} | |||
} | |||
|
|||
public Vrm10Runtime(Vrm10Instance target, bool useControlRig) | |||
public Vrm10Runtime(Vrm10Instance instance, bool useControlRig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
target が LookAt target と紛らわしいような気がしたので、名前変更。
@@ -229,10 +214,37 @@ public void Process() | |||
} | |||
|
|||
// 4. Gaze control | |||
LookAt.Process(m_target.LookAtTargetType, m_target.LookAtTarget); | |||
LookAtInput lookAtInput = default; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VrmAnimation により LookAt の入力が、
VrmAnimation
, Transform 追跡
、SetYawPitch の三択
になりました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
さらに変更。
Transform 追跡
は AutoBlink
的な感じ。
@@ -8,5 +9,6 @@ public interface IVrm10Animation : IDisposable | |||
(INormalizedPoseProvider, ITPoseProvider) ControlRig { get; } | |||
IReadOnlyDictionary<ExpressionKey, Func<float>> ExpressionMap { get; } | |||
public void ShowBoxMan(bool enable); | |||
LookAtInput? LookAt { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
VrmAnimation から LookAt を供給する。まだ入れ物だけ
/// 入力値。適宜更新可。 | ||
/// </summary> | ||
public LookAtInput LookAtInput { get; private set; } | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LookAtInput
を入力、 EyeDirection
を出力とした。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
よさそう
} | ||
|
||
/// <summary> | ||
/// Yaw/Pitch 値を直接設定します。 | ||
/// LookAtTargetTypes が SpecifiedTransform の場合、ここで設定しても値は上書きされます。 | ||
/// Vrm10Instance.LookAtTargetTypes が SpecifiedTransform の場合、ここで設定しても値は上書きされます。 | ||
/// </summary> | ||
/// <param name="yaw">Headボーンのforwardに対するyaw角(度)</param> | ||
/// <param name="pitch">Headボーンのforwardに対するpitch角(度)</param> | ||
public void SetYawPitchManually(float yaw, float pitch) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SetYawPitchManually()
は存続
/// <summary> | ||
/// 入力値。適宜更新可。 | ||
/// </summary> | ||
public LookAtInput LookAtInput { get; set; } | ||
|
||
/// <summary> | ||
/// 出力値。Process() のみが更新する | ||
/// </summary> | ||
public LookAtEyeDirection EyeDirection { get; private set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Vrm10RuntimeLookAt
は
LookAtInput
という「LookAt する対象」をユーザ入力として- それを
Process()
で処理し LookAtEyeDirection
という「実際に Bone や BlendShape といったILookAtEyeDirectionApplicable
が適用すべき LookAt の状態」を出力する
システムになる。
左目と右目の独立はまたの機会に・・・
/// NOTE: 何故か使われていない | ||
/// Pitch of RightEye | ||
/// </summary> | ||
public float RightPitch { get; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
今の段階では左右の目の YawPitch を区別する必要はない。
将来的にも規格レベルで解決するべきハードルが高いので、またいずれ……
参考:vrm-c/vrm-specification#177
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
LookAtInput を導入して、LookAt を整理。