public CreateChain ( |
||
vertices | an array of vertices, these are copied | |
count | int | the vertex count |
리턴 | void |
public void CreateChain(Vec2[] vertices, int count)
{
Debug.Assert(Vertices == null && Count == 0);
Debug.Assert(count >= 2);
Count = count;
Vertices = new Vec2[Count];
for (int i = 0; i < Count; i++)
{
Vertices[i] = new Vec2(vertices[i]);
}
HasPrevVertex = false;
HasNextVertex = false;
}
public override Shape Clone() { ChainShape clone = new ChainShape(); clone.CreateChain(Vertices, Count); clone.m_prevVertex.Set(m_prevVertex); clone.m_nextVertex.Set(m_nextVertex); clone.HasPrevVertex = HasPrevVertex; clone.HasNextVertex = HasNextVertex; return(clone); }