Fix many warnings.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::dynamics::MassProperties;
|
||||
use crate::math::Point;
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::geometry::Capsule;
|
||||
use crate::math::{Point, PrincipalAngularInertia, Rotation, Vector};
|
||||
use crate::math::Rotation;
|
||||
|
||||
impl MassProperties {
|
||||
pub(crate) fn from_capsule(density: f32, half_height: f32, radius: f32) -> Self {
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
use crate::dynamics::MassProperties;
|
||||
use crate::math::{PrincipalAngularInertia, Vector};
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::geometry::Capsule;
|
||||
use crate::math::{Point, PrincipalAngularInertia, Rotation, Vector};
|
||||
use {
|
||||
crate::geometry::Capsule,
|
||||
crate::math::{Point, Rotation},
|
||||
};
|
||||
|
||||
impl MassProperties {
|
||||
pub(crate) fn cylinder_y_volume_unit_inertia(
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
#![allow(dead_code)] // TODO: remove this
|
||||
|
||||
use crate::dynamics::MassProperties;
|
||||
use crate::math::Point;
|
||||
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
use crate::dynamics::{MassProperties, RigidBodyHandle, RigidBodySet};
|
||||
use crate::geometry::{
|
||||
Ball, Capsule, ColliderGraphIndex, Contact, Cuboid, HeightField, InteractionGraph, Polygon,
|
||||
Proximity, Ray, RayIntersection, Rounded, Shape, ShapeType, Triangle, Trimesh,
|
||||
Ball, Capsule, ColliderGraphIndex, Contact, Cuboid, HeightField, InteractionGraph, Proximity,
|
||||
Shape, ShapeType, Triangle, Trimesh,
|
||||
};
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::geometry::{Cone, Cylinder, PolygonalFeatureMap};
|
||||
use crate::geometry::{Cone, Cylinder, PolygonalFeatureMap, Rounded};
|
||||
use crate::math::{AngVector, Isometry, Point, Rotation, Vector};
|
||||
use downcast_rs::{impl_downcast, DowncastSync};
|
||||
use erased_serde::Serialize;
|
||||
use na::Point3;
|
||||
use ncollide::bounding_volume::{HasBoundingVolume, AABB};
|
||||
use ncollide::query::RayCast;
|
||||
use num::Zero;
|
||||
use std::any::Any;
|
||||
use ncollide::bounding_volume::AABB;
|
||||
use std::ops::Deref;
|
||||
use std::sync::Arc;
|
||||
|
||||
@@ -21,8 +16,8 @@ use std::sync::Arc;
|
||||
pub struct ColliderShape(pub Arc<dyn Shape>);
|
||||
|
||||
impl Deref for ColliderShape {
|
||||
type Target = Shape;
|
||||
fn deref(&self) -> &Shape {
|
||||
type Target = dyn Shape;
|
||||
fn deref(&self) -> &dyn Shape {
|
||||
&*self.0
|
||||
}
|
||||
}
|
||||
@@ -257,7 +252,7 @@ impl Collider {
|
||||
}
|
||||
|
||||
/// The geometric shape of this collider.
|
||||
pub fn shape(&self) -> &Shape {
|
||||
pub fn shape(&self) -> &dyn Shape {
|
||||
&*self.shape.0
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::geometry::contact_generator::PrimitiveContactGenerationContext;
|
||||
use crate::geometry::{Ball, Contact, KinematicsCategory, Shape};
|
||||
use crate::geometry::{Ball, Contact, KinematicsCategory};
|
||||
use crate::math::Isometry;
|
||||
use na::Unit;
|
||||
use ncollide::query::PointQuery;
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use crate::geometry::contact_generator::PrimitiveContactGenerationContext;
|
||||
use crate::geometry::{Capsule, Contact, ContactManifold, KinematicsCategory, Shape};
|
||||
use crate::geometry::{Capsule, Contact, ContactManifold, KinematicsCategory};
|
||||
use crate::math::Isometry;
|
||||
use crate::math::Vector;
|
||||
use approx::AbsDiffEq;
|
||||
use na::Unit;
|
||||
#[cfg(feature = "dim2")]
|
||||
use ncollide::shape::{Segment, SegmentPointLocation};
|
||||
use ncollide::shape::SegmentPointLocation;
|
||||
|
||||
pub fn generate_contacts_capsule_capsule(ctxt: &mut PrimitiveContactGenerationContext) {
|
||||
if let (Some(capsule1), Some(capsule2)) = (ctxt.shape1.as_capsule(), ctxt.shape2.as_capsule()) {
|
||||
@@ -39,10 +39,11 @@ pub fn generate_contacts<'a>(
|
||||
let pos12 = pos1.inverse() * pos2;
|
||||
let pos21 = pos12.inverse();
|
||||
|
||||
let capsule2_1 = capsule2.transform_by(&pos12);
|
||||
let seg1 = capsule1.segment();
|
||||
let seg2_1 = capsule2.segment().transformed(&pos12);
|
||||
let (loc1, loc2) = ncollide::query::closest_points_segment_segment_with_locations_nD(
|
||||
(&capsule1.a, &capsule1.b),
|
||||
(&capsule2_1.a, &capsule2_1.b),
|
||||
(&seg1.a, &seg1.b),
|
||||
(&seg2_1.a, &seg2_1.b),
|
||||
);
|
||||
|
||||
// We do this clone to perform contact tracking and transfer impulses.
|
||||
@@ -65,8 +66,8 @@ pub fn generate_contacts<'a>(
|
||||
|
||||
let bcoords1 = loc1.barycentric_coordinates();
|
||||
let bcoords2 = loc2.barycentric_coordinates();
|
||||
let local_p1 = capsule1.a * bcoords1[0] + capsule1.b.coords * bcoords1[1];
|
||||
let local_p2 = capsule2_1.a * bcoords2[0] + capsule2_1.b.coords * bcoords2[1];
|
||||
let local_p1 = seg1.a * bcoords1[0] + seg1.b.coords * bcoords1[1];
|
||||
let local_p2 = seg2_1.a * bcoords2[0] + seg2_1.b.coords * bcoords2[1];
|
||||
|
||||
let local_n1 =
|
||||
Unit::try_new(local_p2 - local_p1, f32::default_epsilon()).unwrap_or(Vector::y_axis());
|
||||
@@ -87,18 +88,15 @@ pub fn generate_contacts<'a>(
|
||||
return;
|
||||
}
|
||||
|
||||
let seg1 = Segment::new(capsule1.a, capsule1.b);
|
||||
let seg2 = Segment::new(capsule2_1.a, capsule2_1.b);
|
||||
|
||||
if let (Some(dir1), Some(dir2)) = (seg1.direction(), seg2.direction()) {
|
||||
if let (Some(dir1), Some(dir2)) = (seg1.direction(), seg2_1.direction()) {
|
||||
if dir1.dot(&dir2).abs() >= crate::utils::COS_FRAC_PI_8
|
||||
&& dir1.dot(&local_n1).abs() < crate::utils::SIN_FRAC_PI_8
|
||||
{
|
||||
// Capsules axes are almost parallel and are almost perpendicular to the normal.
|
||||
// Find a second contact point.
|
||||
if let Some((clip_a, clip_b)) = crate::geometry::clip_segments_with_normal(
|
||||
(capsule1.a, capsule1.b),
|
||||
(capsule2_1.a, capsule2_1.b),
|
||||
(seg1.a, seg1.b),
|
||||
(seg2_1.a, seg2_1.b),
|
||||
*local_n1,
|
||||
) {
|
||||
let contact =
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::geometry::contact_generator::PfmPfmContactManifoldGeneratorWorkspace;
|
||||
use crate::geometry::contact_generator::{
|
||||
ContactGenerator, ContactPhase, HeightFieldShapeContactGeneratorWorkspace,
|
||||
PfmPfmContactManifoldGeneratorWorkspace, PrimitiveContactGenerator,
|
||||
TrimeshShapeContactGeneratorWorkspace,
|
||||
PrimitiveContactGenerator, TrimeshShapeContactGeneratorWorkspace,
|
||||
};
|
||||
use crate::geometry::{Shape, ShapeType};
|
||||
use crate::geometry::ShapeType;
|
||||
use std::any::Any;
|
||||
|
||||
/// Trait implemented by structures responsible for selecting a collision-detection algorithm
|
||||
@@ -92,6 +93,7 @@ impl ContactDispatcher for DefaultContactDispatcher {
|
||||
None,
|
||||
)
|
||||
}
|
||||
#[cfg(feature = "dim3")]
|
||||
(ShapeType::Cylinder, _)
|
||||
| (_, ShapeType::Cylinder)
|
||||
| (ShapeType::Cone, _)
|
||||
|
||||
@@ -139,8 +139,8 @@ pub struct PrimitiveContactGenerationContext<'a> {
|
||||
pub prediction_distance: f32,
|
||||
pub collider1: &'a Collider,
|
||||
pub collider2: &'a Collider,
|
||||
pub shape1: &'a Shape,
|
||||
pub shape2: &'a Shape,
|
||||
pub shape1: &'a dyn Shape,
|
||||
pub shape2: &'a dyn Shape,
|
||||
pub position1: &'a Isometry<f32>,
|
||||
pub position2: &'a Isometry<f32>,
|
||||
pub manifold: &'a mut ContactManifold,
|
||||
@@ -152,8 +152,8 @@ pub struct PrimitiveContactGenerationContextSimd<'a, 'b> {
|
||||
pub prediction_distance: f32,
|
||||
pub colliders1: [&'a Collider; SIMD_WIDTH],
|
||||
pub colliders2: [&'a Collider; SIMD_WIDTH],
|
||||
pub shapes1: [&'a Shape; SIMD_WIDTH],
|
||||
pub shapes2: [&'a Shape; SIMD_WIDTH],
|
||||
pub shapes1: [&'a dyn Shape; SIMD_WIDTH],
|
||||
pub shapes2: [&'a dyn Shape; SIMD_WIDTH],
|
||||
pub positions1: &'a Isometry<SimdFloat>,
|
||||
pub positions2: &'a Isometry<SimdFloat>,
|
||||
pub manifolds: &'a mut [&'b mut ContactManifold],
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
use crate::geometry::contact_generator::PrimitiveContactGenerationContext;
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::geometry::PolyhedronFace;
|
||||
use crate::geometry::{cuboid, sat, Capsule, ContactManifold, Cuboid, KinematicsCategory, Shape};
|
||||
use crate::geometry::{cuboid, sat, Capsule, ContactManifold, Cuboid, KinematicsCategory};
|
||||
#[cfg(feature = "dim2")]
|
||||
use crate::geometry::{CuboidFeature, CuboidFeatureFace};
|
||||
use crate::math::Isometry;
|
||||
use crate::math::Vector;
|
||||
use ncollide::shape::Segment;
|
||||
|
||||
pub fn generate_contacts_cuboid_capsule(ctxt: &mut PrimitiveContactGenerationContext) {
|
||||
if let (Some(cube1), Some(capsule2)) = (ctxt.shape1.as_cuboid(), ctxt.shape2.as_capsule()) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::geometry::contact_generator::PrimitiveContactGenerationContext;
|
||||
use crate::geometry::{cuboid, sat, ContactManifold, CuboidFeature, KinematicsCategory, Shape};
|
||||
use crate::geometry::{cuboid, sat, ContactManifold, CuboidFeature, KinematicsCategory};
|
||||
use crate::math::Isometry;
|
||||
#[cfg(feature = "dim2")]
|
||||
use crate::math::Vector;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::geometry::contact_generator::PrimitiveContactGenerationContext;
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::geometry::PolyhedronFace;
|
||||
use crate::geometry::{cuboid, sat, ContactManifold, Cuboid, KinematicsCategory, Shape, Triangle};
|
||||
use crate::geometry::{cuboid, sat, ContactManifold, Cuboid, KinematicsCategory, Triangle};
|
||||
use crate::math::Isometry;
|
||||
#[cfg(feature = "dim2")]
|
||||
use crate::{
|
||||
|
||||
@@ -3,7 +3,7 @@ use crate::geometry::contact_generator::{
|
||||
};
|
||||
#[cfg(feature = "dim2")]
|
||||
use crate::geometry::Capsule;
|
||||
use crate::geometry::{Collider, ContactManifold, HeightField, Shape, ShapeType};
|
||||
use crate::geometry::{Collider, ContactManifold, HeightField, ShapeType};
|
||||
use crate::ncollide::bounding_volume::BoundingVolume;
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::{geometry::Triangle, math::Point};
|
||||
@@ -117,8 +117,8 @@ fn do_generate_contacts(
|
||||
let position1 = *collider1.position();
|
||||
#[cfg(feature = "dim2")]
|
||||
let (position1, sub_shape1) = {
|
||||
let (dpos, height) = crate::utils::segment_to_capsule(&part1.a, &part1.b);
|
||||
(position1 * dpos, Capsule::new(height, 0.0));
|
||||
let (dpos, half_height) = crate::utils::segment_to_capsule(&part1.a, &part1.b);
|
||||
(position1 * dpos, Capsule::new(half_height, 0.0))
|
||||
};
|
||||
#[cfg(feature = "dim3")]
|
||||
let sub_shape1 = *part1;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
use crate::geometry::contact_generator::PrimitiveContactGenerationContext;
|
||||
use crate::geometry::{sat, Contact, ContactManifold, KinematicsCategory, Polygon, Shape};
|
||||
use crate::geometry::{sat, Contact, ContactManifold, KinematicsCategory, Polygon};
|
||||
use crate::math::{Isometry, Point};
|
||||
#[cfg(feature = "dim2")]
|
||||
use crate::{math::Vector, utils};
|
||||
|
||||
pub fn generate_contacts_polygon_polygon(ctxt: &mut PrimitiveContactGenerationContext) {
|
||||
pub fn generate_contacts_polygon_polygon(_ctxt: &mut PrimitiveContactGenerationContext) {
|
||||
unimplemented!()
|
||||
// if let (Shape::Polygon(polygon1), Shape::Polygon(polygon2)) = (ctxt.shape1, ctxt.shape2) {
|
||||
// generate_contacts(
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::geometry::contact_generator::{
|
||||
ContactGenerationContext, PrimitiveContactGenerationContext,
|
||||
};
|
||||
use crate::geometry::{Collider, ContactManifold, Shape, ShapeType, Trimesh};
|
||||
use crate::geometry::{Collider, ContactManifold, ShapeType, Trimesh};
|
||||
use crate::ncollide::bounding_volume::{BoundingVolume, AABB};
|
||||
|
||||
pub struct TrimeshShapeContactGeneratorWorkspace {
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::geometry::PolyhedronFace;
|
||||
use crate::geometry::{cuboid, Cone, Cuboid, Cylinder, Triangle};
|
||||
use crate::math::{Point, Vector};
|
||||
use approx::AbsDiffEq;
|
||||
use na::{Unit, Vector2, Vector3};
|
||||
use na::{Unit, Vector2};
|
||||
use ncollide::shape::Segment;
|
||||
use ncollide::shape::SupportMap;
|
||||
|
||||
|
||||
@@ -387,8 +387,6 @@ impl PolyhedronFace {
|
||||
/// Compute the barycentric coordinates of the intersection between the two given lines.
|
||||
/// Returns `None` if the lines are parallel.
|
||||
fn closest_points_line2d(edge1: [Point2<f32>; 2], edge2: [Point2<f32>; 2]) -> Option<(f32, f32)> {
|
||||
use approx::AbsDiffEq;
|
||||
|
||||
// Inspired by Real-time collision detection by Christer Ericson.
|
||||
let dir1 = edge1[1] - edge1[0];
|
||||
let dir2 = edge2[1] - edge2[0];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::geometry::proximity_detector::PrimitiveProximityDetectionContext;
|
||||
use crate::geometry::{Ball, Proximity, Shape};
|
||||
use crate::geometry::{Ball, Proximity};
|
||||
use crate::math::Isometry;
|
||||
use ncollide::query::PointQuery;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::geometry::proximity_detector::PrimitiveProximityDetectionContext;
|
||||
use crate::geometry::{sat, Proximity, Shape};
|
||||
use crate::geometry::{sat, Proximity};
|
||||
use crate::math::Isometry;
|
||||
use ncollide::shape::Cuboid;
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use crate::geometry::proximity_detector::PrimitiveProximityDetectionContext;
|
||||
use crate::geometry::{sat, Cuboid, Proximity, Shape, Triangle};
|
||||
use crate::geometry::{sat, Cuboid, Proximity, Triangle};
|
||||
use crate::math::Isometry;
|
||||
|
||||
pub fn detect_proximity_cuboid_triangle(
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
use crate::geometry::proximity_detector::PrimitiveProximityDetectionContext;
|
||||
use crate::geometry::{sat, Polygon, Proximity, Shape};
|
||||
use crate::geometry::{sat, Polygon, Proximity};
|
||||
use crate::math::Isometry;
|
||||
|
||||
pub fn detect_proximity_polygon_polygon(
|
||||
ctxt: &mut PrimitiveProximityDetectionContext,
|
||||
_ctxt: &mut PrimitiveProximityDetectionContext,
|
||||
) -> Proximity {
|
||||
unimplemented!()
|
||||
// if let (Some(polygon1), Some(polygon2)) = (ctxt.shape1.as_polygon(), ctxt.shape2.as_polygon()) {
|
||||
|
||||
@@ -120,8 +120,8 @@ pub struct PrimitiveProximityDetectionContext<'a> {
|
||||
pub prediction_distance: f32,
|
||||
pub collider1: &'a Collider,
|
||||
pub collider2: &'a Collider,
|
||||
pub shape1: &'a Shape,
|
||||
pub shape2: &'a Shape,
|
||||
pub shape1: &'a dyn Shape,
|
||||
pub shape2: &'a dyn Shape,
|
||||
pub position1: &'a Isometry<f32>,
|
||||
pub position2: &'a Isometry<f32>,
|
||||
pub workspace: Option<&'a mut (dyn Any + Send + Sync)>,
|
||||
@@ -132,8 +132,8 @@ pub struct PrimitiveProximityDetectionContextSimd<'a, 'b> {
|
||||
pub prediction_distance: f32,
|
||||
pub colliders1: [&'a Collider; SIMD_WIDTH],
|
||||
pub colliders2: [&'a Collider; SIMD_WIDTH],
|
||||
pub shapes1: [&'a Shape; SIMD_WIDTH],
|
||||
pub shapes2: [&'a Shape; SIMD_WIDTH],
|
||||
pub shapes1: [&'a dyn Shape; SIMD_WIDTH],
|
||||
pub shapes2: [&'a dyn Shape; SIMD_WIDTH],
|
||||
pub positions1: &'a Isometry<SimdFloat>,
|
||||
pub positions2: &'a Isometry<SimdFloat>,
|
||||
pub workspaces: &'a mut [Option<&'b mut (dyn Any + Send + Sync)>],
|
||||
|
||||
@@ -2,7 +2,7 @@ use crate::geometry::proximity_detector::{
|
||||
PrimitiveProximityDetector, ProximityDetector, ProximityPhase,
|
||||
TrimeshShapeProximityDetectorWorkspace,
|
||||
};
|
||||
use crate::geometry::{Shape, ShapeType};
|
||||
use crate::geometry::ShapeType;
|
||||
use std::any::Any;
|
||||
|
||||
/// Trait implemented by structures responsible for selecting a collision-detection algorithm
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
use crate::geometry::proximity_detector::{
|
||||
PrimitiveProximityDetectionContext, ProximityDetectionContext,
|
||||
};
|
||||
use crate::geometry::{Collider, Proximity, Shape, ShapeType, Trimesh};
|
||||
use crate::geometry::{Collider, Proximity, ShapeType, Trimesh};
|
||||
use crate::ncollide::bounding_volume::{BoundingVolume, AABB};
|
||||
|
||||
pub struct TrimeshShapeProximityDetectorWorkspace {
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
use crate::geometry::{Cylinder, ShapeType};
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::geometry::Cylinder;
|
||||
use crate::geometry::ShapeType;
|
||||
use crate::math::{Isometry, Point, Vector};
|
||||
use na::Unit;
|
||||
use ncollide::query::{
|
||||
@@ -12,6 +14,7 @@ pub trait Roundable {
|
||||
fn rounded_shape_type() -> ShapeType;
|
||||
}
|
||||
|
||||
#[cfg(feature = "dim3")]
|
||||
impl Roundable for Cylinder {
|
||||
fn rounded_shape_type() -> ShapeType {
|
||||
ShapeType::RoundedCylinder
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
use crate::dynamics::{MassProperties, RigidBodyHandle, RigidBodySet};
|
||||
use crate::geometry::{
|
||||
Ball, Capsule, ColliderGraphIndex, Contact, Cuboid, HeightField, InteractionGraph, Polygon,
|
||||
Proximity, Ray, RayIntersection, Roundable, Rounded, Triangle, Trimesh,
|
||||
};
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::geometry::{Cone, Cylinder, PolygonalFeatureMap};
|
||||
use crate::math::{AngVector, Isometry, Point, Rotation, Vector};
|
||||
use crate::dynamics::MassProperties;
|
||||
use crate::geometry::{Ball, Capsule, Cuboid, HeightField, Roundable, Rounded, Triangle, Trimesh};
|
||||
use crate::math::Isometry;
|
||||
use downcast_rs::{impl_downcast, DowncastSync};
|
||||
use erased_serde::Serialize;
|
||||
use na::Point3;
|
||||
use ncollide::bounding_volume::{BoundingVolume, HasBoundingVolume, AABB};
|
||||
use ncollide::bounding_volume::{HasBoundingVolume, AABB};
|
||||
use ncollide::query::{PointQuery, RayCast};
|
||||
use num::Zero;
|
||||
use num_derive::FromPrimitive;
|
||||
use std::any::Any;
|
||||
#[cfg(feature = "dim3")]
|
||||
use {
|
||||
crate::geometry::{Cone, Cylinder, PolygonalFeatureMap},
|
||||
ncollide::bounding_volume::BoundingVolume,
|
||||
};
|
||||
|
||||
#[derive(Copy, Clone, Debug, FromPrimitive)]
|
||||
/// Enum representing the type of a shape.
|
||||
@@ -49,6 +47,7 @@ pub enum ShapeType {
|
||||
// /// An heightfield with rounded corners.
|
||||
// RoundedHeightField,
|
||||
/// A cylinder with rounded corners.
|
||||
#[cfg(feature = "dim3")]
|
||||
RoundedCylinder,
|
||||
// /// A cone with rounded corners.
|
||||
// RoundedCone,
|
||||
@@ -116,11 +115,13 @@ impl dyn Shape {
|
||||
}
|
||||
|
||||
/// Converts this abstract shape to a cylinder, if it is one.
|
||||
#[cfg(feature = "dim3")]
|
||||
pub fn as_cylinder(&self) -> Option<&Cylinder> {
|
||||
self.downcast_ref()
|
||||
}
|
||||
|
||||
/// Converts this abstract shape to a cone, if it is one.
|
||||
#[cfg(feature = "dim3")]
|
||||
pub fn as_cone(&self) -> Option<&Cone> {
|
||||
self.downcast_ref()
|
||||
}
|
||||
@@ -226,7 +227,7 @@ impl Shape for Triangle {
|
||||
self.bounding_volume(position)
|
||||
}
|
||||
|
||||
fn mass_properties(&self, density: f32) -> MassProperties {
|
||||
fn mass_properties(&self, _density: f32) -> MassProperties {
|
||||
MassProperties::zero()
|
||||
}
|
||||
|
||||
|
||||
@@ -107,15 +107,15 @@ impl Trimesh {
|
||||
}
|
||||
|
||||
impl PointQuery<f32> for Trimesh {
|
||||
fn project_point(&self, m: &Isometry<f32>, pt: &Point<f32>, solid: bool) -> PointProjection {
|
||||
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>,
|
||||
_m: &Isometry<f32>,
|
||||
_pt: &Point<f32>,
|
||||
) -> (PointProjection, FeatureId) {
|
||||
// TODO
|
||||
unimplemented!()
|
||||
@@ -126,16 +126,16 @@ impl PointQuery<f32> for Trimesh {
|
||||
impl RayCast<f32> for Trimesh {
|
||||
fn toi_and_normal_with_ray(
|
||||
&self,
|
||||
m: &Isometry<f32>,
|
||||
ray: &Ray,
|
||||
max_toi: f32,
|
||||
solid: bool,
|
||||
_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 {
|
||||
fn intersects_ray(&self, _m: &Isometry<f32>, _ray: &Ray, _max_toi: f32) -> bool {
|
||||
// TODO
|
||||
false
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ use {
|
||||
// pub(crate) const COS_10_DEGREES: f32 = 0.98480775301;
|
||||
// pub(crate) const COS_45_DEGREES: f32 = 0.70710678118;
|
||||
// pub(crate) const SIN_45_DEGREES: f32 = COS_45_DEGREES;
|
||||
#[cfg(feature = "dim3")]
|
||||
pub(crate) const COS_1_DEGREES: f32 = 0.99984769515;
|
||||
pub(crate) const COS_5_DEGREES: f32 = 0.99619469809;
|
||||
// #[cfg(feature = "dim2")]
|
||||
|
||||
@@ -9,11 +9,10 @@ use na::Point3;
|
||||
use crate::math::Point;
|
||||
use crate::objects::ball::Ball;
|
||||
use crate::objects::box_node::Box as BoxNode;
|
||||
use crate::objects::convex::Convex;
|
||||
use crate::objects::heightfield::HeightField;
|
||||
use crate::objects::node::{GraphicsNode, Node};
|
||||
use rapier::dynamics::{RigidBodyHandle, RigidBodySet};
|
||||
use rapier::geometry::{Collider, ColliderHandle, ColliderSet, Shape};
|
||||
use rapier::geometry::{Collider, ColliderHandle, ColliderSet};
|
||||
//use crate::objects::capsule::Capsule;
|
||||
//use crate::objects::convex::Convex;
|
||||
//#[cfg(feature = "fluids")]
|
||||
@@ -26,7 +25,9 @@ use rapier::geometry::{Collider, ColliderHandle, ColliderSet, Shape};
|
||||
//#[cfg(feature = "fluids")]
|
||||
//use crate::objects::FluidRenderingMode;
|
||||
use crate::objects::capsule::Capsule;
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::objects::cone::Cone;
|
||||
#[cfg(feature = "dim3")]
|
||||
use crate::objects::cylinder::Cylinder;
|
||||
use crate::objects::mesh::Mesh;
|
||||
use rand::{Rng, SeedableRng};
|
||||
|
||||
Reference in New Issue
Block a user