The goal of Scene understanding is to transform the un-structured environment sensor data that your Mixed Reality device captures and to convert it into a powerful but abstracted representation that is intuitive and easy to develop for. The SDK acts as the communication layer between your application and the Scene Understanding runtime.
HandConstraint.csは、Provides a solver that constrains the target to a region safe for hand constrained interactive content.
つまり、手の領域にあるオブジェクトに対して制約をつけて、手が見えたり隠れたりするときにイベントを実行するScriptです。
HandConstraint.csにはOnFirstHandDetected、OnHandActivate、OnHandDeactivate、
OnHandDeactivateというイベントが定義されています。
OnFirstHandDetectedは、Event which is triggered when zero hands to one hand is tracked.
日本語に直すとゼロ本の手の片手がトラッキングされたときにトリガーとなるイベント
OnHandActivateは、Event which is triggered when a hand begins being tracked.
手がトラッキング開始されたときにトリガーとなるイベント
OnHandDeactivateは、Event which is triggered when a hand stops being tracked.
手がトラッキング終了されたときにトリガーとなるイベント
OnLastHandLostは、Event which is triggered when all hands are lost.
すべての手がトラッキングが失われたきにトリガーとなるイベント
自分のメモ用にまとめておきます。
プロジェクトの作成、
Microsoft.MixedReality.Toolkit.Unity.Foundation.2.1.0.unitypackageのインポート
UnityのMixed Relaity ToolkitメニューからAdd to Scene and Configureを選択する等はいつも通り行ってください。
わからない方は、以前の記事を参考にしてください。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Solver HandlerのTracked Hand JointをPalm以外にも変更してみましたが、
OnFirstHandDetected、OnHandActivateの二つのイベントが実行されました。
しかし、これはUnity Editorで実行しているからかもしれませんね。
もしかしたら実機で、Tracked Hand JointをThumbTipにした場合、 親指を隠した状態で手を表示し、親指を立てたときのみ OnHandActivateが実行される可能性があるのでは?
と思ったのですが、Noneにしてもイベントが実行されました。
なので、おそらく、Tracked Hand Jointは、OnHandActivateの実行タイミングとは関係ないと考えています。
Tracked Hand Jointは、オブジェクトをトラッキングするときの位置のみに利用するのでしょう。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters