Compare commits
No commits in common. "5cfc2f7033cc3d20bc3b95eb69ddd3211b2ac165" and "82f95cf070ab3438bba2d430e0563ddab81be118" have entirely different histories.
5cfc2f7033
...
82f95cf070
10 changed files with 1175 additions and 2217 deletions
3314
Cargo.lock
generated
3314
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
30
Cargo.toml
30
Cargo.toml
|
@ -6,22 +6,32 @@ edition = "2021"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
# bevy_polyline = "0.4"
|
# bevy_polyline = "0.4"
|
||||||
noise = "0.9"
|
noise = { git = "https://github.com/Razaekel/noise-rs" }
|
||||||
hexasphere = "14"
|
hexasphere = "8"
|
||||||
wgpu = "0.20"
|
wgpu = "0.15"
|
||||||
# bevy-inspector-egui = "0.18"
|
bevy-inspector-egui = "0.18"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
inspector = []
|
inspector = []
|
||||||
|
|
||||||
[dependencies.bevy]
|
[dependencies.bevy]
|
||||||
version = "0.14"
|
version = "0.10"
|
||||||
default-features = true
|
default-features = false
|
||||||
features = ["bevy_dev_tools"]
|
features = [
|
||||||
|
"bevy_gilrs",
|
||||||
|
"bevy_winit",
|
||||||
|
"png",
|
||||||
|
"hdr",
|
||||||
|
"x11",
|
||||||
|
"bevy_ui",
|
||||||
|
"bevy_text",
|
||||||
|
"bevy_gltf",
|
||||||
|
"bevy_sprite",
|
||||||
|
]
|
||||||
|
|
||||||
[dependencies.avian3d]
|
[dependencies.bevy_rapier3d]
|
||||||
default-features = true
|
features = ["debug-render-3d"]
|
||||||
version = "0.1"
|
version = "0.21"
|
||||||
|
|
||||||
# Maybe also enable only a small amount of optimization for our code:
|
# Maybe also enable only a small amount of optimization for our code:
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
use avian3d::prelude::*;
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
app::Startup,
|
|
||||||
diagnostic::FrameTimeDiagnosticsPlugin,
|
diagnostic::FrameTimeDiagnosticsPlugin,
|
||||||
ecs::reflect::ReflectResource,
|
ecs::reflect::ReflectResource,
|
||||||
prelude::{App, IntoSystemConfigs, Plugin, Resource},
|
prelude::{App, IntoSystemConfigs, Plugin, Resource},
|
||||||
reflect::Reflect,
|
reflect::Reflect,
|
||||||
};
|
};
|
||||||
|
use bevy_rapier3d::prelude::{NoUserData, RapierPhysicsPlugin};
|
||||||
|
|
||||||
mod components;
|
mod components;
|
||||||
mod systems;
|
mod systems;
|
||||||
|
@ -29,9 +28,9 @@ impl Plugin for CyberActionPlugin {
|
||||||
.init_resource::<CyberLean>()
|
.init_resource::<CyberLean>()
|
||||||
.register_type::<CyberLean>()
|
.register_type::<CyberLean>()
|
||||||
.register_type::<CatControllerSettings>()
|
.register_type::<CatControllerSettings>()
|
||||||
.add_plugins(PhysicsPlugins::default())
|
.add_plugin(RapierPhysicsPlugin::<NoUserData>::default())
|
||||||
.add_systems(Startup, timestep_setup)
|
.add_startup_system(timestep_setup)
|
||||||
.add_plugins(FrameTimeDiagnosticsPlugin::default())
|
.add_plugin(FrameTimeDiagnosticsPlugin::default())
|
||||||
.add_systems(
|
.add_systems(
|
||||||
(
|
(
|
||||||
gravity,
|
gravity,
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
use std::f32::consts::{FRAC_PI_3, FRAC_PI_4};
|
use std::f32::consts::{FRAC_PI_3, FRAC_PI_4};
|
||||||
|
|
||||||
use avian3d::prelude::*;
|
|
||||||
use bevy::prelude::{
|
use bevy::prelude::{
|
||||||
Commands, Entity, Quat, Query, Res, ResMut, Time, Transform, Vec3, With, Without,
|
Commands, Entity, Quat, Query, Res, ResMut, Time, Transform, Vec3, With, Without,
|
||||||
};
|
};
|
||||||
|
use bevy_rapier3d::prelude::{
|
||||||
|
CollisionGroups, ExternalForce, Group, MultibodyJoint, QueryFilter, RapierConfiguration,
|
||||||
|
RapierContext, ReadMassProperties, TimestepMode, Velocity,
|
||||||
|
};
|
||||||
|
|
||||||
//#[cfg(feature = "inspector")]
|
#[cfg(feature = "inspector")]
|
||||||
//use super::ActionDebugInstant;
|
use super::ActionDebugInstant;
|
||||||
use super::{CatControllerSettings, CatControllerState, CyberLean, MovementSettings, Tunneling};
|
use super::{CatControllerSettings, CatControllerState, CyberLean, MovementSettings, Tunneling};
|
||||||
use crate::{
|
use crate::{
|
||||||
bike::{CyberBikeBody, CyberSteering, CyberWheel, WheelConfig, BIKE_WHEEL_COLLISION_GROUP},
|
bike::{CyberBikeBody, CyberSteering, CyberWheel, WheelConfig, BIKE_WHEEL_COLLISION_GROUP},
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
use avian3d::prelude::{
|
|
||||||
Ccd, Collider, ColliderMassProperties, CollisionGroups, Damping, ExternalForce, Friction,
|
|
||||||
ReadMassProperties, Restitution, RigidBody, Sleeping, TransformInterpolation, Velocity,
|
|
||||||
};
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
prelude::{AssetServer, BuildChildren, Commands, Quat, Res, SpatialBundle, Transform, Vec3},
|
prelude::{AssetServer, BuildChildren, Commands, Quat, Res, SpatialBundle, Transform, Vec3},
|
||||||
scene::SceneBundle,
|
scene::SceneBundle,
|
||||||
};
|
};
|
||||||
|
use bevy_rapier3d::prelude::{
|
||||||
|
Ccd, Collider, ColliderMassProperties, CollisionGroups, Damping, ExternalForce, Friction,
|
||||||
|
ReadMassProperties, Restitution, RigidBody, Sleeping, TransformInterpolation, Velocity,
|
||||||
|
};
|
||||||
|
|
||||||
use super::{spawn_wheels, CyberBikeBody, Meshterial, WheelConfig, BIKE_BODY_COLLISION_GROUP};
|
use super::{spawn_wheels, CyberBikeBody, Meshterial, WheelConfig, BIKE_BODY_COLLISION_GROUP};
|
||||||
use crate::{action::CatControllerState, planet::PLANET_RADIUS};
|
use crate::{action::CatControllerState, planet::PLANET_RADIUS};
|
||||||
|
|
|
@ -2,16 +2,16 @@ mod body;
|
||||||
mod components;
|
mod components;
|
||||||
mod wheels;
|
mod wheels;
|
||||||
|
|
||||||
use bevy::{
|
use bevy::prelude::{
|
||||||
app::PostStartup,
|
App, Assets, IntoSystemConfig, Mesh, Plugin, ResMut, StandardMaterial, StartupSet,
|
||||||
prelude::{App, Assets, Mesh, Plugin, ResMut, StandardMaterial},
|
|
||||||
};
|
};
|
||||||
|
use bevy_rapier3d::prelude::Group;
|
||||||
|
|
||||||
pub(crate) use self::components::*;
|
pub(crate) use self::components::*;
|
||||||
use self::{body::spawn_cyberbike, wheels::spawn_wheels};
|
use self::{body::spawn_cyberbike, wheels::spawn_wheels};
|
||||||
|
|
||||||
pub const BIKE_BODY_COLLISION_GROUP: (u32, u32) = (0b01, 0b01);
|
pub const BIKE_BODY_COLLISION_GROUP: (Group, Group) = (Group::GROUP_1, Group::GROUP_1);
|
||||||
pub const BIKE_WHEEL_COLLISION_GROUP: (u32, u32) = (0b10, 0b10);
|
pub const BIKE_WHEEL_COLLISION_GROUP: (Group, Group) = (Group::GROUP_10, Group::GROUP_10);
|
||||||
|
|
||||||
type Meshterial<'a> = (
|
type Meshterial<'a> = (
|
||||||
ResMut<'a, Assets<Mesh>>,
|
ResMut<'a, Assets<Mesh>>,
|
||||||
|
@ -23,6 +23,6 @@ impl Plugin for CyberBikePlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
app.insert_resource(WheelConfig::default())
|
app.insert_resource(WheelConfig::default())
|
||||||
.register_type::<WheelConfig>()
|
.register_type::<WheelConfig>()
|
||||||
.add_systems(PostStartup, spawn_cyberbike);
|
.add_startup_system(spawn_cyberbike.in_base_set(StartupSet::PostStartup));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
use avian3d::prelude::{
|
use bevy::prelude::{shape::Torus as Tire, *};
|
||||||
|
use bevy_rapier3d::prelude::{
|
||||||
Ccd, CoefficientCombineRule, Collider, ColliderMassProperties, CollisionGroups, Damping,
|
Ccd, CoefficientCombineRule, Collider, ColliderMassProperties, CollisionGroups, Damping,
|
||||||
ExternalForce, Friction, MultibodyJoint, PrismaticJointBuilder, Restitution,
|
ExternalForce, Friction, MultibodyJoint, PrismaticJointBuilder, Restitution,
|
||||||
RevoluteJointBuilder, RigidBody, Sleeping, TransformInterpolation,
|
RevoluteJointBuilder, RigidBody, Sleeping, TransformInterpolation,
|
||||||
};
|
};
|
||||||
use bevy::prelude::{shape::Torus as Tire, *};
|
|
||||||
|
|
||||||
use super::{CyberSteering, CyberWheel, Meshterial, WheelConfig, BIKE_WHEEL_COLLISION_GROUP};
|
use super::{CyberSteering, CyberWheel, Meshterial, WheelConfig, BIKE_WHEEL_COLLISION_GROUP};
|
||||||
|
|
||||||
|
|
|
@ -9,7 +9,7 @@ pub struct CyberGlamorPlugin;
|
||||||
impl Plugin for CyberGlamorPlugin {
|
impl Plugin for CyberGlamorPlugin {
|
||||||
fn build(&self, app: &mut App) {
|
fn build(&self, app: &mut App) {
|
||||||
{
|
{
|
||||||
use avian3d::render::{
|
use bevy_rapier3d::render::{
|
||||||
DebugRenderMode, DebugRenderStyle, RapierDebugRenderPlugin,
|
DebugRenderMode, DebugRenderStyle, RapierDebugRenderPlugin,
|
||||||
};
|
};
|
||||||
let style = DebugRenderStyle {
|
let style = DebugRenderStyle {
|
||||||
|
|
|
@ -2,7 +2,7 @@ use bevy::{
|
||||||
prelude::{shape::Icosphere, *},
|
prelude::{shape::Icosphere, *},
|
||||||
render::{color::Color, mesh::Indices},
|
render::{color::Color, mesh::Indices},
|
||||||
};
|
};
|
||||||
use avian3d::prelude::*;
|
use bevy_rapier3d::prelude::*;
|
||||||
use hexasphere::shapes::IcoSphere;
|
use hexasphere::shapes::IcoSphere;
|
||||||
use noise::{HybridMulti, NoiseFn, SuperSimplex};
|
use noise::{HybridMulti, NoiseFn, SuperSimplex};
|
||||||
use rand::{Rng, SeedableRng};
|
use rand::{Rng, SeedableRng};
|
||||||
|
|
|
@ -4,7 +4,7 @@ use bevy::prelude::{
|
||||||
};
|
};
|
||||||
#[cfg(feature = "inspector")]
|
#[cfg(feature = "inspector")]
|
||||||
use bevy_inspector_egui::quick::WorldInspectorPlugin;
|
use bevy_inspector_egui::quick::WorldInspectorPlugin;
|
||||||
use avian3d::prelude::Velocity;
|
use bevy_rapier3d::prelude::Velocity;
|
||||||
|
|
||||||
use crate::bike::CyberBikeBody;
|
use crate::bike::CyberBikeBody;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue