yarn icon indicating copy to clipboard operation
yarn copied to clipboard

`VertexConsumer.vertex(double, double, double)` -> `pos`

Open enbrain opened this issue 2 years ago • 4 comments

The vertex(double, double, double) and vertex(Matrix4f, float, float, float) methods should be renamed to pos. These methods only specify the position element of the vertex. pos makes it in line with the color and texture methods.

My guess is that it was named vertex to convey that it's a start of the vertex building. While it's true in vanilla, one can define a vertex format that doesn't have a position element at the beginning. In addition to that, the next method already serves as a delimiter.

The other vertex methods should not be renamed because they specify all elements of a vertex (and even call the next method to end the current vertex building).

enbrain avatar May 09 '22 11:05 enbrain

I'd say this is quite impactful too, since it affects any mod doing rendering with VertexConsumer.

Juuxel avatar May 09 '22 11:05 Juuxel

Given we've been doing some sort of rendering code refactor in snapshots it makes sense to fix there. Hmm, I can try make a PR from GitHub Mobile I guess? Or perhaps others with Enigma will do it first?

apple502j avatar May 09 '22 12:05 apple502j

The name should be position than pos, as that's what we have in VertexFormatElement.Type and VertexFormats.

liach avatar May 09 '22 17:05 liach

I'd prefer shorter names for builder methods especially when they have high traffic. I'm not sure if consistency is that important in this context.

enbrain avatar May 15 '22 13:05 enbrain