From 28b7866aee68ca844406bea4761d630a7913188d Mon Sep 17 00:00:00 2001 From: Crozet Sébastien Date: Wed, 20 Jan 2021 15:40:00 +0100 Subject: Switch to [u32; DIM] instead of Point for element indices. --- .../joint_constraint/revolute_position_constraint_wide.rs | 6 ++---- src/geometry/collider.rs | 13 ++++++------- 2 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/dynamics/solver/joint_constraint/revolute_position_constraint_wide.rs b/src/dynamics/solver/joint_constraint/revolute_position_constraint_wide.rs index 44da104..e2d140d 100644 --- a/src/dynamics/solver/joint_constraint/revolute_position_constraint_wide.rs +++ b/src/dynamics/solver/joint_constraint/revolute_position_constraint_wide.rs @@ -1,8 +1,6 @@ use super::{RevolutePositionConstraint, RevolutePositionGroundConstraint}; -use crate::dynamics::{IntegrationParameters, JointIndex, RevoluteJoint, RigidBody}; -use crate::math::{AngularInertia, Isometry, Point, Real, Rotation, Vector, SIMD_WIDTH}; -use crate::utils::WAngularInertia; -use na::Unit; +use crate::dynamics::{IntegrationParameters, RevoluteJoint, RigidBody}; +use crate::math::{Isometry, Real, SIMD_WIDTH}; // TODO: this does not uses SIMD optimizations yet. #[derive(Debug)] diff --git a/src/geometry/collider.rs b/src/geometry/collider.rs index 8533c81..96fcbf9 100644 --- a/src/geometry/collider.rs +++ b/src/geometry/collider.rs @@ -12,7 +12,6 @@ use cdl::shape::{ }; #[cfg(feature = "dim2")] use cdl::shape::{ConvexPolygon, RoundConvexPolygon}; -use na::Point3; use std::ops::Deref; use std::sync::Arc; @@ -123,7 +122,7 @@ impl ColliderShape { } /// Initializes a triangle mesh shape defined by its vertex and index buffers. - pub fn trimesh(vertices: Vec>, indices: Vec>) -> Self { + pub fn trimesh(vertices: Vec>, indices: Vec<[u32; 3]>) -> Self { ColliderShape(Arc::new(TriMesh::new(vertices, indices))) } @@ -140,7 +139,7 @@ impl ColliderShape { } #[cfg(feature = "dim3")] - pub fn convex_mesh(points: Vec>, indices: &[Point3]) -> Option { + pub fn convex_mesh(points: Vec>, indices: &[[u32; 3]]) -> Option { ConvexPolyhedron::from_convex_mesh(points, indices).map(|ch| ColliderShape(Arc::new(ch))) } @@ -174,7 +173,7 @@ impl ColliderShape { #[cfg(feature = "dim3")] pub fn round_convex_mesh( points: Vec>, - indices: &[Point], + indices: &[[u32; 3]], border_radius: Real, ) -> Option { ConvexPolyhedron::from_convex_mesh(points, indices).map(|ch| { @@ -555,7 +554,7 @@ impl ColliderBuilder { } /// Initializes a collider builder with a triangle mesh shape defined by its vertex and index buffers. - pub fn trimesh(vertices: Vec>, indices: Vec>) -> Self { + pub fn trimesh(vertices: Vec>, indices: Vec<[u32; 3]>) -> Self { Self::new(ColliderShape::trimesh(vertices, indices)) } @@ -578,14 +577,14 @@ impl ColliderBuilder { } #[cfg(feature = "dim3")] - pub fn convex_mesh(points: Vec>, indices: &[Point3]) -> Option { + pub fn convex_mesh(points: Vec>, indices: &[[u32; 3]]) -> Option { ColliderShape::convex_mesh(points, indices).map(|cp| Self::new(cp)) } #[cfg(feature = "dim3")] pub fn round_convex_mesh( points: Vec>, - indices: &[Point], + indices: &[[u32; 3]], border_radius: Real, ) -> Option { ColliderShape::round_convex_mesh(points, indices, border_radius).map(|cp| Self::new(cp)) -- cgit