Cylinder Code

I was looking through the code for the primitive cylinder, while wondering what I should use for the curved areas of my rail tracks. And I noticed this

if (true) batch.getNormalBuffer().put(tempNormal.x).put(tempNormal.y).put(tempNormal.z);
else batch.getNormalBuffer().put(-tempNormal.x).put(-tempNormal.y).put(-tempNormal.z);



I may have overlooked something or I may be forgetting some feature in Java, but when is the else supposed to be evaluated?

Never!, but on the other hand, it gives the chance for someone to use it… That statement is there to allow for the normals to be pointing in-wards, and thus to be used for things like a tunnel or the-like.



Good eye though!  :smiley:

Ah, thanks.

Glad I could help!, and welcome to the jME forums!