Nez.Portable/ECS/Components/Renderables/LineRenderer.cs
/// <summary>
/// adds a segment and takes care of patching the previous elbow
/// </summary>
/// <param name="segment">Segment.</param>
/// <param name="vertIndex">Vert index.</param>
adds a segment and takes care of patching the previous elbow
adds a segment and takes care of patching the previous elbow
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        void addSegment(ref Segment segment, ref int vertIndex)
        {
            patchJoint(ref segment, ref vertIndex);
            _indices.add((short)vertIndex);
            _indices.add((short)(vertIndex + 1));
            _indices.add((short)(vertIndex + 2));
            _indices.add((short)(vertIndex + 4));
            _indices.add((short)vertIndex);
            _indices.add((short)(vertIndex + 2));
            _indices.add((short)(vertIndex + 3));
            _indices.add((short)(vertIndex + 4));
            _indices.add((short)(vertIndex + 2));
            if (segment.shouldFuseBottom)
            {
                addVert(vertIndex++, segment.tl, new Vector2(0, 1), segment.point.color);
                addVert(vertIndex++, segment.tr, new Vector2(1, 1), segment.nextPoint.color);
                addVert(vertIndex++, segment.br, new Vector2(1, 0), segment.nextPoint.color);
                addVert(
                    vertIndex++,
                    segment.hasFusedPoint ? segment.fusedPoint : segment.bl,
                    new Vector2(0, 0),
                    segment.point.color);
            }
            else
            {
                addVert(
                    vertIndex++,
                    segment.hasFusedPoint ? segment.fusedPoint : segment.tl,
                    new Vector2(0, 1),
                    segment.point.color);
                addVert(vertIndex++, segment.tr, new Vector2(1, 1), 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);
            }
            addVert(vertIndex++, segment.point.position, new Vector2(1, 0.5f), segment.point.color);
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] void addSegment ( ref Segment segment , ref int vertIndex ) { patchJoint ( ref segment , ref vertIndex ) ; _indices . add ( ( short ) vertIndex ) ; _indices . add ( ( short ) ( vertIndex + 1 ) ) ; _indices . add ( ( short ) ( vertIndex + 2 ) ) ; _indices . add ( ( short ) ( vertIndex + 4 ) ) ; _indices . add ( ( short ) vertIndex ) ; _indices . add ( ( short ) ( vertIndex + 2 ) ) ; _indices . add ( ( short ) ( vertIndex + 3 ) ) ; _indices . add ( ( short ) ( vertIndex + 4 ) ) ; _indices . add ( ( short ) ( vertIndex + 2 ) ) ; if ( segment . shouldFuseBottom ) { addVert ( vertIndex ++ , segment . tl , new Vector2 ( 0 , 1 ) , segment . point . color ) ; addVert ( vertIndex ++ , segment . tr , new Vector2 ( 1 , 1 ) , segment . nextPoint . color ) ; addVert ( vertIndex ++ , segment . br , new Vector2 ( 1 , 0 ) , segment . nextPoint . color ) ; addVert ( vertIndex ++ , segment . hasFusedPoint ? segment . fusedPoint : segment . bl , new Vector2 ( 0 , 0 ) , segment . point . color ) ; } else { addVert ( vertIndex ++ , segment . hasFusedPoint ? segment . fusedPoint : segment . tl , new Vector2 ( 0 , 1 ) , segment . point . color ) ; addVert ( vertIndex ++ , segment . tr , new Vector2 ( 1 , 1 ) , 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 ) ; } addVert ( vertIndex ++ , segment . point . position , new Vector2 ( 1 , 0.5f ) , segment . point . color ) ; }
adds a segment and takes care of patching the previous elbow
adds a segment and takes care of patching the previous elbow
// first, we need to patch the previous elbow gap
Segment
ref
int
ref
segment
None
vertIndex
None