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,15 +1,12 @@
|
||||
#![allow(dead_code)]
|
||||
#![allow(clippy::type_complexity)]
|
||||
|
||||
#[cfg(target_arch = "wasm32")]
|
||||
use wasm_bindgen::prelude::*;
|
||||
|
||||
use rapier_testbed3d::{Testbed, TestbedApp};
|
||||
use std::cmp::Ordering;
|
||||
use rapier_testbed3d::{Example, TestbedApp};
|
||||
|
||||
mod utils;
|
||||
|
||||
mod ccd3;
|
||||
mod character_controller3;
|
||||
mod collision_groups3;
|
||||
mod compound3;
|
||||
mod convex_decomposition3;
|
||||
@@ -20,36 +17,34 @@ mod debug_articulations3;
|
||||
mod debug_balls3;
|
||||
mod debug_big_colliders3;
|
||||
mod debug_boxes3;
|
||||
mod debug_chain_high_mass_ratio3;
|
||||
mod debug_cube_high_mass_ratio3;
|
||||
mod debug_cylinder3;
|
||||
mod debug_deserialize3;
|
||||
mod debug_disabled3;
|
||||
mod debug_dynamic_collider_add3;
|
||||
mod debug_friction3;
|
||||
mod debug_infinite_fall3;
|
||||
mod debug_internal_edges3;
|
||||
mod debug_long_chain3;
|
||||
mod debug_multibody_ang_motor_pos3;
|
||||
mod debug_pop3;
|
||||
mod debug_prismatic3;
|
||||
mod debug_rollback3;
|
||||
mod debug_shape_modification3;
|
||||
mod debug_sleeping_kinematic3;
|
||||
mod debug_thin_cube_on_mesh3;
|
||||
mod debug_triangle3;
|
||||
mod debug_trimesh3;
|
||||
mod debug_two_cubes3;
|
||||
mod domino3;
|
||||
mod dynamic_trimesh3;
|
||||
mod fountain3;
|
||||
mod heightfield3;
|
||||
mod joints3;
|
||||
// mod joints3;
|
||||
mod character_controller3;
|
||||
mod debug_chain_high_mass_ratio3;
|
||||
mod debug_cube_high_mass_ratio3;
|
||||
mod debug_disabled3;
|
||||
mod debug_internal_edges3;
|
||||
mod debug_long_chain3;
|
||||
mod debug_multibody_ang_motor_pos3;
|
||||
mod debug_sleeping_kinematic3;
|
||||
mod debug_two_cubes3;
|
||||
mod gyroscopic3;
|
||||
mod heightfield3;
|
||||
mod inverse_kinematics3;
|
||||
mod joint_motor_position3;
|
||||
mod joints3;
|
||||
mod keva3;
|
||||
mod locked_rotations3;
|
||||
mod newton_cradle3;
|
||||
@@ -60,101 +55,162 @@ mod restitution3;
|
||||
mod rope_joints3;
|
||||
mod sensor3;
|
||||
mod spring_joints3;
|
||||
mod stress_tests;
|
||||
mod trimesh3;
|
||||
mod urdf3;
|
||||
mod vehicle_controller3;
|
||||
mod vehicle_joints3;
|
||||
mod voxels3;
|
||||
|
||||
#[cfg_attr(target_arch = "wasm32", wasm_bindgen(start))]
|
||||
pub fn main() {
|
||||
let mut builders: Vec<(_, fn(&mut Testbed))> = vec![
|
||||
("Character controller", character_controller3::init_world),
|
||||
("Fountain", fountain3::init_world),
|
||||
("Primitives", primitives3::init_world),
|
||||
("Multibody joints", joints3::init_world_with_articulations),
|
||||
("CCD", ccd3::init_world),
|
||||
("Collision groups", collision_groups3::init_world),
|
||||
("Compound", compound3::init_world),
|
||||
("Convex decomposition", convex_decomposition3::init_world),
|
||||
("Convex polyhedron", convex_polyhedron3::init_world),
|
||||
("Damping", damping3::init_world),
|
||||
("Gyroscopic", gyroscopic3::init_world),
|
||||
("Domino", domino3::init_world),
|
||||
("Dynamic trimeshes", dynamic_trimesh3::init_world),
|
||||
("Heightfield", heightfield3::init_world),
|
||||
("Impulse Joints", joints3::init_world_with_joints),
|
||||
("Inverse kinematics", inverse_kinematics3::init_world),
|
||||
("Joint Motor Position", joint_motor_position3::init_world),
|
||||
("Locked rotations", locked_rotations3::init_world),
|
||||
("One-way platforms", one_way_platforms3::init_world),
|
||||
("Platform", platform3::init_world),
|
||||
("Restitution", restitution3::init_world),
|
||||
("Rope Joints", rope_joints3::init_world),
|
||||
("Sensor", sensor3::init_world),
|
||||
("Spring Joints", spring_joints3::init_world),
|
||||
("TriMesh", trimesh3::init_world),
|
||||
("Urdf", urdf3::init_world),
|
||||
("Voxels", voxels3::init_world),
|
||||
("Vehicle controller", vehicle_controller3::init_world),
|
||||
("Vehicle joints", vehicle_joints3::init_world),
|
||||
("Keva tower", keva3::init_world),
|
||||
("Newton cradle", newton_cradle3::init_world),
|
||||
("(Debug) multibody_joints", debug_articulations3::init_world),
|
||||
(
|
||||
"(Debug) add/rm collider",
|
||||
#[kiss3d::main]
|
||||
pub async fn main() {
|
||||
const COLLISIONS: &str = "Collisions";
|
||||
const DYNAMICS: &str = "Dynamics";
|
||||
const COMPLEX: &str = "Complex Shapes";
|
||||
const JOINTS: &str = "Joints";
|
||||
const CONTROLS: &str = "Controls";
|
||||
const DEBUG: &str = "Debug";
|
||||
const ROBOTICS: &str = "Robotics";
|
||||
|
||||
let mut builders: Vec<Example> = vec![
|
||||
// ── Collisions ──────────────────────────────────────────────────────────
|
||||
Example::new(COLLISIONS, "Fountain", fountain3::init_world),
|
||||
Example::new(COLLISIONS, "Primitives", primitives3::init_world),
|
||||
Example::new(COLLISIONS, "Keva tower", keva3::init_world),
|
||||
Example::new(COLLISIONS, "Newton cradle", newton_cradle3::init_world),
|
||||
Example::new(COLLISIONS, "Domino", domino3::init_world),
|
||||
Example::new(COLLISIONS, "Platform", platform3::init_world),
|
||||
Example::new(COLLISIONS, "Sensor", sensor3::init_world),
|
||||
Example::new(COLLISIONS, "Compound", compound3::init_world),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
Example::new(
|
||||
COLLISIONS,
|
||||
"Convex decomposition",
|
||||
convex_decomposition3::init_world,
|
||||
),
|
||||
Example::new(
|
||||
COLLISIONS,
|
||||
"Convex polyhedron",
|
||||
convex_polyhedron3::init_world,
|
||||
),
|
||||
Example::new(COLLISIONS, "TriMesh", trimesh3::init_world),
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
Example::new(
|
||||
COLLISIONS,
|
||||
"Dynamic trimeshes",
|
||||
dynamic_trimesh3::init_world,
|
||||
),
|
||||
Example::new(COLLISIONS, "Heightfield", heightfield3::init_world),
|
||||
Example::new(COLLISIONS, "Voxels", voxels3::init_world),
|
||||
Example::new(
|
||||
COLLISIONS,
|
||||
"Collision groups",
|
||||
collision_groups3::init_world,
|
||||
),
|
||||
Example::new(
|
||||
COLLISIONS,
|
||||
"One-way platforms",
|
||||
one_way_platforms3::init_world,
|
||||
),
|
||||
// ── Dynamics ─────────────────────────────────────────────────────────
|
||||
Example::new(DYNAMICS, "Locked rotations", locked_rotations3::init_world),
|
||||
Example::new(DYNAMICS, "Restitution", restitution3::init_world),
|
||||
Example::new(DYNAMICS, "Damping", damping3::init_world),
|
||||
Example::new(DYNAMICS, "Gyroscopic", gyroscopic3::init_world),
|
||||
Example::new(DYNAMICS, "CCD", ccd3::init_world),
|
||||
// ── Joints ─────────────────────────────────────────────────────────
|
||||
Example::new(JOINTS, "Impulse Joints", joints3::init_world_with_joints),
|
||||
Example::new(
|
||||
JOINTS,
|
||||
"Multibody Joints",
|
||||
joints3::init_world_with_articulations,
|
||||
),
|
||||
Example::new(JOINTS, "Rope Joints", rope_joints3::init_world),
|
||||
Example::new(JOINTS, "Spring Joints", spring_joints3::init_world),
|
||||
Example::new(
|
||||
JOINTS,
|
||||
"Joint Motor Position",
|
||||
joint_motor_position3::init_world,
|
||||
),
|
||||
Example::new(
|
||||
JOINTS,
|
||||
"Inverse kinematics",
|
||||
inverse_kinematics3::init_world,
|
||||
),
|
||||
// ── Controls ─────────────────────────────────────────────────────
|
||||
Example::new(
|
||||
CONTROLS,
|
||||
"Character controller",
|
||||
character_controller3::init_world,
|
||||
),
|
||||
Example::new(
|
||||
CONTROLS,
|
||||
"Vehicle controller",
|
||||
vehicle_controller3::init_world,
|
||||
),
|
||||
Example::new(CONTROLS, "Vehicle joints", vehicle_joints3::init_world),
|
||||
// ── Robotics ───────────────────────────────────────────────────────
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
Example::new(ROBOTICS, "URDF", urdf3::init_world),
|
||||
// ── Debug ──────────────────────────────────────────────────────────
|
||||
Example::new(DEBUG, "Multibody joints", debug_articulations3::init_world),
|
||||
Example::new(
|
||||
DEBUG,
|
||||
"Add/rm collider",
|
||||
debug_add_remove_collider3::init_world,
|
||||
),
|
||||
("(Debug) big colliders", debug_big_colliders3::init_world),
|
||||
("(Debug) boxes", debug_boxes3::init_world),
|
||||
("(Debug) balls", debug_balls3::init_world),
|
||||
("(Debug) disabled", debug_disabled3::init_world),
|
||||
("(Debug) two cubes", debug_two_cubes3::init_world),
|
||||
("(Debug) pop", debug_pop3::init_world),
|
||||
(
|
||||
"(Debug) dyn. coll. add",
|
||||
Example::new(DEBUG, "Big colliders", debug_big_colliders3::init_world),
|
||||
Example::new(DEBUG, "Boxes", debug_boxes3::init_world),
|
||||
Example::new(DEBUG, "Balls", debug_balls3::init_world),
|
||||
Example::new(DEBUG, "Disabled", debug_disabled3::init_world),
|
||||
Example::new(DEBUG, "Two cubes", debug_two_cubes3::init_world),
|
||||
Example::new(DEBUG, "Pop", debug_pop3::init_world),
|
||||
Example::new(
|
||||
DEBUG,
|
||||
"Dyn. collider add",
|
||||
debug_dynamic_collider_add3::init_world,
|
||||
),
|
||||
("(Debug) friction", debug_friction3::init_world),
|
||||
("(Debug) internal edges", debug_internal_edges3::init_world),
|
||||
("(Debug) long chain", debug_long_chain3::init_world),
|
||||
(
|
||||
"(Debug) high mass ratio: chain",
|
||||
Example::new(DEBUG, "Friction", debug_friction3::init_world),
|
||||
Example::new(DEBUG, "Internal edges", debug_internal_edges3::init_world),
|
||||
Example::new(DEBUG, "Long chain", debug_long_chain3::init_world),
|
||||
Example::new(
|
||||
DEBUG,
|
||||
"High mass ratio: chain",
|
||||
debug_chain_high_mass_ratio3::init_world,
|
||||
),
|
||||
(
|
||||
"(Debug) high mass ratio: cube",
|
||||
Example::new(
|
||||
DEBUG,
|
||||
"High mass ratio: cube",
|
||||
debug_cube_high_mass_ratio3::init_world,
|
||||
),
|
||||
("(Debug) triangle", debug_triangle3::init_world),
|
||||
("(Debug) trimesh", debug_trimesh3::init_world),
|
||||
("(Debug) thin cube", debug_thin_cube_on_mesh3::init_world),
|
||||
("(Debug) cylinder", debug_cylinder3::init_world),
|
||||
("(Debug) infinite fall", debug_infinite_fall3::init_world),
|
||||
("(Debug) prismatic", debug_prismatic3::init_world),
|
||||
("(Debug) rollback", debug_rollback3::init_world),
|
||||
(
|
||||
"(Debug) shape modification",
|
||||
Example::new(DEBUG, "Triangle", debug_triangle3::init_world),
|
||||
Example::new(DEBUG, "Trimesh", debug_trimesh3::init_world),
|
||||
Example::new(DEBUG, "Thin cube", debug_thin_cube_on_mesh3::init_world),
|
||||
Example::new(DEBUG, "Cylinder", debug_cylinder3::init_world),
|
||||
Example::new(DEBUG, "Infinite fall", debug_infinite_fall3::init_world),
|
||||
Example::new(DEBUG, "Prismatic", debug_prismatic3::init_world),
|
||||
Example::new(DEBUG, "Rollback", debug_rollback3::init_world),
|
||||
Example::new(
|
||||
DEBUG,
|
||||
"Shape modification",
|
||||
debug_shape_modification3::init_world,
|
||||
),
|
||||
(
|
||||
"(Debug) sleeping kinematics",
|
||||
Example::new(
|
||||
DEBUG,
|
||||
"Sleeping kinematics",
|
||||
debug_sleeping_kinematic3::init_world,
|
||||
),
|
||||
("(Debug) deserialize", debug_deserialize3::init_world),
|
||||
(
|
||||
"(Debug) multibody ang. motor pos.",
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
Example::new(DEBUG, "Deserialize", debug_deserialize3::init_world),
|
||||
Example::new(
|
||||
DEBUG,
|
||||
"Multibody ang. motor pos.",
|
||||
debug_multibody_ang_motor_pos3::init_world,
|
||||
),
|
||||
];
|
||||
|
||||
// Lexicographic sort, with stress tests moved at the end of the list.
|
||||
builders.sort_by(|a, b| match (a.0.starts_with('('), b.0.starts_with('(')) {
|
||||
(true, true) | (false, false) => a.0.cmp(b.0),
|
||||
(true, false) => Ordering::Greater,
|
||||
(false, true) => Ordering::Less,
|
||||
});
|
||||
let mut benches = stress_tests::builders();
|
||||
builders.append(&mut benches);
|
||||
|
||||
let testbed = TestbedApp::from_builders(builders);
|
||||
testbed.run()
|
||||
testbed.run().await
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user