Minor tidy.

This commit is contained in:
Joe Ardent 2022-03-01 22:31:44 -08:00
parent 93dd8bde92
commit b6fa54a99c
3 changed files with 8 additions and 8 deletions

View file

@ -4,7 +4,7 @@ use bevy::{
}; };
use bevy_rapier3d::prelude::*; use bevy_rapier3d::prelude::*;
use crate::geometry::{CyberBikeModel, CyberSphere, PLANET_RADIUS, SPAWN_ALTITUDE}; use crate::geometry::{CyberBikeModel, CyberPlanet, PLANET_RADIUS, SPAWN_ALTITUDE};
#[derive(Component)] #[derive(Component)]
pub struct CyberBikeBody; pub struct CyberBikeBody;
@ -15,7 +15,7 @@ pub struct CyberBikeCollider;
fn setup_colliders( fn setup_colliders(
mut commands: Commands, mut commands: Commands,
meshes: Res<Assets<Mesh>>, meshes: Res<Assets<Mesh>>,
planet_query: Query<(Entity, &Handle<Mesh>), With<CyberSphere>>, planet_query: Query<(Entity, &Handle<Mesh>), With<CyberPlanet>>,
bike_query: Query<(Entity, &Transform), With<CyberBikeModel>>, bike_query: Query<(Entity, &Transform), With<CyberBikeModel>>,
) { ) {
let (planet, mesh_handle) = planet_query.single(); let (planet, mesh_handle) = planet_query.single();

View file

@ -15,9 +15,9 @@ pub(crate) const SPAWN_ALTITUDE: f32 = PLANET_RADIUS * 1.015;
pub struct CyberBikeModel; pub struct CyberBikeModel;
#[derive(Component)] #[derive(Component)]
pub struct CyberSphere; pub struct CyberPlanet;
fn spawn_giant_sphere( fn spawn_planet(
mut commands: Commands, mut commands: Commands,
mut meshes: ResMut<Assets<Mesh>>, mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>, mut materials: ResMut<Assets<StandardMaterial>>,
@ -43,7 +43,7 @@ fn spawn_giant_sphere(
..Default::default() ..Default::default()
}) })
.insert(CyberSphere); .insert(CyberPlanet);
} }
fn spawn_cyberbike(mut commands: Commands, asset_server: Res<AssetServer>) { fn spawn_cyberbike(mut commands: Commands, asset_server: Res<AssetServer>) {
@ -65,7 +65,7 @@ fn spawn_cyberbike(mut commands: Commands, asset_server: Res<AssetServer>) {
pub struct CyberGeomPlugin; pub struct CyberGeomPlugin;
impl Plugin for CyberGeomPlugin { impl Plugin for CyberGeomPlugin {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {
app.add_startup_system(spawn_giant_sphere.label(Label::Geometry)) app.add_startup_system(spawn_planet.label(Label::Geometry))
.add_startup_system(spawn_cyberbike.label(Label::Geometry)); .add_startup_system(spawn_cyberbike.label(Label::Geometry));
} }
} }

View file

@ -10,7 +10,7 @@ use bevy::{
use bevy_polyline::{Polyline, PolylineBundle, PolylineMaterial, PolylinePlugin}; use bevy_polyline::{Polyline, PolylineBundle, PolylineMaterial, PolylinePlugin};
use rand::{thread_rng, Rng}; use rand::{thread_rng, Rng};
use crate::{geometry::CyberSphere, lights::AnimateCyberLightWireframe}; use crate::{geometry::CyberPlanet, lights::AnimateCyberLightWireframe};
pub const BISEXY_COLOR: Color = Color::hsla(292.0, 0.9, 0.60, 1.1); pub const BISEXY_COLOR: Color = Color::hsla(292.0, 0.9, 0.60, 1.1);
@ -19,7 +19,7 @@ fn wireframe_planet(
mut meshes: ResMut<Assets<Mesh>>, mut meshes: ResMut<Assets<Mesh>>,
mut polylines: ResMut<Assets<Polyline>>, mut polylines: ResMut<Assets<Polyline>>,
mut polymats: ResMut<Assets<PolylineMaterial>>, mut polymats: ResMut<Assets<PolylineMaterial>>,
query: Query<&Handle<Mesh>, With<CyberSphere>>, query: Query<&Handle<Mesh>, With<CyberPlanet>>,
) { ) {
let handle = query.single(); let handle = query.single();
let mesh = meshes.get_mut(handle).unwrap(); let mesh = meshes.get_mut(handle).unwrap();