isFist property

bool get isFist

Whether the hand is making a fist (all tips close to palm).

Implementation

bool get isFist {
  final palm = palmPosition;
  if (palm == null) return false;

  final tips = [
    HandJoint.indexTip,
    HandJoint.middleTip,
    HandJoint.ringTip,
    HandJoint.littleTip,
  ];

  for (final tip in tips) {
    final pos = joints[tip];
    if (pos == null || (pos - palm).length > 0.05) return false;
  }
  return true;
}