Minor tidy.
This commit is contained in:
parent
93dd8bde92
commit
b6fa54a99c
3 changed files with 8 additions and 8 deletions
|
@ -4,7 +4,7 @@ use bevy::{
|
|||
};
|
||||
use bevy_rapier3d::prelude::*;
|
||||
|
||||
use crate::geometry::{CyberBikeModel, CyberSphere, PLANET_RADIUS, SPAWN_ALTITUDE};
|
||||
use crate::geometry::{CyberBikeModel, CyberPlanet, PLANET_RADIUS, SPAWN_ALTITUDE};
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct CyberBikeBody;
|
||||
|
@ -15,7 +15,7 @@ pub struct CyberBikeCollider;
|
|||
fn setup_colliders(
|
||||
mut commands: Commands,
|
||||
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>>,
|
||||
) {
|
||||
let (planet, mesh_handle) = planet_query.single();
|
||||
|
|
|
@ -15,9 +15,9 @@ pub(crate) const SPAWN_ALTITUDE: f32 = PLANET_RADIUS * 1.015;
|
|||
pub struct CyberBikeModel;
|
||||
|
||||
#[derive(Component)]
|
||||
pub struct CyberSphere;
|
||||
pub struct CyberPlanet;
|
||||
|
||||
fn spawn_giant_sphere(
|
||||
fn spawn_planet(
|
||||
mut commands: Commands,
|
||||
mut meshes: ResMut<Assets<Mesh>>,
|
||||
mut materials: ResMut<Assets<StandardMaterial>>,
|
||||
|
@ -43,7 +43,7 @@ fn spawn_giant_sphere(
|
|||
|
||||
..Default::default()
|
||||
})
|
||||
.insert(CyberSphere);
|
||||
.insert(CyberPlanet);
|
||||
}
|
||||
|
||||
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;
|
||||
impl Plugin for CyberGeomPlugin {
|
||||
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));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ use bevy::{
|
|||
use bevy_polyline::{Polyline, PolylineBundle, PolylineMaterial, PolylinePlugin};
|
||||
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);
|
||||
|
||||
|
@ -19,7 +19,7 @@ fn wireframe_planet(
|
|||
mut meshes: ResMut<Assets<Mesh>>,
|
||||
mut polylines: ResMut<Assets<Polyline>>,
|
||||
mut polymats: ResMut<Assets<PolylineMaterial>>,
|
||||
query: Query<&Handle<Mesh>, With<CyberSphere>>,
|
||||
query: Query<&Handle<Mesh>, With<CyberPlanet>>,
|
||||
) {
|
||||
let handle = query.single();
|
||||
let mesh = meshes.get_mut(handle).unwrap();
|
||||
|
|
Loading…
Reference in a new issue