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
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.ThumbFingerProximalPhalanx the value stored is HandBoneId.ThumbFingerMetacarpal, at index 7 or HandBoneId.MiddleFingerProximalPhalanx is HandBoneId.WristRoot etc. At index zero (WristRoot) 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 five items, i.e. five HandBoneId values, in order: ThumbFingerMetacarpal, IndexFingerProximalPhalanx, MiddleFingerProximalPhalanx, RingFingerProximalPhalanx, PinkyFingerProximalPhalanx. All other entries, with the exception of entries for finger tip bones (last 5 elements in the list) contain a list with one HandBoneId in it. Entries for finger tip bones are empty lists
static readonly HandBoneKeyedReadOnlyCollection<ReadOnlyCollection<HandBoneId>> ChildRotatingBones
- This is mostly the same as ChildBones list, but with the finger tip bones excluded. To be more precise, finger tip bones in this list are not considered to be child bones of any bone, so they never appear in the entries in this collection. Note however that you can index into this list with finger tip bone identities, i.e. you can safely write the expression ChildRotatingBones[HandBoneId.PinkyFingerTip] in code, but like with ChildBones collection the returned value is an empty list
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) 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 the WristRoot
static bool IsRotatingBone(HandBoneId bone)
- Is the specified bone considered as rotating bone - true for every bone except for finger tip bones
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 - WristRoot is the only bone that is 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.