@Override public BillBoard read( ByteBuffer billBuffer ) { skipHeader( billBuffer ); String id = readString( billBuffer ); float[] location = new float[3]; location[0] = billBuffer.getFloat(); location[1] = billBuffer.getFloat(); location[2] = billBuffer.getFloat(); float width = billBuffer.getFloat(); float height = billBuffer.getFloat(); return new BillBoard( id, location, width, height ); }
/** * @param mappedColumns * @param values * @return */ private BillBoard createBillBoard( Map<Column, Integer> mappedColumns, String[] values ) { float height = parseFloatingPoint( values[mappedColumns.get( Column.HEIGHT )], Column.HEIGHT ); float width = parseFloatingPoint( values[mappedColumns.get( Column.WIDTH )], Column.WIDTH ); float northing = parseFloatingPoint( values[mappedColumns.get( Column.NORTHING )], Column.NORTHING ); northing += wpvsTranslationVector[1]; float easting = parseFloatingPoint( values[mappedColumns.get( Column.EASTING )], Column.EASTING ); easting += wpvsTranslationVector[0]; float groundLevel = parseFloatingPoint( values[mappedColumns.get( Column.GROUND_LEVEL )], Column.GROUND_LEVEL ); String texture = values[mappedColumns.get( Column.IMAGE )]; if ( !usedTextures.contains( texture ) ) { if ( !checkTextureReference( texture ) ) { invalidTextures.add( texture ); LOG.warn( "Texture: " + texture + " does not denote an image in the textureDir: " + textureDir.getAbsolutePath() + " is this correct?." ); } usedTextures.add( texture ); } return new BillBoard( texture, new float[] { easting, northing, groundLevel }, width, height ); }