diff options
| author | Sébastien Crozet <developer@crozet.re> | 2020-10-27 09:57:26 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-10-27 09:57:26 +0100 |
| commit | 93153f5d93358e83c8a4ca2b7195bf9aae95ffb9 (patch) | |
| tree | 16ccb1aedc30d5c09d59e6ee5c7faa987e67b202 /src/geometry/trimesh.rs | |
| parent | f8acf6a5e9d3ba537dac6502b0e0541236b418c5 (diff) | |
| parent | ffbc3c02c7d328d5c48a3efb84d35f5911f1880b (diff) | |
| download | rapier-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/trimesh.rs')
| -rw-r--r-- | src/geometry/trimesh.rs | 45 |
1 files changed, 38 insertions, 7 deletions
diff --git a/src/geometry/trimesh.rs b/src/geometry/trimesh.rs index b6e23e7..b4e8518 100644 --- a/src/geometry/trimesh.rs +++ b/src/geometry/trimesh.rs @@ -1,13 +1,9 @@ -use crate::geometry::{Triangle, WQuadtree}; +use crate::geometry::{PointProjection, Ray, RayIntersection, Triangle, WQuadtree}; use crate::math::{Isometry, Point}; use na::Point3; use ncollide::bounding_volume::{HasBoundingVolume, AABB}; - -#[cfg(feature = "dim3")] -use { - crate::geometry::{Ray, RayIntersection}, - ncollide::query::RayCast, -}; +use ncollide::query::{PointQuery, RayCast}; +use ncollide::shape::FeatureId; #[derive(Clone)] #[cfg_attr(feature = "serde-serialize", derive(Serialize, Deserialize))] @@ -110,6 +106,41 @@ impl Trimesh { } } +impl PointQuery<f32> for Trimesh { + fn project_point(&self, _m: &Isometry<f32>, _pt: &Point<f32>, _solid: bool) -> PointProjection { + // TODO + unimplemented!() + } + + fn project_point_with_feature( + &self, + _m: &Isometry<f32>, + _pt: &Point<f32>, + ) -> (PointProjection, FeatureId) { + // TODO + unimplemented!() + } +} + +#[cfg(feature = "dim2")] +impl RayCast<f32> for Trimesh { + fn toi_and_normal_with_ray( + &self, + _m: &Isometry<f32>, + _ray: &Ray, + _max_toi: f32, + _solid: bool, + ) -> Option<RayIntersection> { + // TODO + None + } + + fn intersects_ray(&self, _m: &Isometry<f32>, _ray: &Ray, _max_toi: f32) -> bool { + // TODO + false + } +} + #[cfg(feature = "dim3")] impl RayCast<f32> for Trimesh { fn toi_and_normal_with_ray( |
