#![allow(dead_code)]
use rapier_viewport_plugin::RapierPlugin;
use viewport_lib::{
FixedTimestep, Material, NodeId, Scene, ViewportRuntime,
};
pub fn add_node_at(scene: &mut Scene, pos: glam::Vec3) -> NodeId {
scene.add(
None,
glam::Mat4::from_translation(pos),
Material::from_colour([1.0, 1.0, 1.0]),
)
}
pub fn make_runtime(plugin: &RapierPlugin, sim_hz: f32) -> ViewportRuntime {
let (prepare, simulate) = plugin.clone().into_plugins();
ViewportRuntime::new()
.with_fixed_timestep(FixedTimestep::new(sim_hz))
.with_plugin(prepare)
.with_plugin(simulate)
}