diff --git a/InstancedMeshLines/Plugins/InstancedMeshLineRendering/Source/InstancedMeshLineRendering/Private/GPUInstancedLineComponent.cpp b/InstancedMeshLines/Plugins/InstancedMeshLineRendering/Source/InstancedMeshLineRendering/Private/GPUInstancedLineComponent.cpp index 7369d334eaaa68c13ccbf76c609fa156cf5dbb52..81e55a0245a7ef7c60c4df08fbdb5f5e82aed78f 100644 --- a/InstancedMeshLines/Plugins/InstancedMeshLineRendering/Source/InstancedMeshLineRendering/Private/GPUInstancedLineComponent.cpp +++ b/InstancedMeshLines/Plugins/InstancedMeshLineRendering/Source/InstancedMeshLineRendering/Private/GPUInstancedLineComponent.cpp @@ -958,7 +958,6 @@ bool UGPUInstancedLineComponent::RemovePoint(int32 LineId, int32 PointId) const GPULineIndices& Indices = Line[PointId]; const int32 LineTextureIndex = Indices.Value; const int32 RemovedInstanceId = Indices.Key; - RemoveInstance(10); if (PointId == 0) { @@ -1017,68 +1016,12 @@ bool UGPUInstancedLineComponent::RemovePoint(int32 LineId, int32 PointId) return true; } +// todo bool UGPUInstancedLineComponent::RemovePoints(int32 LineId, int32 StartingPointId, int32 NumberOfPoints) { TRACE_CPUPROFILER_EVENT_SCOPE(TEXT("UGPUInstancedLineComponent::RemoveLine")) - GPULineArray& Line = LineMap[LineId]; - const GPULineIndices& Indices = Line[StartingPointId]; - const int32 LineTextureIndex = Indices.Value; - - if(StartingPointId == 0) - { - Line[StartingPointId + NumberOfPoints].Value = 0; - } - - LinearLineData.RemoveAt(LineTextureIndex, NumberOfPoints); - - // Segment at the end of the line? - if (StartingPointId + NumberOfPoints == Line.Num()) - { - RemoveInstance(Line[StartingPointId - 1].Key); - Line[StartingPointId - 1].Key = -1; - for(int32 i = 0; i < NumberOfPoints - 1; ++i) - { - RemoveInstance(Line[StartingPointId + i].Key); - } - } - else - { - for (int32 i = 0; i < NumberOfPoints; ++i) - { - RemoveInstance(Line[StartingPointId + i].Key); - } - // Update the following segments in this line: - for (int32 i = StartingPointId + NumberOfPoints + 1; i < Line.Num(); ++i) - { - Line[i].Value -= NumberOfPoints; - Line[i].Key -= NumberOfPoints; - SetCustomDataValue(Line[i].Key, 4, Line[i].Value); - } - } - - Line.RemoveAt(StartingPointId, NumberOfPoints); - - // Update all following lines - for (TPair<int32, GPULineArray>& Pair : LineMap) - { - GPULineArray& LineArray = Pair.Value; - if (LineArray[0].Value > LineTextureIndex) // todo test, maybe needs to be >= - { - for (int32 i = 0; i < LineArray.Num(); ++i) - { - LineArray[i].Value -= NumberOfPoints; - LineArray[i].Key -= NumberOfPoints; - SetCustomDataValue(LineArray[i].Key, 4, LineArray[i].Value, false); - } - } - } - - CurrentTextureIndex -= NumberOfPoints; - CurrentTextureMarker.X = CurrentTextureIndex % TextureWidth; - CurrentTextureMarker.Y = CurrentTextureIndex / TextureWidth; - - UpdateWholeTexture(); - return true; + + return false; }