EntityComponentSystemSamples icon indicating copy to clipboard operation
EntityComponentSystemSamples copied to clipboard

Possible Error in BoidsSystem that surprisingly does not breake the simulation.

Open piotrrach opened this issue 2 years ago • 0 comments

I've been analyzing BoidSystem and got to realization that there is a possible mistake in MergeCells job. In the ExecuteNext method to be precise. I suppose instead of this:

        public void ExecuteNext(int cellIndex, int index)
        {
            cellCount[cellIndex]      += 1;
            cellAlignment[cellIndex]  += cellAlignment[cellIndex];
            cellSeparation[cellIndex] += cellSeparation[cellIndex];
            cellIndices[index]        = cellIndex;
        }

should it be like this:

       public void ExecuteNext(int cellIndex, int index)
        {
            cellCount[cellIndex]      += 1;
            cellAlignment[cellIndex]  += cellAlignment[index];
            cellSeparation[cellIndex] += cellSeparation[index];
            cellIndices[index]        = cellIndex;
        }
        
        

piotrrach avatar Oct 04 '23 23:10 piotrrach