#voxel #magica-voxel #game #bevy

bevy_vox

Load MagicaVoxel Vox file for bevy engine

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

Download history 2/week @ 2022-01-17 2/week @ 2022-01-24 4/week @ 2022-01-31 2/week @ 2022-02-07 11/week @ 2022-02-14 1/week @ 2022-02-21 1/week @ 2022-02-28 1/week @ 2022-03-07 20/week @ 2022-03-14 15/week @ 2022-03-21 2/week @ 2022-03-28 2/week @ 2022-04-04 5/week @ 2022-04-18 14/week @ 2022-04-25 39/week @ 2022-05-02

58 downloads per month

MIT license

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