int data = ray.getBlockData();
boolean hit = false;
ray.t = Double.POSITIVE_INFINITY;
for (int i = 0; i < quads.length; ++i) {
if ((data & (1<<i)) != 0) {
Quad quad = quads[i];
if (quad.intersect(ray)) {
float[] color = Texture.vines.getColor(ray.u, ray.v);
if (color[3] > Ray.EPSILON) {
ray.color.set(color);
float[] biomeColor = ray.getBiomeFoliageColor(scene);
ray.color.x *= biomeColor[0];
ray.color.y *= biomeColor[1];
ray.color.z *= biomeColor[2];
ray.t = ray.tNear;
ray.n.set(quad.n);
ray.n.scale(QuickMath.signum(-ray.d.dot(quad.n)));
hit = true;
}
}
}
}
if (data == 0 || (ray.currentMaterial & (1 << BlockData.VINE_TOP)) != 0) {
Quad quad = quads[4];
if (quad.intersect(ray)) {
float[] color = Texture.vines.getColor(ray.u, ray.v);
if (color[3] > Ray.EPSILON) {
ray.color.set(color);
float[] biomeColor = ray.getBiomeFoliageColor(scene);
ray.color.x *= biomeColor[0];