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.
A Unity-based sample application that showcases Scene Understanding on HoloLens 2. When this sample is deployed on a HoloLens, it will show the virtual representation of your real environment. When this sample is deployed on a PC, it will load a serialized scene (included under Resources\SerializedScenesForPCPath) and display it.
Githubに色々注意書きがあるのですが、Unity 2018.4.12以上が必要になる他
Windows SDK version 10.0.18362.0以上も必要です。
また、これは、Mixed Realty Tookit Unity v2 とは全く関係無く。
Provides a solver that constrains the target to a region safe for hand constrained interactive content. This solver is intended to work with IMixedRealityHand but also works with IMixedRealityController. public class HandConstraint : Solver protected HandBounds handBounds protected IMixedRealityController trackedController When a hand is activated for tracking, should the cursor(s) be disabled on that hand?
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
This class handles the solver components that are attached to this GameObject public class SolverHandler : MonoBehaviour protected Handedness currentTrackedHandedness protected Handedness preferredTrackedHandedness protected readonly List solvers Add an additional offset of the tracked object to base the solver on. Useful for tracking something like a halo position above your head or off the side of a controller.
Solver HandlerのTracked Hand JointをPalm以外にも変更してみましたが、
OnFirstHandDetected、OnHandActivateの二つのイベントが実行されました。
しかし、これはUnity Editorで実行しているからかもしれませんね。
もしかしたら実機で、Tracked Hand JointをThumbTipにした場合、 親指を隠した状態で手を表示し、親指を立てたときのみ OnHandActivateが実行される可能性があるのでは?
と思ったのですが、Noneにしてもイベントが実行されました。
なので、おそらく、Tracked Hand Jointは、OnHandActivateの実行タイミングとは関係ないと考えています。
Tracked Hand Jointは、オブジェクトをトラッキングするときの位置のみに利用するのでしょう。
Making a Stress Ball Cast rays at objects and draw a debug lines. Convert forces to velocities for vertices. Maintain shape with springs and dampening. Compensate for object transformation. We start with a scene that has a single cube sphere object at its center.
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