godot-polyliner icon indicating copy to clipboard operation
godot-polyliner copied to clipboard

Rethink Trail3D circular buffer

Open Firepal opened this issue 10 months ago • 0 comments

Trail3D relies on an array of fixed size to store the Transforms that make up its points, adding a new Transform every frame. Currently, the entire array is shifted one element back, element by element, to make way for a new Transform.

Instead of shifting the entire array element by element, we could have an integer that represents the head of the array, and just increment that integer, wrapping at the end of the array. Then you can just overwrite whatever that index points to in the array with the new Transform. Way simpler.

Firepal avatar Feb 13 '25 00:02 Firepal