feat: migrate to glam whenever relevant + migrate testbed to kiss3d instead of bevy + release v0.32.0 (#909)
* feat: migrate to glam whenever relevant + migrate testbed to kiss3d instead of bevy * chore: update changelog * Fix warnings and tests * Release v0.32.0
This commit is contained in:
@@ -12,28 +12,28 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
|
||||
#[allow(clippy::excessive_precision)]
|
||||
let mut ps1 = [
|
||||
Point::new(16.0, 0.0),
|
||||
Point::new(14.93803712795643, 5.133601056842984),
|
||||
Point::new(13.79871746027416, 10.24928069555078),
|
||||
Point::new(12.56252963284711, 15.34107019122473),
|
||||
Point::new(11.20040987372525, 20.39856541571217),
|
||||
Point::new(9.66521217819836, 25.40369899225096),
|
||||
Point::new(7.87179930638133, 30.3179337000085),
|
||||
Point::new(5.635199558196225, 35.03820717801641),
|
||||
Point::new(2.405937953536585, 39.09554102558315),
|
||||
Vector::new(16.0, 0.0),
|
||||
Vector::new(14.93803712795643, 5.133601056842984),
|
||||
Vector::new(13.79871746027416, 10.24928069555078),
|
||||
Vector::new(12.56252963284711, 15.34107019122473),
|
||||
Vector::new(11.20040987372525, 20.39856541571217),
|
||||
Vector::new(9.66521217819836, 25.40369899225096),
|
||||
Vector::new(7.87179930638133, 30.3179337000085),
|
||||
Vector::new(5.635199558196225, 35.03820717801641),
|
||||
Vector::new(2.405937953536585, 39.09554102558315),
|
||||
];
|
||||
|
||||
#[allow(clippy::excessive_precision)]
|
||||
let mut ps2 = [
|
||||
Point::new(24.0, 0.0),
|
||||
Point::new(22.33619528222415, 6.02299846205841),
|
||||
Point::new(20.54936888969905, 12.00964361211476),
|
||||
Point::new(18.60854610798073, 17.9470321677465),
|
||||
Point::new(16.46769273811807, 23.81367936585418),
|
||||
Point::new(14.05325025774858, 29.57079353071012),
|
||||
Point::new(11.23551045834022, 35.13775818285372),
|
||||
Point::new(7.752568160730571, 40.30450679009583),
|
||||
Point::new(3.016931552701656, 44.28891593799322),
|
||||
Vector::new(24.0, 0.0),
|
||||
Vector::new(22.33619528222415, 6.02299846205841),
|
||||
Vector::new(20.54936888969905, 12.00964361211476),
|
||||
Vector::new(18.60854610798073, 17.9470321677465),
|
||||
Vector::new(16.46769273811807, 23.81367936585418),
|
||||
Vector::new(14.05325025774858, 29.57079353071012),
|
||||
Vector::new(11.23551045834022, 35.13775818285372),
|
||||
Vector::new(7.752568160730571, 40.30450679009583),
|
||||
Vector::new(3.016931552701656, 44.28891593799322),
|
||||
];
|
||||
|
||||
let scale = 0.25;
|
||||
@@ -47,7 +47,8 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
/*
|
||||
* Ground
|
||||
*/
|
||||
let collider = ColliderBuilder::segment(point![-100.0, 0.0], point![100.0, 0.0]).friction(0.6);
|
||||
let collider =
|
||||
ColliderBuilder::segment(Vector::new(-100.0, 0.0), Vector::new(100.0, 0.0)).friction(0.6);
|
||||
colliders.insert(collider);
|
||||
|
||||
/*
|
||||
@@ -65,10 +66,10 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
|
||||
for i in 0..8 {
|
||||
let ps = [
|
||||
point![-ps2[i].x, ps2[i].y],
|
||||
point![-ps1[i].x, ps1[i].y],
|
||||
point![-ps1[i + 1].x, ps1[i + 1].y],
|
||||
point![-ps2[i + 1].x, ps2[i + 1].y],
|
||||
Vector::new(-ps2[i].x, ps2[i].y),
|
||||
Vector::new(-ps1[i].x, ps1[i].y),
|
||||
Vector::new(-ps1[i + 1].x, ps1[i + 1].y),
|
||||
Vector::new(-ps2[i + 1].x, ps2[i + 1].y),
|
||||
];
|
||||
let rigid_body = RigidBodyBuilder::dynamic();
|
||||
let ground_handle = bodies.insert(rigid_body);
|
||||
@@ -82,8 +83,8 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let ps = [
|
||||
ps1[8],
|
||||
ps2[8],
|
||||
point![-ps1[8].x, ps1[8].y],
|
||||
point![-ps2[8].x, ps2[8].y],
|
||||
Vector::new(-ps1[8].x, ps1[8].y),
|
||||
Vector::new(-ps2[8].x, ps2[8].y),
|
||||
];
|
||||
let rigid_body = RigidBodyBuilder::dynamic();
|
||||
let ground_handle = bodies.insert(rigid_body);
|
||||
@@ -94,8 +95,8 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
}
|
||||
|
||||
for i in 0..4 {
|
||||
let rigid_body =
|
||||
RigidBodyBuilder::dynamic().translation(vector![0.0, 0.5 + ps2[8].y + 1.0 * i as f32]);
|
||||
let rigid_body = RigidBodyBuilder::dynamic()
|
||||
.translation(Vector::new(0.0, 0.5 + ps2[8].y + 1.0 * i as f32));
|
||||
let ground_handle = bodies.insert(rigid_body);
|
||||
let collider = ColliderBuilder::cuboid(2.0, 0.5).friction(friction);
|
||||
colliders.insert_with_parent(collider, ground_handle, &mut bodies);
|
||||
@@ -105,5 +106,5 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
* Set up the testbed.
|
||||
*/
|
||||
testbed.set_world(bodies, colliders, impulse_joints, multibody_joints);
|
||||
testbed.look_at(point![0.0, 2.5], 20.0);
|
||||
testbed.look_at(Vec2::new(0.0, 2.5), 20.0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user