protected Vector3f getNormal(float x, float z, Vector2f xz) { x-=0.5f; z-=0.5f; float col = FastMath.floor(x); float row = FastMath.floor(z); boolean onX = false; if(1 - (x - col)-(z - row) < 0) // what triangle to interpolate on onX = true; // v1--v2 ^ // | / | | // | / | | // v3--v4 | Z // | // <-------Y // X Vector3f n1 = getMeshNormal((int) FastMath.ceil(x), (int) FastMath.ceil(z)); Vector3f n2 = getMeshNormal((int) FastMath.floor(x), (int) FastMath.ceil(z)); Vector3f n3 = getMeshNormal((int) FastMath.ceil(x), (int) FastMath.floor(z)); Vector3f n4 = getMeshNormal((int) FastMath.floor(x), (int) FastMath.floor(z)); return n1.add(n2).add(n3).add(n4).normalize(); }
float maxX = Float.NEGATIVE_INFINITY, maxY = Float.NEGATIVE_INFINITY, maxZ = Float.NEGATIVE_INFINITY; int iterations = (int) FastMath.ceil(points.limit() / ((float) tmpArray.length)); for (int i = iterations - 1; i >= 0; i--) { int bufLength = Math.min(tmpArray.length, points.remaining());
float[] tanBuf = vars.skinTangents; int iterations = (int) FastMath.ceil(fvb.limit() / ((float) posBuf.length)); int bufLength = 0; int tanLength = 0;
float[] tanBuf = vars.skinTangents; int iterations = (int) FastMath.ceil(fvb.limit() / ((float) posBuf.length)); int bufLength = 0; int tanLength = 0;
float[] normBuf = vars.skinNormals; int iterations = (int) FastMath.ceil(fvb.limit() / ((float) posBuf.length)); int bufLength = posBuf.length; for (int i = iterations - 1; i >= 0; i--) {
float[] normBuf = vars.skinNormals; int iterations = (int) FastMath.ceil(fvb.limit() / ((float) posBuf.length)); int bufLength = posBuf.length; for (int i = iterations - 1; i >= 0; i--) {
int higherMipLevel = (int) FastMath.ceil(mipLevel); float ratio = mipLevel - lowerMipLevel;
private BufferedImage getFontImage(Bf4File fontFile) { // Try to create a nice square (power of two is really waste of space...) int area = fontFile.getMaxHeight() * fontFile.getAvgWidth() * fontFile.getGlyphCount(); // This is how many square pixels we need, approximate int side = (int) FastMath.ceil(FastMath.sqrt(area)) + 10; // The plus is just a bit padding to make sure everything fits // Divisible by two if (side % 2 != 0) { side++; } // Create the image return new BufferedImage(side, side, BufferedImage.TYPE_BYTE_BINARY, Bf4File.getCm()); }
protected Vector3f getNormal(float x, float z, Vector2f xz) { x-=0.5f; z-=0.5f; float col = FastMath.floor(x); float row = FastMath.floor(z); boolean onX = false; if(1 - (x - col)-(z - row) < 0) // what triangle to interpolate on onX = true; // v1--v2 ^ // | / | | // | / | | // v3--v4 | Z // | // <-------Y // X Vector3f n1 = getMeshNormal((int) FastMath.ceil(x), (int) FastMath.ceil(z)); Vector3f n2 = getMeshNormal((int) FastMath.floor(x), (int) FastMath.ceil(z)); Vector3f n3 = getMeshNormal((int) FastMath.ceil(x), (int) FastMath.floor(z)); Vector3f n4 = getMeshNormal((int) FastMath.floor(x), (int) FastMath.floor(z)); return n1.add(n2).add(n3).add(n4).normalize(); }
float[] normBuf = vars.skinNormals; int iterations = (int) FastMath.ceil(fvb.limit() / ((float) posBuf.length)); int bufLength = posBuf.length; for (int i = iterations - 1; i >= 0; i--) {
float[] normBuf = vars.skinNormals; int iterations = (int) FastMath.ceil(fvb.capacity() / ((float) posBuf.length)); int bufLength = posBuf.length * 3; for (int i = iterations - 1; i >= 0; i--) {
float maxX = Float.NEGATIVE_INFINITY, maxY = Float.NEGATIVE_INFINITY, maxZ = Float.NEGATIVE_INFINITY; int iterations = (int) FastMath.ceil(points.limit() / ((float) tmpArray.length)); for (int i = iterations - 1; i >= 0; i--) { int bufLength = Math.min(tmpArray.length, points.remaining());
float maxX = Float.NEGATIVE_INFINITY, maxY = Float.NEGATIVE_INFINITY, maxZ = Float.NEGATIVE_INFINITY; int iterations = (int) FastMath.ceil(points.limit() / ((float) tmpArray.length)); for (int i = iterations - 1; i >= 0; i--) { int bufLength = Math.min(tmpArray.length, points.remaining());
float[] normBuf = vars.skinNormals; int iterations = (int) FastMath.ceil(fvb.limit() / ((float) posBuf.length)); int bufLength = posBuf.length; for (int i = iterations - 1; i >= 0; i--) {
float[] normBuf = vars.skinNormals; int iterations = (int) FastMath.ceil(fvb.capacity() / ((float)posBuf.length)); int bufLength = posBuf.length * 3; for (int i = iterations-1; i >= 0; i--){
int higherMipLevel = (int) FastMath.ceil(mipLevel); float ratio = mipLevel - lowerMipLevel;