webxr-hand-input icon indicating copy to clipboard operation
webxr-hand-input copied to clipboard

Bone capsule and distinguishing between joints and tips

Open Manishearth opened this issue 4 years ago • 5 comments

Whereas Microsoft's OpenXR extension supports a radius for each joint, Oculus' API makes a distinction between "skinnable" joints and non-skinnable ones (these are the tip "joints"). For the skinnable joints, it also supports a "bone capsule", which describes the joint as a cylinder:

// ovrBoneCapsule
//    _---_
//  -"     "-
// /         \
// |----A----|
// |    |    |
// |    |    |
// |    |-r->|
// |    |    |
// |    |    |
// |----B----|
// \         /
//  -.     .-
//    '---'
typedef struct ovrBoneCapsule_
{
	// Index of the bone this capsule is on.
	ovrHandBoneIndex 	BoneIndex;
	// Points at either end of the cylinder inscribed in the capsule. Also the center points for
	// spheres at either end of the capsule. Points A and B in the diagram above.
	ovrVector3f			Points[2];
	// The radius of the capsule cylinder and of the half-sphere caps on the ends of the capsule.
	float				Radius;
} ovrBoneCapsule;

Do we want to expose something like this?

Manishearth avatar Jan 03 '20 08:01 Manishearth

The bone capsule, as far as I can tell, is something you can theoretically derive by computing poses between spaces. So I don't think we have to expose it, but when available it might make things faster.

Manishearth avatar Jan 03 '20 08:01 Manishearth

Some context on the capsules from the Oculus API standpoint. We provide the capsules since they can't all be calculated from the bone positions & radius values. For instance the palm is actually represented by 4 capsules with translation offsets from the wrist, to represent a larger surface.

See attached images for reference; you can (just about) see that the palm consists of several capsules that are parallel; and their wrist ends don't line up with any bones.

If capsules are to be exposed from webxr hands, I'd suggest allowing multiple capsules to be defined per bone to allow this behavior.

hand-bones hand-capsules

leweaver avatar May 14 '20 00:05 leweaver

Is there a reason they're offset that way? Is this to provide a useful approximation to a hand mesh?

Manishearth avatar May 14 '20 15:05 Manishearth

The capsules are more of a physics engine helper. While Microsoft's OpenXR extension does define additional bones at the base of the wrist that would serve as a good substitute for the palm; our thumb capsule is offset slightly to better account for webbing between index and thumb.

leweaver avatar May 21 '20 22:05 leweaver

Hmm, seems like an Oculus implementation could similarly expose additional metacarpal joints instead of using a bone capsule here?

Ideally we'd also have hand mesh tracking as a spec but i'm not working on that right now (i'm interested in seeing it though!)

Manishearth avatar May 26 '20 17:05 Manishearth