lovr.headset.getSkeleton

Returns a list of joint poses tracked by a device. Currently, only hand devices are able to track joints.

poses = lovr.headset.getSkeleton(device)

Arguments

NameTypeDescription
deviceDeviceThe Device to query.

Returns

NameTypeDescription
posestableA list of joint poses for the device. Each pose is a table with 3 numbers for the position of the joint followed by 4 numbers for the angle/axis orientation of the joint.

poses = lovr.headset.getSkeleton(device, t)

Arguments

NameTypeDescription
deviceDeviceThe Device to query.
ttableA table to fill with the joint poses, instead of allocating a new one.

Returns

NameTypeDescription
posestableA list of joint poses for the device. Each pose is a table with 3 numbers for the position of the joint followed by 4 numbers for the angle/axis orientation of the joint.

Notes

If the Device does not support tracking joints or the poses are unavailable, nil is returned.

Hand joints are returned in the following order:

Joint Index
Palm 1
Wrist 2
Thumb Metacarpal 3
Proximal 4
Distal 5
Tip 6
Index Metacarpal 7
Proximal 8
Intermediate 9
Distal 10
Tip 11
Middle Metacarpal 12
Proximal 13
Intermediate 14
Distal 15
Tip 16
Ring Metacarpal 17
Proximal 18
Intermediate 19
Distal 20
Tip 21
Pinky Metacarpal 22
Proximal 23
Intermediate 24
Distal 25
Tip 26

Example

function lovr.draw()
  for _, hand in ipairs({ 'left', 'right' }) do
    for _, joint in ipairs(lovr.headset.getSkeleton(hand) or {}) do
      lovr.graphics.points(unpack(joint, 1, 3))
    end
  end
end

See also