checkpoint

This commit is contained in:
Joe Ardent 2023-02-05 15:41:23 -08:00
parent 52e685ceed
commit 18615e9ac8
2 changed files with 23 additions and 14 deletions

View file

@ -2,10 +2,13 @@ use bevy::prelude::{
shape::Capsule as Tire, AlphaMode, BuildChildren, Color, Commands, Entity, Mesh, PbrBundle, shape::Capsule as Tire, AlphaMode, BuildChildren, Color, Commands, Entity, Mesh, PbrBundle,
Quat, SpatialBundle, StandardMaterial, Transform, Vec3, Quat, SpatialBundle, StandardMaterial, Transform, Vec3,
}; };
use bevy_rapier3d::prelude::{ use bevy_rapier3d::{
Ccd, CoefficientCombineRule, Collider, ColliderMassProperties, CollisionGroups, Damping, prelude::{
ExternalForce, Friction, LockedAxes, MultibodyJoint, PrismaticJointBuilder, Restitution, Ccd, CoefficientCombineRule, Collider, ColliderMassProperties, CollisionGroups, Damping,
RevoluteJointBuilder, RigidBody, Sleeping, TransformInterpolation, ExternalForce, Friction, LockedAxes, MultibodyJoint, PrismaticJointBuilder, Restitution,
RevoluteJointBuilder, RigidBody, Sleeping, TransformInterpolation,
},
render::ColliderDebugColor,
}; };
use super::{CyberSteering, CyberWheel, Meshterial, WheelConfig, BIKE_WHEEL_COLLISION_GROUP}; use super::{CyberSteering, CyberWheel, Meshterial, WheelConfig, BIKE_WHEEL_COLLISION_GROUP};
@ -127,7 +130,12 @@ pub fn spawn_tires(
CyberWheel, CyberWheel,
ExternalForce::default(), ExternalForce::default(),
not_sleeping, not_sleeping,
//axel, ColliderDebugColor(Color::Rgba {
red: 0.1,
green: 0.1,
blue: 0.1,
alpha: 0.5,
}), //axel,
); );
let _wentity = commands let _wentity = commands
@ -142,15 +150,15 @@ pub fn spawn_tires(
..Default::default() ..Default::default()
}) })
.insert(wheel_bundle) .insert(wheel_bundle)
.with_children(|wheel| { // .with_children(|wheel| {
wheel // wheel
.spawn(SpatialBundle::default()) // .spawn(SpatialBundle::default())
.insert(pbr_bundle.clone()) // .insert(pbr_bundle.clone())
.insert(TransformInterpolation { // .insert(TransformInterpolation {
start: None, // start: None,
end: None, // end: None,
}); // });
}) // })
.set_parent(sentity) .set_parent(sentity)
.id(); .id();
} }

View file

@ -82,6 +82,7 @@ impl Plugin for CyberGlamorPlugin {
}; };
let style = DebugRenderStyle { let style = DebugRenderStyle {
multibody_joint_anchor_color: Color::GREEN.as_rgba_f32(), multibody_joint_anchor_color: Color::GREEN.as_rgba_f32(),
multibody_joint_separation_color: Color::GOLD.as_rgba_f32(),
..Default::default() ..Default::default()
}; };
let mode = DebugRenderMode::CONTACTS let mode = DebugRenderMode::CONTACTS