rhusics_ecs/
physics2d.rs

1//! 2D physics ECS
2
3pub use collide2d::*;
4pub use core::physics2d::*;
5pub use physics::setup_dispatch_2d;
6
7use cgmath::{Basis2, Point2, Vector2};
8use collision::primitive::Primitive2;
9use collision::Aabb2;
10
11use physics::{
12    ContactResolutionSystem, CurrentFrameUpdateSystem, DeltaTime, NextFrameSetupSystem,
13    PhysicalEntityParts,
14};
15
16/// Current frame integrator system for 2D
17///
18/// ### Type parameters:
19///
20/// - `S`: Scalar type (f32 or f64)
21/// - `T`: Transform
22pub type CurrentFrameUpdateSystem2<S, T> = CurrentFrameUpdateSystem<Point2<S>, Basis2<S>, S, T>;
23
24/// Resolution system for 2D
25///
26/// ### Type parameters:
27///
28/// - `S`: Scalar type (f32 or f64)
29/// - `T`: Transform type (`BodyPose2` or similar)
30pub type ContactResolutionSystem2<S, T> = ContactResolutionSystem<Point2<S>, Basis2<S>, S, S, S, T>;
31
32/// Next frame setup system for 2D
33///
34/// ### Type parameters:
35///
36/// - `S`: Scalar type (f32 or f64)
37/// - `T`: Transform type (`BodyPose2` or similar)
38pub type NextFrameSetupSystem2<S, T> =
39    NextFrameSetupSystem<Point2<S>, Basis2<S>, S, S, T, DeltaTime<S>>;
40
41/// SystemData for 2D
42///
43/// ### Type parameters:
44///
45/// - `S`: Scalar type (f32 or f64)
46/// - `T`: Transform type (`BodyPose2` or similar)
47/// - `Y`: Collision shape type, see `Collider`
48pub type PhysicalEntityParts2<'a, S, T, Y> =
49    PhysicalEntityParts<'a, Primitive2<S>, Y, Basis2<S>, Vector2<S>, S, S, Aabb2<S>, T>;