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:
@@ -1,4 +1,5 @@
|
||||
use rapier_testbed3d::Testbed;
|
||||
use rapier3d::glamx::{DVec3, Vec3};
|
||||
use rapier3d::na::ComplexField;
|
||||
use rapier3d::prelude::*;
|
||||
|
||||
@@ -14,10 +15,10 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
/*
|
||||
* Ground
|
||||
*/
|
||||
let ground_size = vector![200.0, 1.0, 200.0];
|
||||
let ground_size = DVec3::new(200.0, 1.0, 200.0);
|
||||
let nsubdivs = 20;
|
||||
|
||||
let heights = DMatrix::from_fn(nsubdivs + 1, nsubdivs + 1, |i, j| {
|
||||
let heights = Array2::from_fn(nsubdivs + 1, nsubdivs + 1, |i, j| {
|
||||
if i == 0 || i == nsubdivs || j == 0 || j == nsubdivs {
|
||||
10.0
|
||||
} else {
|
||||
@@ -60,7 +61,7 @@ pub fn init_world(testbed: &mut Testbed) {
|
||||
let z = k as f64 * shift - centerz;
|
||||
|
||||
// Build the rigid body.
|
||||
let rigid_body = RigidBodyBuilder::dynamic().translation(vector![x, y, z]);
|
||||
let rigid_body = RigidBodyBuilder::dynamic().translation(DVec3::new(x, y, z));
|
||||
let handle = bodies.insert(rigid_body);
|
||||
|
||||
if j % 2 == 0 {
|
||||
@@ -78,5 +79,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![100.0, 100.0, 100.0], Point::origin());
|
||||
testbed.look_at(Vec3::new(100.0, 100.0, 100.0), Vec3::ZERO);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user