/******************************************************************************
* Copyright (C) Ultraleap, Inc. 2011-2021. *
* *
* Use subject to the terms of the Apache License 2.0 available at *
* http://www.apache.org/licenses/LICENSE-2.0, or another agreement *
* between Ultraleap and you, your company or other organization. *
******************************************************************************/
using UnityEngine;
namespace Leap
{
using System;
///
/// The Arm class represents the forearm.
///
[Serializable]
public class Arm : Bone, IEquatable
{
///
/// Constructs a default Arm object.
/// Get valid Arm objects from a Hand object.
///
/// @since 2.0.3
///
public Arm() : base() { }
///
/// Constructs a new Arm object.
/// @since 3.0
///
[System.Obsolete("This signature will be removed in the next major version of the plugin. Use the one with Vector3 and Quaternion instead.")]
public Arm(Vector elbow,
Vector wrist,
Vector center,
Vector direction,
float length,
float width,
LeapQuaternion rotation)
: base(elbow,
wrist,
center,
direction,
length,
width,
BoneType.TYPE_METACARPAL, //ignored for arms
rotation)
{ }
///
/// Constructs a new Arm object.
///
public Arm(Vector3 elbow,
Vector3 wrist,
Vector3 center,
Vector3 direction,
float length,
float width,
Quaternion rotation)
: base(elbow,
wrist,
center,
direction,
length,
width,
BoneType.TYPE_METACARPAL, //ignored for arms
rotation)
{ }
///
/// Compare Arm object equality.
/// Two Arm objects are equal if and only if both Arm objects represent the
/// exact same physical arm in the same frame and both Arm objects are valid.
/// @since 2.0.3
///
public bool Equals(Arm other)
{
return Equals(other as Bone);
}
///
/// A string containing a brief, human readable description of the Arm object.
/// @since 2.0.3
///
public override string ToString()
{
return "Arm";
}
///
/// The position of the elbow.
/// If not in view, the elbow position is estimated based on typical human
/// anatomical proportions.
///
/// @since 2.0.3
///
[System.Obsolete("Its type will be changed from Vector to Vector3")]
public Vector ElbowPosition
{
get
{
return base.PrevJoint;
}
}
///
/// The position of the wrist.
///
/// Note that the wrist position is not collocated with the end of any bone in
/// the hand. There is a gap of a few centimeters since the carpal bones are
/// not included in the skeleton model.
///
/// @since 2.0.3
///
[System.Obsolete("Its type will be changed from Vector to Vector3")]
public Vector WristPosition
{
get
{
return base.NextJoint;
}
}
}
}