mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-17 00:13:17 +00:00
formatting fix
This commit is contained in:
+8
-2
@@ -6,12 +6,18 @@ use bevy_mod_picking::debug::DebugPickingMode;
|
||||
use space_editor::{
|
||||
prelude::EditorCameraMarker,
|
||||
space_editor_ui::{
|
||||
bottom_menu::BottomMenuPlugin, tools::gizmo::GizmoToolPlugin, EditorDefaultCameraPlugin, EditorGizmoConfigPlugin, EditorPickingPlugin, EditorPluginGroup, EditorUiCore, ShowEditorUi
|
||||
bottom_menu::BottomMenuPlugin, tools::gizmo::GizmoToolPlugin, EditorDefaultCameraPlugin,
|
||||
EditorGizmoConfigPlugin, EditorPickingPlugin, EditorPluginGroup, EditorUiCore,
|
||||
ShowEditorUi,
|
||||
},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
camera_controller::{CameraController, CameraMotionSystem}, input::{Action, InputAction, Lifecycle}, is_editor, scene::SkeletalJoint, MainCamera, StudioMode
|
||||
camera_controller::{CameraController, CameraMotionSystem},
|
||||
input::{Action, InputAction, Lifecycle},
|
||||
is_editor,
|
||||
scene::SkeletalJoint,
|
||||
MainCamera,
|
||||
};
|
||||
|
||||
#[derive(Resource, Deref, DerefMut)]
|
||||
|
||||
+6
-2
@@ -4,6 +4,7 @@ use bevy::{app::PluginGroupBuilder, prelude::*};
|
||||
use bevy_mod_picking::DefaultPickingPlugins;
|
||||
|
||||
use bevy_web_asset::WebAssetPlugin;
|
||||
use bvh::BvhPlugin;
|
||||
#[cfg(feature = "wasm")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
@@ -69,6 +70,7 @@ impl PluginGroup for CommonPlugins {
|
||||
.add(UiLayerPlugin)
|
||||
.add(WorldGridPlugin)
|
||||
.add(persistance::PersistancePlugin)
|
||||
.add(BvhPlugin)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -105,7 +107,8 @@ pub fn start_viewer(
|
||||
canvas_alt,
|
||||
viewport_size,
|
||||
StudioMode::Viewer,
|
||||
);
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "wasm", wasm_bindgen(js_name = startEditor))]
|
||||
@@ -123,7 +126,8 @@ pub fn start_editor(
|
||||
canvas_alt,
|
||||
viewport_size,
|
||||
StudioMode::Editor,
|
||||
);
|
||||
)
|
||||
.run();
|
||||
}
|
||||
|
||||
#[cfg_attr(feature = "wasm", wasm_bindgen(js_name = startBvhViewer))]
|
||||
|
||||
+15
-15
@@ -403,21 +403,21 @@ fn frame_scene_in_view(
|
||||
f32::atan(pproj.aspect_ratio * f32::tan(pproj.fov / 2.))
|
||||
};
|
||||
|
||||
// // TODO:
|
||||
// // According to "I eat babies" at the Ars Technica forums
|
||||
// // (https://arstechnica.com/civis/threads/if-you-have-aspect-ratio-and-vertical-fov-can-you-calc-horizontal-fov.37447/):
|
||||
// //
|
||||
// // tan(fov_v / 2) = y / z
|
||||
// // tan(fov_h / 2) = x / z
|
||||
// //
|
||||
// // Theoretically, this would let us skip some costly tan/atan
|
||||
// // computations, but I must be missing something, because just
|
||||
// // substituting (s / depth) for the divisor below would make the
|
||||
// // whole equation independent of the FOV, which is obviously
|
||||
// // wrong.
|
||||
// //
|
||||
// // Unfortunately I'm embarrassingly bad at algebra, but there
|
||||
// // must be some room for simplification here.
|
||||
// TODO:
|
||||
// According to "I eat babies" at the Ars Technica forums
|
||||
// (https://arstechnica.com/civis/threads/if-you-have-aspect-ratio-and-vertical-fov-can-you-calc-horizontal-fov.37447/):
|
||||
//
|
||||
// tan(fov_v / 2) = y / z
|
||||
// tan(fov_h / 2) = x / z
|
||||
//
|
||||
// Theoretically, this would let us skip some costly tan/atan
|
||||
// computations, but I must be missing something, because just
|
||||
// substituting (s / depth) for the divisor below would make the
|
||||
// whole equation independent of the FOV, which is obviously
|
||||
// wrong.
|
||||
//
|
||||
// Unfortunately I'm embarrassingly bad at algebra, but there
|
||||
// must be some room for simplification here.
|
||||
let radius = (s / 2.) / f32::tan(a / 2.);
|
||||
|
||||
cam.focus = aabb.center.into();
|
||||
|
||||
Reference in New Issue
Block a user