A whole lot of garbage
This commit is contained in:
Executable
+1
@@ -0,0 +1 @@
|
||||
/target
|
||||
Executable
+13
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "voxtech"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
# voxtech_terrain = { path = "../terrain" }
|
||||
# voxtech_rendering = { path = "../rendering" }
|
||||
|
||||
tracing-subscriber = "0.3.23"
|
||||
tracing = { version = "0.1.44", features = ["log"] }
|
||||
|
||||
bevy = { version = "0.19.0-rc.2", features = ["dynamic_linking"] }
|
||||
Executable
+62
@@ -0,0 +1,62 @@
|
||||
use std::range::Range;
|
||||
|
||||
use bevy::{
|
||||
DefaultPlugins,
|
||||
asset::io::embedded::GetAssetServer,
|
||||
core_pipeline::core_3d::*,
|
||||
ecs::{component::Component, query::*, system::SystemParamItem},
|
||||
mesh::Mesh3d,
|
||||
pbr::{SetMeshBindGroup, SetMeshViewBindGroup, SetMeshViewEmptyBindGroup},
|
||||
prelude::*,
|
||||
render::{
|
||||
RenderSystems::Queue,
|
||||
render_phase::*,
|
||||
render_resource::*,
|
||||
settings::{Backends, RenderCreation, WgpuSettings},
|
||||
*,
|
||||
},
|
||||
};
|
||||
|
||||
fn main() -> AppExit {
|
||||
let mut app = App::default();
|
||||
app.add_plugins(DefaultPlugins.set(RenderPlugin {
|
||||
render_creation: RenderCreation::Automatic(Box::new(WgpuSettings {
|
||||
backends: Some(Backends::VULKAN | Backends::GL),
|
||||
..Default::default()
|
||||
})),
|
||||
..Default::default()
|
||||
}));
|
||||
app.add_systems(Startup, setup);
|
||||
|
||||
app.run()
|
||||
}
|
||||
|
||||
/// set up a simple 3D scene
|
||||
fn setup(
|
||||
mut commands: Commands,
|
||||
mut meshes: ResMut<Assets<Mesh>>,
|
||||
mut materials: ResMut<Assets<StandardMaterial>>,
|
||||
) {
|
||||
// circular base
|
||||
commands.spawn((
|
||||
Mesh3d(meshes.add(Circle::new(4.0))),
|
||||
MeshMaterial3d(materials.add(Color::WHITE)),
|
||||
Transform::from_rotation(Quat::from_rotation_x(-std::f32::consts::FRAC_PI_2)),
|
||||
));
|
||||
// cube
|
||||
commands.spawn((
|
||||
Mesh3d(meshes.add(Cuboid::new(1.0, 1.0, 1.0))),
|
||||
MeshMaterial3d(materials.add(Color::srgb_u8(124, 144, 255))),
|
||||
Transform::from_xyz(0.0, 0.5, 0.0),
|
||||
));
|
||||
// light
|
||||
commands.spawn((
|
||||
PointLight { ..default() },
|
||||
Transform::from_xyz(4.0, 8.0, 4.0),
|
||||
));
|
||||
// camera
|
||||
commands.spawn((
|
||||
Camera3d::default(),
|
||||
Transform::from_xyz(-2.5, 4.5, 9.0).looking_at(Vec3::ZERO, Vec3::Y),
|
||||
));
|
||||
}
|
||||
Reference in New Issue
Block a user