FarseerPhysics.Collision.Shapes.ChainShape.getChildEdge C# (CSharp) Method

getChildEdge() private method

This method has been optimized to reduce garbage.
private getChildEdge ( EdgeShape edge, int index ) : void
edge EdgeShape The cached edge to set properties on.
index int The index.
return void
		internal void getChildEdge( EdgeShape edge, int index )
		{
			Debug.Assert( 0 <= index && index < vertices.Count - 1 );
			Debug.Assert( edge != null );

			edge.shapeType = ShapeType.Edge;
			edge._radius = _radius;

			edge.vertex1 = vertices[index + 0];
			edge.vertex2 = vertices[index + 1];

			if( index > 0 )
			{
				edge.vertex0 = vertices[index - 1];
				edge.hasVertex0 = true;
			}
			else
			{
				edge.vertex0 = _prevVertex;
				edge.hasVertex0 = _hasPrevVertex;
			}

			if( index < vertices.Count - 2 )
			{
				edge.vertex3 = vertices[index + 2];
				edge.hasVertex3 = true;
			}
			else
			{
				edge.vertex3 = _nextVertex;
				edge.hasVertex3 = _hasNextVertex;
			}
		}

Same methods

ChainShape::getChildEdge ( int index ) : EdgeShape