BlockZ another Block/Voxel Engine

Hi i want to contibute my curent work.

For more information take a look here:

For the lazy ones:

I prepared some quicksetups to testout some stuff. So to get it startet just this in a simpleapplication:

Setup s;
CharacterControl chara;

public void simpleInitApp() {

    BulletAppState bulletAppState = new BulletAppState();

    s = new Setup();

// chara = s.charackterSetup(inputManager, rootNode, bulletAppState.getPhysicsSpace(), assetManager, cam, this, flyCam);
// s.flyCamSetup(inputManager, rootNode, bulletAppState.getPhysicsSpace(), assetManager, cam, this, flyCam);
chara = s.charackterSimpleFloorSetup(inputManager, rootNode, bulletAppState.getPhysicsSpace(), assetManager, cam, this, flyCam, 16, 16);


public void simpleUpdate(float tpf) {



The uncommented lines can be switched for another Setup.
charackterSetup is with a heightmap and third person charactercontrol
flyCamSetup ist with a heightmap and flycam
charackterSimpleFloorSetup is just one layer of Tiles

The last ints in charackterSimpleFloorSetup are tilebuffer and tilessize.
Tilebuffer will create tilebuffer * tilebuffer * tilebuffer buffer for Tiles and limits the visible world
Tilesize sets the umber of Blocks in one Tile and will create tilesize * 1 * tilesize blocks per Tile.

To get access to to tiles/blocks call
Tilemanager tm = TileManager.getInstace();

Before the TileManger can be used it needs to be intialized:

public static void init(PhysicsSpace physicSpace, Node tileManagerRootNode, Application app, Rowedtexture texture, Material blockMaterial, int tileBufferSize, int tilesize)
I use one texture for all Blocks in each row there are six squares with block texture.
Which results in RowedTexture, it just needs the number of rows contained in the textures.

TileManager gives easy ways to add and remove Voxels:

public void addVoxel(VoxelType type, Vector3f position);
public Tile removeVoxel(Vector3f position);

Note:Voxeltype is a class which holds just one int for the row to be choosen from the rowedtexture.

This both Methods will add/remove a voxel and update the geomery and collisionshape (needs some more work on that :wink: ).
They are not ment as generation Methods!
To generate a world use:
VoxelType[][] vt = new VoxelType[Tile.getSize()][Tile.getSize()];
//fill vt here
Vector3i tilePosition = new Vector3i(x, y, z);
Tile t = tm.getTile(tilePosition);

Ok now that i have written it down it look quite more complicated that i wated it to be.
Hope you still enjoy!