height map generator
This commit is contained in:
28
game/main/src/main.rs
Normal file
28
game/main/src/main.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use bevy::{pbr::wireframe::WireframePlugin, prelude::*};
|
||||
use bevy_inspector_egui::quick::WorldInspectorPlugin;
|
||||
mod phos;
|
||||
use phos::PhosGamePlugin;
|
||||
|
||||
fn main() {
|
||||
App::new()
|
||||
.add_plugins((
|
||||
DefaultPlugins.set(WindowPlugin {
|
||||
primary_window: Some(Window {
|
||||
title: "Phos".into(),
|
||||
name: Some("phos".into()),
|
||||
resolution: (1920.0, 1080.0).into(),
|
||||
resizable: false,
|
||||
enabled_buttons: bevy::window::EnabledButtons {
|
||||
maximize: false,
|
||||
..Default::default()
|
||||
},
|
||||
..default()
|
||||
}),
|
||||
..default()
|
||||
}),
|
||||
WireframePlugin,
|
||||
WorldInspectorPlugin::new(),
|
||||
PhosGamePlugin,
|
||||
))
|
||||
.run();
|
||||
}
|
||||
32
game/main/src/phos.rs
Normal file
32
game/main/src/phos.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use bevy::{pbr::CascadeShadowConfig, prelude::*};
|
||||
|
||||
pub struct PhosGamePlugin;
|
||||
|
||||
impl Plugin for PhosGamePlugin {
|
||||
fn build(&self, app: &mut App) {
|
||||
app.add_systems(Startup, init_game);
|
||||
}
|
||||
}
|
||||
|
||||
fn init_game(mut commands: Commands) {
|
||||
commands.spawn((
|
||||
Camera3dBundle {
|
||||
transform: Transform::from_xyz(0., 50., 0.)
|
||||
.looking_at(Vec3::new(50., 0., 50.), Vec3::Y),
|
||||
..default()
|
||||
},
|
||||
));
|
||||
|
||||
commands.spawn(DirectionalLightBundle {
|
||||
directional_light: DirectionalLight {
|
||||
shadows_enabled: false,
|
||||
..default()
|
||||
},
|
||||
cascade_shadow_config: CascadeShadowConfig {
|
||||
bounds: vec![20., 40., 80., 1000., 5000., 19000., 20000.],
|
||||
..default()
|
||||
},
|
||||
transform: Transform::from_xyz(0.0, 16.0, 5.).looking_at(Vec3::ZERO, Vec3::Y),
|
||||
..default()
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user