unsmooth the planet

This commit is contained in:
Joe Ardent 2023-02-21 14:22:43 -08:00
parent 851f2fb650
commit 881e6858de
2 changed files with 2 additions and 3 deletions

View file

@ -16,8 +16,7 @@ pub(super) fn spawn_cyberbike(
wheel_conf: Res<WheelConfig>,
mut meshterials: Meshterial,
) {
//let altitude = PLANET_RADIUS - 180.0;
let altitude = PLANET_RADIUS + 10.0; // smoothland
let altitude = PLANET_RADIUS - 180.0;
let mut xform = Transform::from_translation(Vec3::X * altitude)
.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()
.map(|&p| {
let disp = noise.get(p.as_dvec3().into()) as f32 * 0.04;
let pt = p; // + (p.normalize() * disp); // smoothland
let pt = p + (p.normalize() * disp);
pt.into()
})
.collect::<Vec<[f32; 3]>>();