cargo fmt
This commit is contained in:
@@ -19,10 +19,10 @@ pub struct RunState {
|
|||||||
impl RunState {
|
impl RunState {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
#[cfg(feature = "parallel")]
|
#[cfg(feature = "parallel")]
|
||||||
let num_threads = num_cpus::get_physical();
|
let num_threads = num_cpus::get_physical();
|
||||||
|
|
||||||
#[cfg(feature = "parallel")]
|
#[cfg(feature = "parallel")]
|
||||||
let thread_pool = rapier::rayon::ThreadPoolBuilder::new()
|
let thread_pool = rapier::rayon::ThreadPoolBuilder::new()
|
||||||
.num_threads(num_threads)
|
.num_threads(num_threads)
|
||||||
.build()
|
.build()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|||||||
@@ -1,12 +1,17 @@
|
|||||||
|
use crate::harness::RunState;
|
||||||
use crate::physics::PhysicsState;
|
use crate::physics::PhysicsState;
|
||||||
use kiss3d::window::Window;
|
use kiss3d::window::Window;
|
||||||
use na::Point3;
|
use na::Point3;
|
||||||
use crate::harness::RunState;
|
|
||||||
|
|
||||||
pub trait TestbedPlugin {
|
pub trait TestbedPlugin {
|
||||||
fn init_graphics(&mut self, window: &mut Window, gen_color: &mut dyn FnMut() -> Point3<f32>);
|
fn init_graphics(&mut self, window: &mut Window, gen_color: &mut dyn FnMut() -> Point3<f32>);
|
||||||
fn clear_graphics(&mut self, window: &mut Window);
|
fn clear_graphics(&mut self, window: &mut Window);
|
||||||
fn run_callbacks(&mut self, window: &mut Window, physics: &mut PhysicsState, run_state: &RunState);
|
fn run_callbacks(
|
||||||
|
&mut self,
|
||||||
|
window: &mut Window,
|
||||||
|
physics: &mut PhysicsState,
|
||||||
|
run_state: &RunState,
|
||||||
|
);
|
||||||
fn step(&mut self, physics: &mut PhysicsState);
|
fn step(&mut self, physics: &mut PhysicsState);
|
||||||
fn draw(&mut self);
|
fn draw(&mut self);
|
||||||
fn profiling_string(&self) -> String;
|
fn profiling_string(&self) -> String;
|
||||||
|
|||||||
@@ -1025,7 +1025,7 @@ impl State for Testbed {
|
|||||||
window,
|
window,
|
||||||
&mut self.harness.physics.integration_parameters,
|
&mut self.harness.physics.integration_parameters,
|
||||||
&mut self.state,
|
&mut self.state,
|
||||||
&mut self.harness.state
|
&mut self.harness.state,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ use kiss3d::conrod::{self, Borderable, Colorable, Labelable, Positionable, Sizea
|
|||||||
use kiss3d::window::Window;
|
use kiss3d::window::Window;
|
||||||
use rapier::dynamics::IntegrationParameters;
|
use rapier::dynamics::IntegrationParameters;
|
||||||
|
|
||||||
use crate::testbed::{RunMode, TestbedActionFlags, TestbedState, TestbedStateFlags};
|
|
||||||
use crate::harness::RunState;
|
use crate::harness::RunState;
|
||||||
|
use crate::testbed::{RunMode, TestbedActionFlags, TestbedState, TestbedStateFlags};
|
||||||
|
|
||||||
const SIDEBAR_W: f64 = 200.0;
|
const SIDEBAR_W: f64 = 200.0;
|
||||||
const ELEMENT_W: f64 = SIDEBAR_W - 20.0;
|
const ELEMENT_W: f64 = SIDEBAR_W - 20.0;
|
||||||
|
|||||||
Reference in New Issue
Block a user