Class Leap::PhysicalHands::ContactBone

class Leap.PhysicalHands.ContactBone : public MonoBehaviour

Subclassed by Leap.PhysicalHands.HardContactBone, Leap.PhysicalHands.NoContactBone, Leap.PhysicalHands.SoftContactBone

Public Functions

bool IsBoneContactingRigid (Rigidbody rigid)

Determine if this ContactBone is touching a given Rigidbody

Param rigid

The rigidbody to check

Return

Whether the bone is contacting the given RigidBody

Properties

int Finger { get; set; }

Finger: 0 = thumb 1 = index 2 = middle 3 = ring 4 = pinky 5 = palm

int Joint { get; set; }

Joint: 0 = proximal 1 = intermediate 2 = distal

Dictionary<Rigidbody, Dictionary<Collider, ClosestColliderDirection>> NearbyObjects { get; set; }

summary> Dictionary of dictionaries of the directions from this bone to a grabbable object’s colliders /summary>

HashSet<Rigidbody> GrabbableObjects { get; set; }

Objects that can be grabbed, not ones that are

HashSet<Rigidbody> GrabbedObjects { get; set; }

Objects that are currently grabbed according to the grasp helper

bool IsBoneGrabbing { get; set; } = false

Whether the grasp helper has reported that this bone is grabbing. If a bone further towards the tip is reported as grabbing, then this bone will also be.

float NearestObjectDistance { get; set; }

Will report float.MaxValue if IsHovering is false

class ClosestColliderDirection

Public Members

bool isContactingCollider

Is this bone contacting the collider associated with this ClosestColliderDirection?

Vector3 bonePos = Vector3.zero

The closest position on the hovering bone

Vector3 direction = Vector3.zero

The direction from the closest pos on the bone to the closest pos on the collider

float distance = 0f

Distance from the edge of the bone