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
//! Type wrappers and convenience functions for 2D collision detection

pub use collision::algorithm::minkowski::GJK2;
pub use collision::primitive::{Circle, ConvexPolygon, Particle2, Rectangle, Square};

use cgmath::{Basis2, Point2};
use collision::algorithm::broad_phase::BruteForce;
use collision::primitive::Primitive2;
use collision::Aabb2;

use collide::*;
use BodyPose;

/// Collision shape for 2D, see [`CollisionShape`](../collide/struct.CollisionShape.html) for more
/// information
///
/// ### Type parameters:
///
/// - `S`: Scalar type (f32 or f64)
/// - `T`: Transform
/// - `Y`: Collider type, see `Collider` for more information
pub type CollisionShape2<S, T, Y = ()> = CollisionShape<Primitive2<S>, T, Aabb2<S>, Y>;

/// Broad phase brute force algorithm for 2D, see
/// [`BruteForce`](../collide/broad/struct.BruteForce.html) for more information.
pub type BroadBruteForce2 = BruteForce;

/// Broad phase sweep and prune algorithm
///
/// ### Type parameters:
///
/// - `S`: Scalar type (f32 or f64)
pub type SweepAndPrune2<S> = ::collision::algorithm::broad_phase::SweepAndPrune2<S, Aabb2<S>>;

/// Body pose transform for 2D, see [`BodyPos`e](../struct.BodyPose.html) for more information.
///
/// ### Type parameters:
///
/// - `S`: Scalar type (f32 or f64)
pub type BodyPose2<S> = BodyPose<Point2<S>, Basis2<S>>;