本文整理汇总了C#中Vertices.forceCounterClockWise方法的典型用法代码示例。如果您正苦于以下问题:C# Vertices.forceCounterClockWise方法的具体用法?C# Vertices.forceCounterClockWise怎么用?C# Vertices.forceCounterClockWise使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vertices
的用法示例。
在下文中一共展示了Vertices.forceCounterClockWise方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setVerticesNoCopy
/// <summary>
/// sets the vertices without copying over the data from verts to the local List.
/// </summary>
/// <param name="verts">Verts.</param>
public void setVerticesNoCopy( Vertices verts )
{
Debug.Assert( verts.Count >= 3 && verts.Count <= Settings.maxPolygonVertices );
_vertices = verts;
if( Settings.useConvexHullPolygons )
{
// FPE note: This check is required as the GiftWrap algorithm early exits on triangles
// So instead of giftwrapping a triangle, we just force it to be clock wise.
if( _vertices.Count <= 3 )
_vertices.forceCounterClockWise();
else
_vertices = GiftWrap.getConvexHull( _vertices );
}
if( _normals == null )
_normals = new Vertices( _vertices.Count );
else
_normals.Clear();
// Compute normals. Ensure the edges have non-zero length.
for( var i = 0; i < _vertices.Count; ++i )
{
var next = i + 1 < _vertices.Count ? i + 1 : 0;
var edge = _vertices[next] - _vertices[i];
Debug.Assert( edge.LengthSquared() > Settings.epsilon * Settings.epsilon );
// FPE optimization: Normals.Add(MathHelper.Cross(edge, 1.0f));
var temp = new Vector2( edge.Y, -edge.X );
temp.Normalize();
_normals.Add( temp );
}
// Compute the polygon mass data
computeProperties();
}