mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-18 07:35:19 +00:00
Cowboy prototyping
This commit is contained in:
+22
-12
@@ -2,7 +2,13 @@
|
||||
|
||||
use bevy::prelude::*;
|
||||
use input::StudioInputPlugin;
|
||||
use orbit_cam::{CameraMotionSystem, OrbitCam, OrbitCamPlugin};
|
||||
use interaction::InteractionPlugin;
|
||||
#[rustfmt::skip]
|
||||
use orbit_cam::{
|
||||
// CameraMotionSystem,
|
||||
// OrbitCam,
|
||||
OrbitCamPlugin,
|
||||
};
|
||||
use skybox::SkyboxPlugin;
|
||||
use test_scene::TestScenePlugin;
|
||||
use ui::UiLayerPlugin;
|
||||
@@ -10,11 +16,14 @@ use viewport::ViewportSize;
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
mod input;
|
||||
mod interaction;
|
||||
mod orbit_cam;
|
||||
mod skybox;
|
||||
mod test_scene;
|
||||
mod ui;
|
||||
mod viewport;
|
||||
// #[cfg(target_arch = "wasm32")]
|
||||
mod wasm;
|
||||
|
||||
#[wasm_bindgen]
|
||||
pub fn init(viewport_size: ViewportSize) {
|
||||
@@ -36,24 +45,25 @@ pub fn init(viewport_size: ViewportSize) {
|
||||
..default()
|
||||
}),
|
||||
StudioInputPlugin,
|
||||
InteractionPlugin,
|
||||
OrbitCamPlugin,
|
||||
TestScenePlugin,
|
||||
SkyboxPlugin,
|
||||
UiLayerPlugin,
|
||||
))
|
||||
.add_systems(Update, draw_world_axes.after(CameraMotionSystem))
|
||||
// .add_systems(Update, draw_world_axes.after(CameraMotionSystem))
|
||||
.run();
|
||||
}
|
||||
|
||||
fn draw_world_axes(mut gizmos: Gizmos, q: Query<&OrbitCam>) {
|
||||
let &OrbitCam { focus, radius, .. } = q.single();
|
||||
// fn draw_world_axes(mut gizmos: Gizmos, q: Query<&OrbitCam>) {
|
||||
// let &OrbitCam { focus, radius, .. } = q.single();
|
||||
|
||||
let mut draw_axis = |direction: Vec3, color: Color| {
|
||||
let end = focus + direction * radius / 15.;
|
||||
gizmos.line(focus, end, color);
|
||||
};
|
||||
// let mut draw_axis = |direction: Vec3, color: Color| {
|
||||
// let end = focus + direction * radius / 15.;
|
||||
// gizmos.line(focus, end, color);
|
||||
// };
|
||||
|
||||
draw_axis(Vec3::X, Color::RED);
|
||||
draw_axis(Vec3::Y, Color::GREEN);
|
||||
draw_axis(Vec3::Z, Color::BLUE);
|
||||
}
|
||||
// draw_axis(Vec3::X, Color::RED);
|
||||
// draw_axis(Vec3::Y, Color::GREEN);
|
||||
// draw_axis(Vec3::Z, Color::BLUE);
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user