1#![deny(non_camel_case_types)]
41#![deny(unused_parens)]
42#![deny(non_upper_case_globals)]
43#![deny(unused_qualifications)]
44#![deny(missing_docs)]
45#![deny(unused_results)]
46#![warn(unused_imports)]
47#![allow(missing_copy_implementations)]
48#![doc(html_root_url = "http://ncollide.org/rustdoc")]
49
50#[cfg(feature = "serde")]
51#[macro_use]
52extern crate serde;
53#[macro_use]
54extern crate approx;
55#[macro_use]
56extern crate downcast_rs;
57#[macro_use]
58extern crate bitflags;
59extern crate num_traits as num;
60
61pub extern crate nalgebra as na;
62pub extern crate simba;
63
64macro_rules! try_ret {
65 ($val: expr) => {
66 try_ret!($val, ())
67 };
68 ($val: expr, $ret: expr) => {
69 if let Some(val) = $val {
70 val
71 } else {
72 return $ret;
73 }
74 };
75}
76
77const NOT_REGISTERED_ERROR: &'static str =
78 "This collision object has not been registered into a world (proxy indexes are None).";
79
80#[deprecated = "use the `pipeline` module instead."]
81pub use crate::pipeline::{broad_phase, narrow_phase, world};
82
83pub mod bounding_volume;
84pub mod interpolation;
85pub mod partitioning;
86pub mod pipeline;
87pub mod procedural;
88pub mod query;
89pub mod shape;
90pub mod transformation;
91pub mod utils;
92
93#[cfg(feature = "dim3")]
95pub mod math {
96 use na::{Isometry3, Matrix3, Point3, Translation3, UnitQuaternion, Vector3, Vector6, U3, U6};
97
98 pub const DIM: usize = 3;
100
101 pub type Dim = U3;
103
104 pub type SpatialDim = U6;
106
107 pub type AngularDim = U3;
109
110 pub type Point<N> = Point3<N>;
112
113 pub type AngularVector<N> = Vector3<N>;
115
116 pub type Vector<N> = Vector3<N>;
118
119 pub type Matrix<N> = Matrix3<N>;
121
122 pub type SpatialVector<N> = Vector6<N>;
124
125 pub type Orientation<N> = Vector3<N>;
127
128 pub type Isometry<N> = Isometry3<N>;
130
131 pub type Rotation<N> = UnitQuaternion<N>;
133
134 pub type Translation<N> = Translation3<N>;
136}
137
138#[cfg(feature = "dim2")]
140pub mod math {
141 use na::{Isometry2, Matrix2, Point2, Translation2, UnitComplex, Vector1, Vector2, U2};
142
143 pub const DIM: usize = 2;
145
146 pub type Dim = U2;
148
149 pub type Point<N> = Point2<N>;
151
152 pub type Vector<N> = Vector2<N>;
154
155 pub type Matrix<N> = Matrix2<N>;
157
158 pub type Orientation<N> = Vector1<N>;
160
161 pub type Isometry<N> = Isometry2<N>;
163
164 pub type Rotation<N> = UnitComplex<N>;
166
167 pub type Translation<N> = Translation2<N>;
169}