smooth out the planet

This commit is contained in:
Joe Ardent 2023-02-20 13:35:02 -08:00
parent e6407c13aa
commit 7ee27e61a5
2 changed files with 3 additions and 2 deletions

View file

@ -16,7 +16,8 @@ pub(super) fn spawn_cyberbike(
wheel_conf: Res<WheelConfig>, wheel_conf: Res<WheelConfig>,
mut meshterials: Meshterial, mut meshterials: Meshterial,
) { ) {
let altitude = PLANET_RADIUS - 180.0; //let altitude = PLANET_RADIUS - 180.0;
let altitude = PLANET_RADIUS + 10.0; // smoothland
let mut xform = Transform::from_translation(Vec3::X * altitude) let mut xform = Transform::from_translation(Vec3::X * altitude)
.with_rotation(Quat::from_axis_angle(Vec3::Z, -89.0f32.to_radians())); .with_rotation(Quat::from_axis_angle(Vec3::Z, -89.0f32.to_radians()));

View file

@ -87,7 +87,7 @@ fn gen_planet(sphere: Icosphere) -> (Mesh, Collider) {
.iter() .iter()
.map(|&p| { .map(|&p| {
let disp = noise.get(p.as_dvec3().into()) as f32 * 0.04; let disp = noise.get(p.as_dvec3().into()) as f32 * 0.04;
let pt = p + (p.normalize() * disp); let pt = p; // + (p.normalize() * disp); // smoothland
pt.into() pt.into()
}) })
.collect::<Vec<[f32; 3]>>(); .collect::<Vec<[f32; 3]>>();