aboutsummaryrefslogtreecommitdiff
path: root/src/geometry/mod.rs
diff options
context:
space:
mode:
authorSébastien Crozet <developer@crozet.re>2020-10-27 09:57:26 +0100
committerGitHub <noreply@github.com>2020-10-27 09:57:26 +0100
commit93153f5d93358e83c8a4ca2b7195bf9aae95ffb9 (patch)
tree16ccb1aedc30d5c09d59e6ee5c7faa987e67b202 /src/geometry/mod.rs
parentf8acf6a5e9d3ba537dac6502b0e0541236b418c5 (diff)
parentffbc3c02c7d328d5c48a3efb84d35f5911f1880b (diff)
downloadrapier-93153f5d93358e83c8a4ca2b7195bf9aae95ffb9.tar.gz
rapier-93153f5d93358e83c8a4ca2b7195bf9aae95ffb9.tar.bz2
rapier-93153f5d93358e83c8a4ca2b7195bf9aae95ffb9.zip
Merge pull request #41 from dimforge/cylinder
Add cylinder and cone support + use a trait-object for shapes.
Diffstat (limited to 'src/geometry/mod.rs')
-rw-r--r--src/geometry/mod.rs27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/geometry/mod.rs b/src/geometry/mod.rs
index 562f962..abb9844 100644
--- a/src/geometry/mod.rs
+++ b/src/geometry/mod.rs
@@ -2,7 +2,7 @@
pub use self::broad_phase_multi_sap::BroadPhase;
pub use self::capsule::Capsule;
-pub use self::collider::{Collider, ColliderBuilder, Shape};
+pub use self::collider::{Collider, ColliderBuilder, ColliderShape};
pub use self::collider_set::{ColliderHandle, ColliderSet};
pub use self::contact::{
Contact, ContactKinematics, ContactManifold, ContactPair, KinematicsCategory,
@@ -19,9 +19,13 @@ pub use self::narrow_phase::NarrowPhase;
pub use self::polygon::Polygon;
pub use self::proximity::ProximityPair;
pub use self::proximity_detector::{DefaultProximityDispatcher, ProximityDispatcher};
+#[cfg(feature = "dim3")]
+pub use self::round_cylinder::RoundCylinder;
pub use self::trimesh::Trimesh;
pub use ncollide::query::Proximity;
+/// A segment shape.
+pub type Segment = ncollide::shape::Segment<f32>;
/// A cuboid shape.
pub type Cuboid = ncollide::shape::Cuboid<f32>;
/// A triangle shape.
@@ -30,6 +34,12 @@ pub type Triangle = ncollide::shape::Triangle<f32>;
pub type Ball = ncollide::shape::Ball<f32>;
/// A heightfield shape.
pub type HeightField = ncollide::shape::HeightField<f32>;
+/// A cylindrical shape.
+#[cfg(feature = "dim3")]
+pub type Cylinder = ncollide::shape::Cylinder<f32>;
+/// A cone shape.
+#[cfg(feature = "dim3")]
+pub type Cone = ncollide::shape::Cone<f32>;
/// An axis-aligned bounding box.
pub type AABB = ncollide::bounding_volume::AABB<f32>;
/// Event triggered when two non-sensor colliders start or stop being in contact.
@@ -40,6 +50,8 @@ pub type ProximityEvent = ncollide::pipeline::ProximityEvent<ColliderHandle>;
pub type Ray = ncollide::query::Ray<f32>;
/// The intersection between a ray and a collider.
pub type RayIntersection = ncollide::query::RayIntersection<f32>;
+/// The the projection of a point on a collider.
+pub type PointProjection = ncollide::query::PointProjection<f32>;
#[cfg(feature = "simd-is-enabled")]
pub(crate) use self::ball::WBall;
@@ -47,18 +59,21 @@ pub(crate) use self::broad_phase_multi_sap::{BroadPhasePairEvent, ColliderPair};
pub(crate) use self::collider_set::RemovedCollider;
#[cfg(feature = "simd-is-enabled")]
pub(crate) use self::contact::WContact;
+pub(crate) use self::contact_generator::clip_segments;
#[cfg(feature = "dim2")]
-pub(crate) use self::contact_generator::{clip_segments, clip_segments_with_normal};
+pub(crate) use self::contact_generator::clip_segments_with_normal;
pub(crate) use self::narrow_phase::ContactManifoldIndex;
#[cfg(feature = "dim3")]
+pub(crate) use self::polygonal_feature_map::PolygonalFeatureMap;
+#[cfg(feature = "dim3")]
pub(crate) use self::polyhedron_feature3d::PolyhedronFace;
pub(crate) use self::waabb::{WRay, WAABB};
pub(crate) use self::wquadtree::WQuadtree;
//pub(crate) use self::z_order::z_cmp_floats;
+pub use self::shape::{Shape, ShapeType};
mod ball;
mod broad_phase_multi_sap;
-mod capsule;
mod collider;
mod collider_set;
mod contact;
@@ -81,3 +96,9 @@ mod trimesh;
mod waabb;
mod wquadtree;
//mod z_order;
+mod capsule;
+#[cfg(feature = "dim3")]
+mod polygonal_feature_map;
+#[cfg(feature = "dim3")]
+mod round_cylinder;
+mod shape;