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 { fn default() -> Self {
Self { Self {
accel: 20.0, accel: 20.0,
gravity: 9.8, gravity: 4.8,
} }
} }
} }

View File

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

View File

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