Package com.rvandoosselaer.blocks
Class ChunkPager
- java.lang.Object
-
- com.rvandoosselaer.blocks.Pager<com.jme3.scene.Node>
-
- com.rvandoosselaer.blocks.ChunkPager
-
- All Implemented Interfaces:
BlocksManagerListener
public class ChunkPager extends Pager<com.jme3.scene.Node>
A pager implementation that pages the meshes of the chunks around the given location. Attaching chunks that are in range and detaching them when they are out of range, from the given node.
-
-
Field Summary
-
Fields inherited from class com.rvandoosselaer.blocks.Pager
attachedPages, blocksManager, centerPageLocation, gridLowerBounds, gridSize, gridUpperBounds, location, pagesToAttach, pagesToDetach, requestedPages, updatedPages
-
-
Constructor Summary
Constructors Constructor Description ChunkPager(@NonNull com.jme3.scene.Node node, @NonNull BlocksManager blocksManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
attachPage(com.jme3.scene.Node page)
Attach the page.protected com.jme3.scene.Node
createPage(Chunk chunk)
Creates and returns the page based on the passed chunk.protected void
detachPage(com.jme3.scene.Node page)
Detach the page.-
Methods inherited from class com.rvandoosselaer.blocks.Pager
cleanup, getPages, initialize, onChunkAvailable, update, updateQueues
-
-
-
-
Constructor Detail
-
ChunkPager
public ChunkPager(@NonNull @NonNull com.jme3.scene.Node node, @NonNull @NonNull BlocksManager blocksManager)
-
-
Method Detail
-
createPage
protected com.jme3.scene.Node createPage(Chunk chunk)
Description copied from class:Pager
Creates and returns the page based on the passed chunk.- Specified by:
createPage
in classPager<com.jme3.scene.Node>
- Returns:
- page of the chunk or null
-
detachPage
protected void detachPage(com.jme3.scene.Node page)
Description copied from class:Pager
Detach the page.- Specified by:
detachPage
in classPager<com.jme3.scene.Node>
- Parameters:
page
- to detach
-
attachPage
protected void attachPage(com.jme3.scene.Node page)
Description copied from class:Pager
Attach the page.- Specified by:
attachPage
in classPager<com.jme3.scene.Node>
- Parameters:
page
- to attach
-
-