Minor color tweaks.

This commit is contained in:
Joe Ardent 2022-01-29 13:31:15 -08:00
parent 3a1c4ebff8
commit d793b6e986
4 changed files with 14 additions and 12 deletions

View file

@ -146,7 +146,7 @@ fn collisions(
if state.colliding { if state.colliding {
let down = -xform.translation.normalize(); let down = -xform.translation.normalize();
let vel = state.velocity; let vel = state.velocity;
let dvel = down * vel.dot(down) * 1.0001; let dvel = down * vel.dot(down);
state.velocity -= dvel; state.velocity -= dvel;
} }
} }

View file

@ -3,7 +3,7 @@ use heron::prelude::{CollisionShape, RigidBody};
use crate::Label; use crate::Label;
pub const PLANET_RADIUS: f32 = 360.0; pub const PLANET_RADIUS: f32 = 860.0;
pub(crate) const SPAWN_ALTITUDE: f32 = PLANET_RADIUS + 100.0; pub(crate) const SPAWN_ALTITUDE: f32 = PLANET_RADIUS + 100.0;
#[derive(Component, Debug)] #[derive(Component, Debug)]
@ -21,12 +21,12 @@ fn spawn_giant_sphere(
.spawn_bundle(PbrBundle { .spawn_bundle(PbrBundle {
mesh: meshes.add(Mesh::from(shape::Icosphere { mesh: meshes.add(Mesh::from(shape::Icosphere {
radius: PLANET_RADIUS, radius: PLANET_RADIUS,
subdivisions: 32, subdivisions: 24,
})), })),
material: materials.add(StandardMaterial { material: materials.add(StandardMaterial {
base_color: Color::GRAY, base_color: Color::DARK_GRAY,
metallic: 0.7, metallic: 0.6,
perceptual_roughness: 0.5, perceptual_roughness: 0.4,
..Default::default() ..Default::default()
}), }),

View file

@ -12,6 +12,8 @@ use rand::{thread_rng, Rng};
use crate::{geometry::CyberSphere, lights::AnimateCyberLightWireframe}; use crate::{geometry::CyberSphere, lights::AnimateCyberLightWireframe};
pub const BISEXY_COLOR: Color = Color::hsla(292.0, 0.9, 0.60, 1.1);
fn wireframe_planet( fn wireframe_planet(
mut commands: Commands, mut commands: Commands,
meshes: Res<Assets<Mesh>>, meshes: Res<Assets<Mesh>>,
@ -40,9 +42,9 @@ fn wireframe_planet(
commands.spawn_bundle(PolylineBundle { commands.spawn_bundle(PolylineBundle {
polyline: polylines.add(Polyline { vertices: pts }), polyline: polylines.add(Polyline { vertices: pts }),
material: polymats.add(PolylineMaterial { material: polymats.add(PolylineMaterial {
width: 6.0, width: 101.0,
color: Color::hsla(292.0, 1.0, 0.60, 1.0), color: BISEXY_COLOR,
perspective: false, perspective: true,
}), }),
..Default::default() ..Default::default()
}); });

View file

@ -5,7 +5,7 @@ use rand::prelude::*;
use crate::geometry::PLANET_RADIUS; use crate::geometry::PLANET_RADIUS;
pub const LIGHT_RANGE: f32 = 50.0; pub const LIGHT_RANGE: f32 = 90.0;
#[derive(Component)] #[derive(Component)]
struct AnimatedCyberLight { struct AnimatedCyberLight {
@ -40,7 +40,7 @@ fn spawn_moving_lights(
let saturation = rng.gen_range(0.85..0.99); let saturation = rng.gen_range(0.85..0.99);
let lightness = rng.gen_range(0.3..0.7); let lightness = rng.gen_range(0.3..0.7);
let color = Color::hsl(hue, saturation, lightness); let color = Color::hsl(hue, saturation, lightness);
let intensity = rng.gen_range(500.0..900.0); let intensity = rng.gen_range(900.0..1300.0);
let radius = rng.gen::<f32>() * 2.2; // why can't this infer the gen type? let radius = rng.gen::<f32>() * 2.2; // why can't this infer the gen type?
let point_light = PointLight { let point_light = PointLight {
intensity, intensity,
@ -113,7 +113,7 @@ fn spawn_static_lights(
commands.insert_resource(AmbientLight { commands.insert_resource(AmbientLight {
color: Color::WHITE, color: Color::WHITE,
brightness: 0.32, brightness: 0.1,
}); });
// up light // up light