< GeeXLab Reference Guide />

> Back to Reference Guide Index


gh_leap library

Description

gh_leap is the module that manages the Leap Motion device.


Number of functions: 11

  1. gh_leap.get_device_name (Lua - Python)
  2. gh_leap.get_finger_bone_direction (Lua - Python)
  3. gh_leap.get_finger_bone_position (Lua - Python)
  4. gh_leap.get_hand_palm_angles (Lua - Python)
  5. gh_leap.get_hand_palm_normal (Lua - Python)
  6. gh_leap.get_hand_palm_position (Lua - Python)
  7. gh_leap.get_num_devices (Lua - Python)
  8. gh_leap.get_num_fingers (Lua - Python)
  9. gh_leap.get_num_hands (Lua - Python)
  10. gh_leap.is_connected (Lua - Python)
  11. gh_leap.update (Lua - Python)



get_device_name

Description

Returns the name of a particular device.


Syntax

name = gh_leap.get_device_name(
 index
)

Languages

Lua - Python


Parameters


Return Values


Code sample


name = gh_leap.get_device_name(0)
            


get_finger_bone_direction

Description

Gets the vector direction of a bone of a particular finger.


Syntax

dir_x, dir_y, dir_z = gh_leap.get_finger_bone_direction(
 hand_index,
 finguer_index,
 bone_index
)

Languages

Lua - Python


Parameters


Return Values


Code sample


dir_x, dir_y, dir_z = gh_leap.get_finger_bone_direction(hand_index, finger_index, bone_index)
            


get_finger_bone_position

Description

Gets the position of a bone of a particular finger.


Syntax

start_x, start_y, start_z, end_x, end_y, end_z = gh_leap.get_finger_bone_position(
 hand_index,
 finguer_index,
 bone_index
)

Languages

Lua - Python


Parameters


Return Values


Code sample


start_x, start_y, start_z, end_x, end_y, end_z = gh_leap.get_finger_bone_position(hand_index, finger_index, bone_index)
            


get_hand_palm_angles

Description

Gets the plam euler angles for a particular hand.


Syntax

pitch, yaw, roll = gh_leap.get_hand_palm_angles(
 hand_index
)

Languages

Lua - Python


Parameters


Return Values


Code sample


pitch, yaw, roll = gh_leap.get_hand_palm_angles(hand)
            


get_hand_palm_normal

Description

Gets the plam normal vector for a particular hand.


Syntax

x, y, z = gh_leap.get_hand_palm_normal(
 hand_index
)

Languages

Lua - Python


Parameters


Return Values


Code sample


x,y,z = gh_leap.get_hand_palm_normal(hand)
            


get_hand_palm_position

Description

Gets the plam position for a particular hand.


Syntax

x, y, z = gh_leap.get_hand_palm_position(
 hand_index
)

Languages

Lua - Python


Parameters


Return Values


Code sample


x,y,z = gh_leap.get_hand_palm_position(hand)
            


get_num_devices

Description

Returns the number of devices.


Syntax

n = gh_leap.get_num_devices()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


n = gh_leap.get_num_devices()
            


get_num_fingers

Description

Returns the numbers of fingers for a particular hand.


Syntax

fingers = gh_leap.get_num_fingers(
 hand_index
)

Languages

Lua - Python


Parameters


Return Values


Code sample


fingers = gh_leap.get_num_fingers(hand)
            


get_num_hands

Description

Returns the numbers of hands.


Syntax

hands = gh_leap.get_num_hands()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


hands = gh_leap.get_num_hands()
            


is_connected

Description

Checks if a LeapMotion device is connected.


Syntax

ret = gh_leap.is_connected()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values


Code sample


state = gh_leap.is_connected()
            


update

Description

Updates the Leap Motion engine. Call it once per frame.


Syntax

gh_leap.update()

Languages

Lua - Python


Parameters

This function has no input parameter(s).


Return Values

This function has no return value(s).


Code sample


gh_leap.update()
            






GeeXLab Rootard Guide | Downloads | Contact | Newsletter