本文整理汇总了C#中IFrame.Finger方法的典型用法代码示例。如果您正苦于以下问题:C# IFrame.Finger方法的具体用法?C# IFrame.Finger怎么用?C# IFrame.Finger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IFrame
的用法示例。
在下文中一共展示了IFrame.Finger方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Direction
/// <summary>
/// Calculate the direction vector of the movement perming by the finger from the startFrame frame to the endFrame frame.
/// </summary>
/// <param name="pointableId">The id of the finger performing the movement.</param>
/// <param name="startFrame">The frame containing the start position of the direction vector.</param>
/// <param name="endFrame">The frame containing the end position of the direction vector.</param>
/// <returns>The direction vector.</returns>
public static Vector Direction(int pointableId, IFrame startFrame, IFrame endFrame)
{
Vector startPosition = startFrame.Finger(pointableId).TipPosition;
Vector endPosition = endFrame.Finger(pointableId).TipPosition;
return (endPosition - startPosition);
}
示例2: Speed
/// <summary>
/// Calculate the speed of the finger between the startFrame frame and the endFrame frame in mm/s.
/// </summary>
/// <param name="finger">The finger which we want to calculate the speed.</param>
/// <param name="startFrame">The start frame.</param>
/// <param name="endFrame">The end frame.</param>
/// <returns>The speed in mm/s.</returns>
public static float Speed(int pointableId, IFrame startFrame, IFrame endFrame)
{
Vector startPosition = startFrame.Finger(pointableId).TipPosition;
Vector endPosition = endFrame.Finger(pointableId).TipPosition;
return ((endPosition - startPosition).Magnitude / (endFrame.Timestamp - startFrame.Timestamp)) * 1000000; // mm/s
}