Files
rapier/src_testbed/plugin.rs
rezural 315b84a85e add plugins
cargo fmt
2020-12-21 04:23:11 +11:00

20 lines
698 B
Rust

use crate::physics::PhysicsState;
use kiss3d::window::Window;
use na::Point3;
pub trait TestbedPlugin {
fn init_graphics(&mut self, window: &mut Window, gen_color: &mut dyn FnMut() -> Point3<f32>);
fn clear_graphics(&mut self, window: &mut Window);
fn run_callbacks(&mut self, window: &mut Window, physics: &mut PhysicsState, t: f32);
fn step(&mut self, physics: &mut PhysicsState);
fn draw(&mut self);
fn profiling_string(&self) -> String;
}
pub trait HarnessPlugin {
//FIXME: is run_callbacks needed?
fn run_callbacks(&mut self, physics: &mut PhysicsState, t: f32);
fn step(&mut self, physics: &mut PhysicsState);
fn profiling_string(&self) -> String;
}