misc conf changes and stuffs

This commit is contained in:
Joe Ardent 2023-05-09 13:34:54 -07:00
parent c676c93637
commit 3e5e51401a
3 changed files with 7 additions and 17 deletions

View File

@ -52,7 +52,7 @@ impl Default for MovementSettings {
fn default() -> Self {
Self {
accel: 20.0,
gravity: 9.8,
gravity: 4.8,
}
}
}

View File

@ -35,7 +35,7 @@ impl Default for WheelConfig {
rear_back: 1.0,
y: -0.1,
limits: [-0.5, 0.1],
stiffness: 150.0,
stiffness: 190.0,
damping: 8.0,
radius: 0.25,
thickness: 0.11,

View File

@ -12,7 +12,7 @@ use wgpu::PrimitiveTopology;
use crate::Label;
pub const PLANET_RADIUS: f32 = 3_000.0;
pub const PLANET_RADIUS: f32 = 4_000.0;
pub const PLANET_HUE: f32 = 31.0;
pub const PLANET_SATURATION: f32 = 1.0;
@ -86,7 +86,7 @@ fn gen_planet(sphere: Icosphere) -> (Mesh, Collider) {
.raw_points()
.iter()
.map(|&p| {
let disp = noise.get(p.as_dvec3().into()) as f32 * 0.05;
let disp = (noise.get(p.as_dvec3().into()) * 0.03f64) as f32;
let pt = p + (p.normalize() * disp);
pt.into()
})
@ -104,13 +104,7 @@ fn gen_planet(sphere: Icosphere) -> (Mesh, Collider) {
max = v.max(max);
}
let uvs = generated.raw_data().to_owned();
let mut indices = Vec::with_capacity(generated.indices_per_main_triangle() * 20);
for i in 0..20 {
generated.get_indices(i, &mut indices);
}
let indices = generated.get_all_indices();
let mut idxs = Vec::new();
for idx in indices.chunks_exact(3) {
@ -118,9 +112,7 @@ fn gen_planet(sphere: Icosphere) -> (Mesh, Collider) {
}
let indices = Indices::U32(indices);
let shape = Collider::trimesh(points.iter().map(|p| Vect::from_slice(p)).collect(), idxs);
dbg!(&points.len());
let collider = Collider::trimesh(points.iter().map(|p| Vect::from_slice(p)).collect(), idxs);
let mut mesh = Mesh::new(PrimitiveTopology::TriangleList);
mesh.set_indices(Some(indices));
@ -135,8 +127,6 @@ fn gen_planet(sphere: Icosphere) -> (Mesh, Collider) {
.as_float3()
.unwrap();
dbg!(&tri_list.len());
let mut rng = rand::rngs::StdRng::seed_from_u64(57);
let mut colors = Vec::new();
for triangle in tri_list.chunks_exact(3) {
@ -159,7 +149,7 @@ fn gen_planet(sphere: Icosphere) -> (Mesh, Collider) {
dbg!(&colors.len());
mesh.insert_attribute(Mesh::ATTRIBUTE_COLOR, colors);
(mesh, shape)
(mesh, collider)
}
/// remaps v in low..high to 0..1