So I have a 1D array representing a 3D grid of numbers which represents the game world, I access individual entries (X,Y,Z) like so:
array[x + width * (y + height * z)]
Is there a way I can copy out an entire row (for instance, all the Z values for (1,1)) without looping (I'm already looping through every entry. I want to save performance by checking for empty rows (all 0s) and skipping processing them)? I'd rather not use a jagged array if possible.