本文整理汇总了C#中Quaternion.IsNaN方法的典型用法代码示例。如果您正苦于以下问题:C# Quaternion.IsNaN方法的具体用法?C# Quaternion.IsNaN怎么用?C# Quaternion.IsNaN使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Quaternion
的用法示例。
在下文中一共展示了Quaternion.IsNaN方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalculateBodyData
/// <summary>
/// Using a markerset, calculates the needed data
/// </summary>
/// <param name="markers">The set of the markers</param>
/// <param name="chestOrientation">An quaternion representing the orientation of the chest</param>
public void CalculateBodyData(Dictionary<string, Vector3> markers, Quaternion chestOrientation)
{
// set chest depth
var currentNeckToChestVector = (markers[m.chest] - markers[m.neck]);
if (!currentNeckToChestVector.IsNaN() && !chestOrientation.IsNaN())
{
NeckToChestVector =
(NeckToChestVector * chestsFrames
+ Vector3.Transform(currentNeckToChestVector, Quaternion.Invert(chestOrientation)))
/ (++chestsFrames);
}
// set shoulder width
float tmp = (markers[m.leftShoulder] - markers[m.rightShoulder]).Length * 500; // to mm half the width
if (!float.IsNaN(tmp))// && tmp < 500)
{
ShoulderWidth = (ShoulderWidth * shoulderFrames + tmp) / (++shoulderFrames);
}
// height and mass
tmp = ( (markers[m.rightOuterAnkle] - markers[m.rightOuterKnee]).LengthFast +
(markers[m.rightOuterKnee] - markers[m.rightHip]).LengthFast +
(markers[m.bodyBase] - markers[m.neck]).LengthFast +
(markers[m.neck] - markers[m.head]).LengthFast
) * 100; // cm
if (!float.IsNaN(tmp) && tmp < 250)
{
Height = (Height * heightFrames + tmp) / (++heightFrames);
Mass = (Height / 100) * (Height / 100) * BMI; // BMI
}
}