Remove debug figure spinning

This commit is contained in:
Danny McGee
2023-10-16 20:18:45 -04:00
parent 048323a73b
commit 64a7f9767f
+7 -29
View File
@@ -1,5 +1,3 @@
use bevy::math::vec3;
#[rustfmt::skip]
use bevy::{
pbr::NotShadowCaster,
prelude::*,
@@ -19,7 +17,6 @@ impl Plugin for TestScenePlugin {
app.insert_resource(ClearColor(Color::hsl(0.0, 0.0, 0.25)))
.add_plugins(MaterialPlugin::<ProceduralGridMaterial>::default())
.add_systems(Startup, spawn_scene)
.add_systems(Update, right_round_round_round)
.add_systems(PostUpdate, move_plane_with_camera.after(CameraMotionSystem));
}
}
@@ -27,9 +24,6 @@ impl Plugin for TestScenePlugin {
#[derive(Component)]
struct WorldGridPlane;
#[derive(Component)]
struct Spin(Vec3); // TODO: Debug
fn spawn_scene(
mut cmd: Commands,
assets: Res<AssetServer>,
@@ -37,18 +31,13 @@ fn spawn_scene(
mut mat_proc_grid: ResMut<Assets<ProceduralGridMaterial>>,
) {
// Skeletal mesh
cmd.spawn((SpatialBundle::default(), Spin(Vec3::Y * 0.5)))
.with_children(|parent| {
parent.spawn((
SceneBundle {
scene: assets.load("gltf/base_human_male.gltf#Scene0"),
transform: Transform::from_translation(vec3(0., 0., 2.5)),
..default()
},
Selected,
Spin(vec3(0., -1.5, 1.)),
));
});
cmd.spawn((
SceneBundle {
scene: assets.load("gltf/base_human_male.gltf#Scene0"),
..default()
},
Selected,
));
// Plane
let plane = meshes.add(Mesh::from(shape::Plane {
@@ -95,17 +84,6 @@ fn move_plane_with_camera(
}
}
fn right_round_round_round(mut q_spin: Query<(&mut Transform, &Spin)>, time: Res<Time>) {
let dt = time.delta_seconds();
for (mut xform, spin) in q_spin.iter_mut() {
let speed = spin.0.length();
let axis = spin.0 / speed;
xform.rotate_local_axis(axis, std::f32::consts::PI * speed * dt);
}
}
#[derive(AsBindGroup, Clone, TypePath, TypeUuid)]
#[uuid = "CE331A13-F247-4F5B-A75E-670B2BD5776A"]
struct ProceduralGridMaterial {}