Skip to content

Releases: splashdust/bevy_voxel_world

0.5.0

15 Mar 19:37
6c635f2
Compare
Choose a tag to compare

Adds support for multiple parallell world instances

Breaking changes:

Configuration is now supplied when adding the plugin

// First declare a config struct. It needs to derive `Resource`, `Clone` and `Default`
#[derive(Resource, Clone, Default)]
struct MyWorld;

// Then implement the `VoxelWorldConfig` trait for it:
impl VoxelWorldConfig for MyWorld {
    // All the trait methods have defaults, so you only need to add the ones you want to alter
    fn spawning_distance(&self) -> u32 {
       15
    }
}

Then when adding the plugin:

.add_plugins(VoxelWorldPlugin::with_config(MyWorld))

If you don't want to change any default config, you can simply do this:

.add_plugins(VoxelWorldPlugin::default())

Adding multiple worlds follows the same pattern. Just create different configuration structs and add a VoxelWorldPlugin for each.

.add_plugins(VoxelWorldPlugin::with_config(MyOtherWorld))

Each world instance can have it's own configuration and will keep track of it's own set of voxel data and chunks.

The VoxelWorld system param now needs a type parameter to specify which world instance you want to select

The configuration struct adds the config values and its type also acts as a marker for the world instance.

fn my_system(
  my_voxel_world: VoxelWorld<MyWorld>,
  my_other_voxel_world: VoxelWorld<MyOtherWorld>
) {
  // Set a voxel in `my_voxel_world`
  my_voxel_world.set_voxel(pos, WorldVoxel::Solid(voxel_type))

  // Set a voxel in `my_other_voxel_world`
  my_other_voxel_world.set_voxel(pos, WorldVoxel::Solid(voxel_type))
}

If you initialized the plugin with ::default(), you still need to explicitly specify the instance as DefaultWorld:

fn my_system(voxel_world: VoxelWorld<DefaultWorld>) { ... }

The VoxelWorldRaycast system param now also requires the same config type paramter as described above.

0.4.0

28 Feb 22:27
02deab1
Compare
Choose a tag to compare
  • Update to Bevy 0.13

0.3.6

14 Jan 20:22
af28c8a
Compare
Choose a tag to compare
  • Fix some issues with ray casting

0.3.5

14 Jan 16:46
7304ec6
Compare
Choose a tag to compare
  • Add support for using custom Bevy materials. This makes it easy to use custom shaders with bevy_voxel_world.
  • Add a built-in method for ray casting into the world. Usefull if you want to know which voxe is under the mouse cursor for instance.

0.3.4

18 Dec 20:09
6079771
Compare
Choose a tag to compare
  • Avoid issues with chunk entities that have already been despawned, by using try_insert instead of regular insert. #12 & #14

0.3.3

18 Nov 12:10
4588ca6
Compare
Choose a tag to compare
  • Defer ChunkWillSpawn event until buffers are applied. Fixes issues caused by the event getting fired before the chunk data can actually be looked up.
  • Fix texture bleeding issue on negative Y faces (#10)

0.3.2

12 Nov 16:02
eeab4b2
Compare
Choose a tag to compare
  • Performance improvements:
    • More granular resources for more parallelization opportunities.
    • Pre-calculate hash for voxels array for faster mesh cache lookups
    • Buffered iserts/updates and removes for ChunkMap, to reduce time spent waiting to aquire RwLock.

0.3.1

11 Nov 20:43
909bcb4
Compare
Choose a tag to compare
  • Add lookup map for mesh handles. This allows bevy_voxel_world to re-use mesh handles for identical chunks and thereby utilising Bevy's automatic instancing while also avoiding redundant meshing.
  • Change the default chunk discovery algorith to only use ray casting. This uses less CPU than the previous flood fill method, and also works with larger spawn distances. The flood fill method can still be used by setting ChunkSpawnStrategy::Close
  • Add various config options for tuning spawning behaviour for different needs.

0.3.0

05 Nov 22:02
d9ae231
Compare
Choose a tag to compare
  • Update to Bevy 0.12

0.2.2

05 Nov 10:10
226565e
Compare
Choose a tag to compare
  • Fix an issue where filled underground chunks would never get meshed, even if they were modified
  • ChunkWillSpawn event now only fire when actually meshed chunks spawn, preventing massive spam of this event.