/** * Generate a new set of texCoords for a texCoord set of indexed points. * This must always be called after the coordinate generation. The * top texCoord of the cone is always perpendicular to the face. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateIndexedTexture2D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 2; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("Texcoords", data.textureCoordinates.length, vtx_cnt); }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedQuadTexture2D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 2; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("2D Texture coordinates", data.textureCoordinates.length, vtx_cnt); }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to base the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateTexture3D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 3; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("3D Texture coordinates", data.textureCoordinates.length, vtx_cnt); float[] texCoords = data.textureCoordinates; }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateLineTexture3D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 2; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("3D Texture coordinates", data.textureCoordinates.length, vtx_cnt); float[] texCoords = data.textureCoordinates; }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedTriTexture3D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 3; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("3D Texture coordinates", data.textureCoordinates.length, vtx_cnt); float[] texCoords = data.textureCoordinates; }
/** * Generate a new set of normals for a normal set of unindexed points. * Smooth normals are used for the sides at the average between the faces. * Bottom normals always point down. * <p> * This must always be called after the coordinate generation. The * top normal of the cone is always perpendicular to the face. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedLineNormals(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 3; if(data.normals == null) data.normals = new float[vtx_cnt]; else if(data.normals.length < vtx_cnt) throw new InvalidArraySizeException("Normals", data.normals.length, vtx_cnt); }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateLineTexture2D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 2; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("2D Texture coordinates", data.textureCoordinates.length, vtx_cnt); float[] texCoords = data.textureCoordinates; }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedTriTexture2D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 2; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("2D Texture coordinates", data.textureCoordinates.length, vtx_cnt); }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedTriStripTexture2D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = 0; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("2D Texture coordinates", data.textureCoordinates.length, vtx_cnt); }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedTriStripTexture3D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = 0; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("2D Texture coordinates", data.textureCoordinates.length, vtx_cnt); }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to base the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateTriTexture3D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 2; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("3D Texture coordinates", data.textureCoordinates.length, vtx_cnt); float[] texCoords = data.textureCoordinates; }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedQuadTexture3D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 3; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("3D Texture coordinates", data.textureCoordinates.length, vtx_cnt); float[] texCoords = data.textureCoordinates; }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to shape the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateTriTexture2D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 2; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("2D Texture coordinates", data.textureCoordinates.length, vtx_cnt); float[] texCoords = data.textureCoordinates; }
/** * Generate a new set of texCoords for a normal set of unindexed points. Each * normal faces directly perpendicular for each point. This makes each face * seem flat. * <p> * This must always be called after the coordinate generation. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateIndexedTexture3D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 3; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("3D Texture coordinates", data.textureCoordinates.length, vtx_cnt); float[] texCoords = data.textureCoordinates; } /**
/** * Generate a new set of texCoords for a set of unindexed points. * <p> * This must always be called after the coordinate generation. * * @param data The data to base the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateTriTexture3D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 2; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("3D Texture coordinates", data.textureCoordinates.length, vtx_cnt); float[] texCoords = data.textureCoordinates; System.out.println("Unhandled textured generation case in " + "ElevationGridGenerator"); }
/** * Generate a new set of normals for unindexed points in a triangle strip. * Smooth normals are used for all. * <p> * This must always be called after the coordinate generation. The * top normal of the cone is always perpendicular to the face. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedTriStripNormals(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = 0; if(data.normals == null) data.normals = new float[vtx_cnt]; else if(data.normals.length < vtx_cnt) throw new InvalidArraySizeException("Normals", data.normals.length, vtx_cnt); regenerateNormals(); }
/** * Generate a new set of normals for a normal set of unindexed points. * Smooth normals are used for the sides at the average between the faces. * Bottom normals always point down. * <p> * This must always be called after the coordinate generation. The * top normal of the cone is always perpendicular to the face. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedQuadNormals(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 3; if(data.normals == null) data.normals = new float[vtx_cnt]; else if(data.normals.length < vtx_cnt) throw new InvalidArraySizeException("Normals", data.normals.length, vtx_cnt); regenerateNormals(); }
/** * Generate a new set of texCoords for a set of unindexed points. * <p> * This must always be called after the coordinate generation. * * @param data The data to base the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateTriTexture2D(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = data.vertexCount * 2; if(data.textureCoordinates == null) data.textureCoordinates = new float[vtx_cnt]; else if(data.textureCoordinates.length < vtx_cnt) throw new InvalidArraySizeException("2D Texture coordinates", data.textureCoordinates.length, vtx_cnt); regenerateTexcoords(); System.out.println("Unhandled textured generation case in " + "ElevationGridGenerator"); }
/** * Generates new set of points suitable for use in an unindexed array. Each * patch coordinate will appear twice in this list. The first half of the * array is the top, the second half, the bottom. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedQuadCoordinates(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = getVertexCount(data); if(data.coordinates == null) data.coordinates = new float[vtx_cnt * 3]; else if(data.coordinates.length < vtx_cnt * 3) throw new InvalidArraySizeException("Coordinates", data.coordinates.length, vtx_cnt * 3); float[] coords = data.coordinates; data.vertexCount = vtx_cnt; regenerateSubdivision(); }
/** * Generates new set of points suitable for use in an unindexed array. Each * patch coordinate will appear twice in this list. The first half of the * array is the top, the second half, the bottom. * * @param data The data to patch the calculations on * @throws InvalidArraySizeException The array is not big enough to contain * the requested geometry */ private void generateUnindexedTriCoordinates(GeometryData data) throws InvalidArraySizeException { int vtx_cnt = getVertexCount(data); if(data.coordinates == null) data.coordinates = new float[vtx_cnt * 3]; else if(data.coordinates.length < vtx_cnt * 3) throw new InvalidArraySizeException("Coordinates", data.coordinates.length, vtx_cnt * 3); float[] coords = data.coordinates; data.vertexCount = vtx_cnt; regenerateSubdivision(); }