1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#![warn(
missing_debug_implementations,
rust_2018_idioms,
rust_2018_compatibility,
clippy::all
)]
use area_physics_server::AreaNpServer;
use joint_physics_server::JointNpServer;
use rigid_body_physics_server::RBodyNpServer;
use shape_physics_server::ShapeNpServer;
use world_physics_server::WorldNpServer;
use amethyst_physics::{servers::PhysicsWorld, PtReal};
#[allow(missing_debug_implementations)]
pub struct NPhysicsBackend;
impl<N> amethyst_physics::PhysicsBackend<N> for NPhysicsBackend
where
N: PtReal,
{
fn create_world() -> PhysicsWorld<N> {
let storages = servers_storage::ServersStorage::new();
PhysicsWorld::new(
Box::new(WorldNpServer::new(storages.clone())),
Box::new(RBodyNpServer::new(storages.clone())),
Box::new(AreaNpServer::new(storages.clone())),
Box::new(ShapeNpServer::new(storages.clone())),
Box::new(JointNpServer::new(storages.clone())),
)
}
}
#[macro_use]
mod conditional_macros;
mod area_physics_server;
mod body;
mod body_storage;
mod collider_storage;
mod conversors;
mod force_generator;
mod force_generator_storage;
mod joint;
mod joint_physics_server;
mod joint_storage;
mod rigid_body_physics_server;
pub mod servers_storage;
mod shape;
mod shape_physics_server;
mod storage;
mod utils;
mod world_physics_server;