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
//! 2D physics ECS

pub use collide2d::*;
pub use core::physics2d::*;
pub use physics::setup_dispatch_2d;

use cgmath::{Basis2, Point2, Vector2};
use collision::primitive::Primitive2;
use collision::Aabb2;

use physics::{
    ContactResolutionSystem, CurrentFrameUpdateSystem, DeltaTime, NextFrameSetupSystem,
    PhysicalEntityParts,
};

/// Current frame integrator system for 2D
///
/// ### Type parameters:
///
/// - `S`: Scalar type (f32 or f64)
/// - `T`: Transform
pub type CurrentFrameUpdateSystem2<S, T> = CurrentFrameUpdateSystem<Point2<S>, Basis2<S>, S, T>;

/// Resolution system for 2D
///
/// ### Type parameters:
///
/// - `S`: Scalar type (f32 or f64)
/// - `T`: Transform type (`BodyPose2` or similar)
pub type ContactResolutionSystem2<S, T> = ContactResolutionSystem<Point2<S>, Basis2<S>, S, S, S, T>;

/// Next frame setup system for 2D
///
/// ### Type parameters:
///
/// - `S`: Scalar type (f32 or f64)
/// - `T`: Transform type (`BodyPose2` or similar)
pub type NextFrameSetupSystem2<S, T> =
    NextFrameSetupSystem<Point2<S>, Basis2<S>, S, S, T, DeltaTime<S>>;

/// SystemData for 2D
///
/// ### Type parameters:
///
/// - `S`: Scalar type (f32 or f64)
/// - `T`: Transform type (`BodyPose2` or similar)
/// - `Y`: Collision shape type, see `Collider`
pub type PhysicalEntityParts2<'a, S, T, Y> =
    PhysicalEntityParts<'a, Primitive2<S>, Y, Basis2<S>, Vector2<S>, S, S, Aabb2<S>, T>;