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:
@@ -27,9 +27,9 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let critical_damping = 2.0 * (stiffness * mass).sqrt();
|
||||
for i in 0..=num {
|
||||
let x_pos = -6.0 + 1.5 * i as f32;
|
||||
let ball_pos = point![x_pos, 4.5, 0.0];
|
||||
let ball_pos = Vector::new(x_pos, 4.5, 0.0);
|
||||
let rigid_body = RigidBodyBuilder::dynamic()
|
||||
.translation(ball_pos.coords)
|
||||
.translation(ball_pos)
|
||||
.can_sleep(false);
|
||||
let handle = bodies.insert(rigid_body);
|
||||
let collider = ColliderBuilder::ball(radius);
|
||||
@@ -38,12 +38,11 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let damping_ratio = i as f32 / (num as f32 / 2.0);
|
||||
let damping = damping_ratio * critical_damping;
|
||||
let joint = SpringJointBuilder::new(0.0, stiffness, damping)
|
||||
.local_anchor1(ball_pos - Vector::y() * 3.0);
|
||||
.local_anchor1(ball_pos - Vector::Y * 3.0);
|
||||
impulse_joints.insert(ground_handle, handle, joint, true);
|
||||
|
||||
// Box that will fall on to of the springed balls, makes the simulation funier to watch.
|
||||
let rigid_body =
|
||||
RigidBodyBuilder::dynamic().translation(ball_pos.coords + Vector::y() * 5.0);
|
||||
// Box that will fall on to of the springed balls, makes the simulation funnier to watch.
|
||||
let rigid_body = RigidBodyBuilder::dynamic().translation(ball_pos + Vector::Y * 5.0);
|
||||
let handle = bodies.insert(rigid_body);
|
||||
let collider = ColliderBuilder::cuboid(radius, radius, radius).density(100.0);
|
||||
colliders.insert_with_parent(collider, handle, &mut bodies);
|
||||
@@ -57,8 +56,8 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
colliders,
|
||||
impulse_joints,
|
||||
multibody_joints,
|
||||
vector![0.0, -9.81, 0.0],
|
||||
Vector::new(0.0, -9.81, 0.0),
|
||||
(),
|
||||
);
|
||||
testbed.look_at(point![15.0, 5.0, 42.0], point![13.0, 1.0, 1.0]);
|
||||
testbed.look_at(Vec3::new(15.0, 5.0, 42.0), Vec3::new(13.0, 1.0, 1.0));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user