Really really re-enable CCD.

This commit is contained in:
Joe Ardent 2022-02-25 13:18:44 -08:00
parent 79ddc3f951
commit b101d8bc15
3 changed files with 20 additions and 13 deletions

16
Cargo.lock generated
View file

@ -30,7 +30,7 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47"
dependencies = [ dependencies = [
"getrandom 0.2.4", "getrandom 0.2.5",
"once_cell", "once_cell",
"version_check", "version_check",
] ]
@ -668,7 +668,7 @@ checksum = "252f6674aa3ba68bacfec506b91570a3cc206ad09b7ef4b23661959ef0246396"
dependencies = [ dependencies = [
"ahash", "ahash",
"bevy_derive", "bevy_derive",
"getrandom 0.2.4", "getrandom 0.2.5",
"instant", "instant",
"tracing", "tracing",
"uuid", "uuid",
@ -1271,9 +1271,9 @@ dependencies = [
[[package]] [[package]]
name = "getrandom" name = "getrandom"
version = "0.2.4" version = "0.2.5"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"js-sys", "js-sys",
@ -2140,9 +2140,9 @@ checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872"
[[package]] [[package]]
name = "proc-macro-crate" name = "proc-macro-crate"
version = "1.1.2" version = "1.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9dada8c9981fcf32929c3c0f0cd796a9284aca335565227ed88c83babb1d43dc" checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a"
dependencies = [ dependencies = [
"thiserror", "thiserror",
"toml", "toml",
@ -2231,7 +2231,7 @@ version = "0.6.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
dependencies = [ dependencies = [
"getrandom 0.2.4", "getrandom 0.2.5",
] ]
[[package]] [[package]]
@ -2785,7 +2785,7 @@ version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
dependencies = [ dependencies = [
"getrandom 0.2.4", "getrandom 0.2.5",
"serde", "serde",
] ]

View file

@ -6,7 +6,7 @@ use bevy::{
use bevy_rapier3d::{na::Vector3, physics::PhysicsSystems::StepWorld, prelude::*}; use bevy_rapier3d::{na::Vector3, physics::PhysicsSystems::StepWorld, prelude::*};
use crate::{ use crate::{
geometry::{CyberBike, CyberSphere, PLANET_RADIUS}, geometry::{CyberBike, CyberSphere, PLANET_RADIUS, SPAWN_ALTITUDE},
input::InputState, input::InputState,
}; };
@ -55,6 +55,13 @@ fn setup_colliders(
let pbody = RigidBodyBundle { let pbody = RigidBodyBundle {
body_type: RigidBodyType::Static.into(), body_type: RigidBodyType::Static.into(),
ccd: RigidBodyCcd {
ccd_enabled: true,
ccd_thickness: 2.0,
ccd_max_dist: SPAWN_ALTITUDE,
..Default::default()
}
.into(),
..Default::default() ..Default::default()
}; };
let pcollide = ColliderBundle { let pcollide = ColliderBundle {

View file

@ -3,7 +3,7 @@ use bevy::{
render::mesh::Indices, render::mesh::Indices,
}; };
use hexasphere::shapes::IcoSphere; use hexasphere::shapes::IcoSphere;
use noise::{HybridMulti, NoiseFn, Simplex}; use noise::{HybridMulti, NoiseFn, SuperSimplex};
use wgpu::PrimitiveTopology; use wgpu::PrimitiveTopology;
use crate::Label; use crate::Label;
@ -22,10 +22,10 @@ fn spawn_giant_sphere(
mut meshes: ResMut<Assets<Mesh>>, mut meshes: ResMut<Assets<Mesh>>,
mut materials: ResMut<Assets<StandardMaterial>>, mut materials: ResMut<Assets<StandardMaterial>>,
) { ) {
let color = Color::DARK_GRAY; let color = Color::rgb(0.2, 0.17, 0.2);
let isphere = shape::Icosphere { let isphere = shape::Icosphere {
radius: PLANET_RADIUS, radius: PLANET_RADIUS,
subdivisions: 64, subdivisions: 79,
}; };
let pmesh = gen_planet(isphere); let pmesh = gen_planet(isphere);
@ -89,7 +89,7 @@ fn gen_planet(sphere: Icosphere) -> Mesh {
// TODO: use displaced points for normals by replacing raw_points with // TODO: use displaced points for normals by replacing raw_points with
// noise-displaced points. // noise-displaced points.
let noise = HybridMulti::<Simplex>::default(); let noise = HybridMulti::<SuperSimplex>::default();
let raw_points = generated let raw_points = generated
.raw_points() .raw_points()