Class Leap::HandModelBase

class Leap.HandModelBase : public MonoBehaviour

HandModelBase defines abstract methods as a template for building hand models. It allows you to receive tracking data for a left or right hand and it can be extended to drive hand visuals or physics representations of hands.

A HandModelBase will automatically subscribe and receive tracking data if there is a provider in the scene. The provider can be overridden (leapProvider).

Subclassed by Leap.CapsuleHand, Leap.DebugHand, Leap.HandModel, Leap.HandsModule.HandBinder

Public Functions

virtual void InitHand ()

Implement this function to initialise this hand after it is created. This function is called when a new hand is detected by the Tracking Service.

virtual void BeginHand ()

Called after hand is initialised. Calls the event OnBegin and sets isTracked to true.

virtual abstract void UpdateHand ()

Called once per frame when the LeapProvider calls the event OnUpdateFrame (graphics hand) or OnFixedFrame (physics hand)

void UpdateHandWithEvent ()

Calls UpdateHand() and calls the event OnUpdate.

virtual void FinishHand ()

Called when the hand is not detected anymore in the current frame. Calls the event OnFinish and sets isTracked to false.

virtual abstract Hand GetLeapHand ()

Returns the Leap Hand object represented by this HandModelBase. Note that any physical quantities and directions obtained from the Leap Hand object are relative to the Leap coordinate system, which uses a right-handed axes and units of millimeters.

Return

virtual abstract void SetLeapHand (Hand hand)

Assigns a Leap Hand object to this HandModelBase.

Param hand

virtual bool SupportsEditorPersistence ()

Returns whether or not this hand model supports editor persistence. This is false by default and must be opt-in by a developer making their own hand model script if they want editor persistence.

Properties

bool IsTracked { get; set; }

Reports whether the hand is detected and tracked in the current frame. It is set to true after the event OnBegin and set to false after the event OnFinish

abstractChirality Handedness { get; set; }

The chirality or handedness of this hand (left or right).

abstractModelType HandModelType { get; set; }

The type of the Hand model (graphics or physics).

LeapProvider leapProvider { get; set; }

Optionally set a Leap Provider to use for tracking frames. If you do not set one, the first provider found in the scene will be used. If no provider is found this gameobject will disable itself.

Events

event Action OnBegin

Called directly after HandModelBase’s InitHand().

event Action OnFinish

Called when hand is not detected anymore in the current frame.

event Action OnUpdate

Called when hand model is active and updated with new data.