5 releases (3 breaking)
Uses new Rust 2021
0.4.0 | Jan 10, 2022 |
---|---|
0.3.0 | Apr 7, 2021 |
0.2.1 | Dec 21, 2020 |
0.2.0 | Nov 4, 2020 |
0.1.0 | Oct 17, 2020 |
#317 in Game dev
58 downloads per month
27KB
127 lines
Load MagicaVoxel Vox file for bevy engine.
bevy_vox | bevy |
---|---|
0.4 | 0.6 |
0.3 | 0.5 |
0.2 | 0.4 |
Example
use bevy::prelude::*;
use bevy_vox::*;
fn main() {
App::new()
.insert_resource(Msaa { samples: 4 })
.add_plugins(DefaultPlugins)
.add_plugin(VoxPlugin)
.add_startup_system(setup.system())
.run();
}
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
// add entities to the world
commands.spawn_scene(asset_server.load("2x2x2.vox"));
commands
// light
.spawn_bundle(PointLightBundle {
transform: Transform::from_translation(Vec3::new(4.0, 5.0, 4.0)),
..Default::default()
});
commands
// camera
.spawn_bundle(PerspectiveCameraBundle {
transform: Transform::from_translation(Vec3::new(6.0, -6.0, 6.0))
.looking_at(Vec3::default(), Vec3::Y),
..Default::default()
});
}
Dependencies
~22MB
~443K SLoC