diff --git a/assets/models/marker_planets.glb b/assets/models/marker_planets.glb new file mode 100644 index 0000000..4837970 Binary files /dev/null and b/assets/models/marker_planets.glb differ diff --git a/src/commands.rs b/src/commands.rs index 0cddf8c..585fafd 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -68,6 +68,7 @@ struct ParserState { is_targeted_on_startup: bool, is_sun: bool, is_moon: bool, + is_planet: bool, is_point_of_interest: bool, orbit_distance: Option, orbit_object_id: Option, @@ -122,6 +123,7 @@ impl Default for ParserState { is_targeted_on_startup: false, is_sun: false, is_moon: false, + is_planet: false, is_point_of_interest: false, orbit_distance: None, orbit_object_id: None, @@ -290,7 +292,7 @@ pub fn load_defs( state.is_moon = true; } ["planet", "yes"] => { - state.is_moon = true; + state.is_planet = true; } ["sun", "yes"] => { state.is_sun = true; @@ -761,7 +763,7 @@ fn spawn_entities( skeleton::load(ar_asset_name, &mut entitycmd, &*asset_server); } - if state.is_point_of_interest { + if state.is_point_of_interest || state.is_moon || state.is_planet { let mut entitycmd = commands.spawn(( hud::PointOfInterestMarker(actor_entity), world::DespawnOnPlayerDeath, @@ -773,22 +775,14 @@ fn spawn_entities( NotShadowCaster, NotShadowReceiver, )); - skeleton::load("point_of_interest", &mut entitycmd, &*asset_server); - } - - if state.is_moon { - let mut entitycmd = commands.spawn(( - hud::PointOfInterestMarker(actor_entity), - world::DespawnOnPlayerDeath, - hud::ToggleableHudElement, - SpatialBundle { - visibility: Visibility::Hidden, - ..default() - }, - NotShadowCaster, - NotShadowReceiver, - )); - skeleton::load("marker_satellites", &mut entitycmd, &*asset_server); + let model = if state.is_point_of_interest { + "point_of_interest" + } else if state.is_planet { + "marker_planets" + } else { + "marker_satellites" + }; + skeleton::load(model, &mut entitycmd, &*asset_server); } if state.has_ring { diff --git a/src/skeleton.rs b/src/skeleton.rs index df5269d..f131ff3 100644 --- a/src/skeleton.rs +++ b/src/skeleton.rs @@ -46,6 +46,7 @@ pub fn asset_name_to_path(name: &str) -> &'static str { "clippy_ar" => "models/clippy/ar_happy.glb#Scene0", "whale" => "models/whale.glb#Scene0", "marker_satellites" => "models/marker_satellites.glb#Scene0", + "marker_planets" => "models/marker_planets.glb#Scene0", "point_of_interest" => "models/point_of_interest.glb#Scene0", _ => "models/error.glb#Scene0", }