本文整理汇总了C#中Vertex.CoordinatesEquals方法的典型用法代码示例。如果您正苦于以下问题:C# Vertex.CoordinatesEquals方法的具体用法?C# Vertex.CoordinatesEquals怎么用?C# Vertex.CoordinatesEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vertex
的用法示例。
在下文中一共展示了Vertex.CoordinatesEquals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetLocalWidth
private float GetLocalWidth(Vertex point, Vertex v1, Vertex v2,float w1,float w2)
{
if (v1.CoordinatesEquals(v2))
{
Debug.Log("same points!");
Debug.Log(v1);
Debug.Log(v2);
return 0;
}
//project point on line v1-v2
/////WTF? why is it here?
//Vertex projectedP = fmc.ProjectPointOnLine(point, fmc.GetGeneralLineEquation(v1, v2));
//measure distance to v1 and v2
float dist1 = fmc.GetDistanceBetweenPoints(point, v1);
float dist2 = fmc.GetDistanceBetweenPoints(point, v2);
//Debug.Log(dist1);
//Debug.Log(dist2);
//map values to give total sum of 1
float factor = dist1 + dist2;
float factor1 = (factor - dist1) / factor;
float factor2 = (factor - dist2) / factor;
//Debug.Log(factor);
//Debug.Log(factor1);
//Debug.Log(factor2);
//return sum of given widths multiplied by calculated factors
return w1 * factor1 + w2*factor2;
}