From 5e4ef7d5de0e4ab41c5bf53a8bb2b87e21f5c77b Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Tue, 8 Feb 2022 13:27:57 -0800 Subject: [PATCH] Add input forces that don't work. --- Cargo.lock | 4 +- src/action.rs | 133 ++++++++++++++++-------------------------------- src/geometry.rs | 5 +- src/ui.rs | 10 ++-- 4 files changed, 54 insertions(+), 98 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 009256f..ccded1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -978,9 +978,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2209c310e29876f7f0b2721e7e26b84aff178aa3da5d091f9bfbf47669e60e3" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if 1.0.0", ] diff --git a/src/action.rs b/src/action.rs index b5c242c..f86b184 100644 --- a/src/action.rs +++ b/src/action.rs @@ -1,5 +1,5 @@ use bevy::prelude::*; -use bevy_rapier3d::prelude::*; +use bevy_rapier3d::{na::Vector3, prelude::*}; use crate::{ geometry::{CyberBike, CyberSphere, PLANET_RADIUS}, @@ -25,42 +25,6 @@ impl Default for MovementSettings { } } -#[derive(Component, Default)] -pub(crate) struct CyberBikeState { - pub velocity: Vec3, - pub _colliding: bool, -} - -fn gravity(xform: Query<&Transform, With>, mut config: ResMut) { - let gravity = xform.single().translation.normalize() * -10.0; - config.gravity = gravity.into(); -} - -fn falling_cat( - time: Res