ManoMotion Unity SDK 2.0
SDK documentation
All Classes Namespaces Files Functions Variables Enumerations Enumerator Properties Events Pages
ManoMotion.SkeletonManager Class Reference

Handles the visualization of the skeleton joints.

Inheritance diagram for ManoMotion.SkeletonManager:

Public Member Functions

Quaternion GetHandRotation (int handIndex)
 Returns pure hand rotation value.
 
GameObject GetJoint (int handIndex, int jointIndex)
 Returns a specific skeleton joint.
 
List< GameObject > GetJoints (int handIndex)
 Returns all joints of the specified hand (0-1).
 

Static Public Attributes

static UnityEvent OnSkeletonChanged = new UnityEvent()
 

Properties

static SkeletonManager Instance [get]
 
bool ShouldShowSkeleton [get, set]
 

Private Member Functions

void Awake ()
 
void OnEnable ()
 
void OnDisable ()
 
void CreateSkeletonParent ()
 
void CreateOneEuroFilters ()
 Creates a OneEuroFilter for each of the joints.
 
void ChangeSkeletonModel (SkeletonModel skeleton)
 Changes the current skeleton model for a new one.
 
void Update ()
 
void UpdateJointsPosition (ref List< GameObject > skeletonJoints, HandInfo handInfo, List< OneEuroFilter< Vector3 > > oneEuroFiltersToApply, OneEuroFilter< Vector2 > depthFilter)
 
void UpdateJointsOrientation (ref List< GameObject > listToModify, HandInfo handInfo, int handIndex)
 Updates the orientation of the joints according to the orientation given by the SDK.
 
void FadeSkeletonJoints (Renderer[] renderers, HandInfo handInfo)
 Fade the skeleton materials when no hand is detected.
 

Private Attributes

bool shouldShowSkeleton = true
 
GameObject skeletonPrefab2D
 
GameObject skeletonPrefab3D
 
List< GameObject > joints = new List<GameObject>(new GameObject[21])
 The list of joints used for visualization.
 
List< GameObject > jointsSecond = new List<GameObject>(new GameObject[21])
 
float skeletonConfidenceThreshold = 0.0001f
 Skeleton confidence.
 
GameObject skeletonParent
 
GameObject skeletonModel
 
GameObject skeletonModelSecond
 
Renderer[] renderers
 
Renderer[] renderersSecond
 
OneEuroFilterSetting positionFilterSetting = new OneEuroFilterSetting(120, 0.0001f, 500f, 1f)
 
OneEuroFilterSetting depthFilterSetting = new OneEuroFilterSetting(120, 0.0001f, 500f, 1f)
 
List< OneEuroFilter< Vector3 > > positionFilter = new List<OneEuroFilter<Vector3>>()
 
List< OneEuroFilter< Vector3 > > positionFilterSecond = new List<OneEuroFilter<Vector3>>()
 
OneEuroFilter< Vector2 >[] handDepthFilters = new OneEuroFilter<Vector2>[2]
 
Quaternion[] handRotations = new Quaternion[2]
 

Static Private Attributes

const float FadeTime = 0.5f
 
const int JointsLength = 21
 
static SkeletonManager instance
 

Member Function Documentation

◆ Awake()

void ManoMotion.SkeletonManager.Awake ( )
inlineprivate

◆ ChangeSkeletonModel()

void ManoMotion.SkeletonManager.ChangeSkeletonModel ( SkeletonModel skeleton)
inlineprivate
Parameters
skeletonType of skeleton (2D or 3D)

◆ CreateOneEuroFilters()

void ManoMotion.SkeletonManager.CreateOneEuroFilters ( )
inlineprivate

◆ CreateSkeletonParent()

void ManoMotion.SkeletonManager.CreateSkeletonParent ( )
inlineprivate

◆ FadeSkeletonJoints()

void ManoMotion.SkeletonManager.FadeSkeletonJoints ( Renderer[] renderers,
HandInfo handInfo )
inlineprivate
Parameters
renderersThe renderers of the skeleton model
handInfothe hand info using the skeleton model

◆ GetHandRotation()

Quaternion ManoMotion.SkeletonManager.GetHandRotation ( int handIndex)
inline

◆ GetJoint()

GameObject ManoMotion.SkeletonManager.GetJoint ( int handIndex,
int jointIndex )
inline

◆ GetJoints()

List< GameObject > ManoMotion.SkeletonManager.GetJoints ( int handIndex)
inline
Parameters
handIndexSpecific hand, corresponds to same index in ManoMotionManager handInfos.

◆ OnDisable()

void ManoMotion.SkeletonManager.OnDisable ( )
inlineprivate

◆ OnEnable()

void ManoMotion.SkeletonManager.OnEnable ( )
inlineprivate

◆ Update()

void ManoMotion.SkeletonManager.Update ( )
inlineprivate

◆ UpdateJointsOrientation()

void ManoMotion.SkeletonManager.UpdateJointsOrientation ( ref List< GameObject > listToModify,
HandInfo handInfo,
int handIndex )
inlineprivate

◆ UpdateJointsPosition()

void ManoMotion.SkeletonManager.UpdateJointsPosition ( ref List< GameObject > skeletonJoints,
HandInfo handInfo,
List< OneEuroFilter< Vector3 > > oneEuroFiltersToApply,
OneEuroFilter< Vector2 > depthFilter )
inlineprivate

Member Data Documentation

◆ depthFilterSetting

OneEuroFilterSetting ManoMotion.SkeletonManager.depthFilterSetting = new OneEuroFilterSetting(120, 0.0001f, 500f, 1f)
private

◆ FadeTime

const float ManoMotion.SkeletonManager.FadeTime = 0.5f
staticprivate

◆ handDepthFilters

OneEuroFilter<Vector2> [] ManoMotion.SkeletonManager.handDepthFilters = new OneEuroFilter<Vector2>[2]
private

◆ handRotations

Quaternion [] ManoMotion.SkeletonManager.handRotations = new Quaternion[2]
private

◆ instance

SkeletonManager ManoMotion.SkeletonManager.instance
staticprivate

◆ joints

List<GameObject> ManoMotion.SkeletonManager.joints = new List<GameObject>(new GameObject[21])
private

◆ JointsLength

const int ManoMotion.SkeletonManager.JointsLength = 21
staticprivate

◆ jointsSecond

List<GameObject> ManoMotion.SkeletonManager.jointsSecond = new List<GameObject>(new GameObject[21])
private

◆ OnSkeletonChanged

UnityEvent ManoMotion.SkeletonManager.OnSkeletonChanged = new UnityEvent()
static

◆ positionFilter

List<OneEuroFilter<Vector3> > ManoMotion.SkeletonManager.positionFilter = new List<OneEuroFilter<Vector3>>()
private

◆ positionFilterSecond

List<OneEuroFilter<Vector3> > ManoMotion.SkeletonManager.positionFilterSecond = new List<OneEuroFilter<Vector3>>()
private

◆ positionFilterSetting

OneEuroFilterSetting ManoMotion.SkeletonManager.positionFilterSetting = new OneEuroFilterSetting(120, 0.0001f, 500f, 1f)
private

◆ renderers

Renderer [] ManoMotion.SkeletonManager.renderers
private

◆ renderersSecond

Renderer [] ManoMotion.SkeletonManager.renderersSecond
private

◆ shouldShowSkeleton

bool ManoMotion.SkeletonManager.shouldShowSkeleton = true
private

◆ skeletonConfidenceThreshold

float ManoMotion.SkeletonManager.skeletonConfidenceThreshold = 0.0001f
private

◆ skeletonModel

GameObject ManoMotion.SkeletonManager.skeletonModel
private

◆ skeletonModelSecond

GameObject ManoMotion.SkeletonManager.skeletonModelSecond
private

◆ skeletonParent

GameObject ManoMotion.SkeletonManager.skeletonParent
private

◆ skeletonPrefab2D

GameObject ManoMotion.SkeletonManager.skeletonPrefab2D
private

◆ skeletonPrefab3D

GameObject ManoMotion.SkeletonManager.skeletonPrefab3D
private

Property Documentation

◆ Instance

SkeletonManager ManoMotion.SkeletonManager.Instance
staticget

◆ ShouldShowSkeleton

bool ManoMotion.SkeletonManager.ShouldShowSkeleton
getset