use of blusunrize.immersiveengineering.client.models.SmartLightingQuad in project ImmersiveEngineering by BluSunrize.
the class ClientUtils method createBakedQuad.
public static BakedQuad createBakedQuad(VertexFormat format, Vector3f[] vertices, EnumFacing facing, TextureAtlasSprite sprite, double[] uvs, float[] colour, boolean invert, float[] alpha, boolean smartLighting, BlockPos basePos) {
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder(format);
builder.setQuadOrientation(facing);
builder.setTexture(sprite);
Normal faceNormal = new Normal(facing.getDirectionVec().getX(), facing.getDirectionVec().getY(), facing.getDirectionVec().getZ());
int vId = invert ? 3 : 0;
int u = vId > 1 ? 2 : 0;
putVertexData(format, builder, vertices[vId], faceNormal, uvs[u], uvs[1], sprite, colour, alpha[vId]);
vId = invert ? 2 : 1;
u = vId > 1 ? 2 : 0;
putVertexData(format, builder, vertices[vId], faceNormal, uvs[u], uvs[3], sprite, colour, alpha[vId]);
vId = invert ? 1 : 2;
u = vId > 1 ? 2 : 0;
putVertexData(format, builder, vertices[vId], faceNormal, uvs[u], uvs[3], sprite, colour, alpha[vId]);
vId = invert ? 0 : 3;
u = vId > 1 ? 2 : 0;
putVertexData(format, builder, vertices[vId], faceNormal, uvs[u], uvs[1], sprite, colour, alpha[vId]);
BakedQuad tmp = builder.build();
return smartLighting ? new SmartLightingQuad(tmp.getVertexData(), -1, facing, sprite, format, basePos) : tmp;
}
Aggregations