Hand Skeleton Configuration
Class in OctoXR that exposes certain constant/read-only values pertaining to the configuration of a hand skeleton, such as list of all hand bone identities, the number of hand bones in a hand skeleton etc.
Public fields
const int BoneCount
Number of all unique hand bones in a hand skeleton (26)
const HandBoneId FirstBoneId
Identity of the hand bone that comes first in every ordered list of hand bones or objects indexed by hand bone identity. This corresponds to Wrist
const HandBoneId FirstFingerBoneId
Identity of the finger bone that comes first in every ordered list of hand bones or objects indexed by hand bone identity. This corresponds to ThumbMetacarpal bone
const HandBoneId LastBoneId
Identity of the hand bone that appears last in every ordered list of hand bones or objects indexed by hand bone identity. This corresponds to LittleTip
const int FingerCount
Number of fingers in a hand skeleton (5)
static readonly ReadOnlyCollection<HandBoneId> Bones
A read-only collection that lists the identities of all unique hand bones ordered by their ID number/index. Basically this is HandBoneId enumeration converted to a list representation
static readonly HandBoneKeyedReadOnlyCollection<HandBoneId?> ParentBones
A read-only collection that lists the identities of parent bones for every bone that corresponds to the index into this list. This list can be indexed by zero-based integer or a HandBoneId. For example at index 2 or HandBoneId.ThumbProximal the value stored is HandBoneId.ThumbMetacarpal, at index 7 or HandBoneId.MiddleProximal is HandBoneId.MiddleMetacarpal etc. At index zero (Wrist) is null, hence the nullable HandBoneId type of items is used
static readonly HandBoneKeyedReadOnlyCollection<ReadOnlyCollection<HandBoneId>> ChildBones
A read-only collection that lists the identities of child bones for every bone that corresponds to the index into this list. Like ParentBones field, this list can be indexed by zero-based integer or a HandBoneId. Every entry into this list is a read-only list (indexed by a zero-based integer) of identities for every child bone of the corresponding hand bone. For example at index zero (WristRoot) is a list that contains six items, i.e. six HandBoneId values, in order: Palm, ThumbMetacarpal, IndexMetacarpal, MiddleMetacarpal, RingMetacarpal, LittleMetacarpal. All other entries, with the exception of Palm and entries for finger tip bones contain a list with one HandBoneId in it. Entries for Palm and finger tip bones are empty lists
static readonly HandBoneKeyedReadOnlyCollection<ReadOnlyCollection<HandBoneId>> ChildRotatingBones
This is mostly the same as ChildBones list, but with certain bones excluded - namely the ones that aren't considered to ever rotate, such as finger tips as well as Palm, IndexMetacarpal, MiddleMetacarpal, RingMetacarpal and LittleMetacarpal
static readonly ReadOnlyCollection<HandFinger> Fingers
List of hand fingers in a hand skeleton. Similar to Bones collection this is HandFinger enumeration in its list form
HandFingerKeyedReadOnlyCollection<ReadOnlyCollection<HandBoneId>> FingerBones
Collection of hand bones grouped by the finger they are attached to. Can be indexed with zero-based integer or a HandFinger. Every entry is a list indexed by a zero-based integer of identities of hand bones that belong the corresponding hand finger, meaning every entry is a list of 4 items in total
HandFingerKeyedReadOnlyCollection<ReadOnlyCollection<HandBoneId>> FingerRotatingBones
Same as FingerBones, but non-rotating bones (finger tips, palm and non-thumb metacarpals) are excluded, so every entry is a list of 3 HandBoneId items
Public methods
static bool IsFingerBone(HandBoneId bone)
Is the specified hand bone part of a finger - true for every bone except for Wrist and Palm
static bool IsRotatingBone(HandBoneId bone)
Is the specified bone considered as rotating bone
static bool IsFingerTipBone(HandBoneId bone)
Is the specified bone one of the finger tip bones
static HandFinger? GetBoneFinger(HandBoneId bone)
Returns the hand finger that the specified bone is a part of, or null if the bone is not a part of any finger - Wrist and Palm are only bones that are not part of a finger
Additional notes
HandSkeletonConfiguration is a static class that contains hard-coded constant values and methods used throughout OctoXR. This class represents a source of truth when reasoning about hand skeleton and its structure and values defined in it are considered to be valid and reliable, meaning there is never any kind of validation performed on them by consuming code - they are taken as they are.
Last updated