Nez.Portable/ECS/Components/Renderables/LineRenderer.cs
/// <summary>
/// the first segment is special since it has no previous verts to connect to so we handle it separately.
/// </summary>
/// <param name="segment">Segment.</param>
/// <param name="nextSegment">Next segment.</param>
/// <param name="vertIndex">Vert index.</param>
the first segment is special since it has no previous verts to connect to so we handle it separately.
the first segment is special since it has no previous verts to connect to so we handle it separately .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        void addFirstSegment(ref Segment segment, ref Segment nextSegment, ref int vertIndex)
        {
            _indices.add(0);
            _indices.add(1);
            _indices.add(4);
            _indices.add(1);
            _indices.add(2);
            _indices.add(4);
            _indices.add(2);
            _indices.add(3);
            _indices.add(4);
            addVert(vertIndex++, segment.tl, new Vector2(0, 1), segment.point.color);
            if (nextSegment.shouldFuseBottom)
            {
                addVert(vertIndex++, segment.tr, new Vector2(1, 1), segment.nextPoint.color);
                addVert(vertIndex++, nextSegment.point.position, new Vector2(1, 0.5f), segment.nextPoint.color);
                addVert(
                    vertIndex++,
                    nextSegment.hasFusedPoint ? nextSegment.fusedPoint : segment.tl,
                    new Vector2(1, 0),
                    segment.nextPoint.color);
            }
            else
            {
                addVert(
                    vertIndex++,
                    nextSegment.hasFusedPoint ? nextSegment.fusedPoint : segment.bl,
                    new Vector2(1, 1),
                    segment.nextPoint.color);
                addVert(vertIndex++, nextSegment.point.position, new Vector2(1, 0.5f), segment.nextPoint.color);
                addVert(vertIndex++, segment.br, new Vector2(1, 0), segment.nextPoint.color);
            }
            addVert(vertIndex++, segment.bl, new Vector2(0, 0), segment.point.color);
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] void addFirstSegment ( ref Segment segment , ref Segment nextSegment , ref int vertIndex ) { _indices . add ( 0 ) ; _indices . add ( 1 ) ; _indices . add ( 4 ) ; _indices . add ( 1 ) ; _indices . add ( 2 ) ; _indices . add ( 4 ) ; _indices . add ( 2 ) ; _indices . add ( 3 ) ; _indices . add ( 4 ) ; addVert ( vertIndex ++ , segment . tl , new Vector2 ( 0 , 1 ) , segment . point . color ) ; if ( nextSegment . shouldFuseBottom ) { addVert ( vertIndex ++ , segment . tr , new Vector2 ( 1 , 1 ) , segment . nextPoint . color ) ; addVert ( vertIndex ++ , nextSegment . point . position , new Vector2 ( 1 , 0.5f ) , segment . nextPoint . color ) ; addVert ( vertIndex ++ , nextSegment . hasFusedPoint ? nextSegment . fusedPoint : segment . tl , new Vector2 ( 1 , 0 ) , segment . nextPoint . color ) ; } else { addVert ( vertIndex ++ , nextSegment . hasFusedPoint ? nextSegment . fusedPoint : segment . bl , new Vector2 ( 1 , 1 ) , segment . nextPoint . color ) ; addVert ( vertIndex ++ , nextSegment . point . position , new Vector2 ( 1 , 0.5f ) , segment . nextPoint . color ) ; addVert ( vertIndex ++ , segment . br , new Vector2 ( 1 , 0 ) , segment . nextPoint . color ) ; } addVert ( vertIndex ++ , segment . bl , new Vector2 ( 0 , 0 ) , segment . point . color ) ; }
the first segment is special since it has no previous verts to connect to so we handle it separately.
the first segment is special since it has no previous verts to connect to so we handle it separately .
// the tl vert will always be present, as weill the bl
Segment
ref
int
ref
segment
None
nextSegment
None
vertIndex
None