/** * @return true if the used direct buffer pool can allocate enough direct memory for the given data. */ public boolean canAllocateEnoughMemory() { return this.fragment.canAllocateEnoughMemory(); }
@Override public int compareTo( RenderMeshFragment o ) { return this.fragment.compareTo( o.fragment ); }
/** * Loads the geometry data into main memory. * * @throws IOException */ public void load() throws IOException { synchronized ( LOCK ) { if ( data == null ) { data = fragment.loadData(); } } }
/** * @return size in bytes of this fragment. */ public int size() { return fragment.size(); }
void append(ByteBuffer buffer) { MeshFragment.store(buffer, minX, minY, minZ, maxX, maxY, maxZ, geometricError, blobPosition, blobLength); }
private MeshFragment[] createFragmentInfos( ByteBuffer patchBuffer, MeshFragmentDataReader patchDataReader ) { MeshFragment[] patches = new MeshFragment[patchBuffer.capacity() / MeshFragment.SIZE]; for ( int i = 0; i < patches.length; i++ ) { int baseOffset = i * MeshFragment.SIZE; patchBuffer.position( baseOffset ).limit( baseOffset + MeshFragment.SIZE ); ByteBuffer singlePatchBuffer = patchBuffer.slice(); patches[i] = new MeshFragment( i, singlePatchBuffer, patchDataReader ); } return patches; } }