Skip to content

Commit

Permalink
few todo nll more
Browse files Browse the repository at this point in the history
  • Loading branch information
Vrixyz committed Oct 1, 2024
1 parent de82965 commit cfd0b63
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 38 deletions.
22 changes: 8 additions & 14 deletions src/query/gjk/voronoi_simplex2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,8 @@ impl VoronoiSimplex {
self.proj[0] = 1.0;
self.vertices[0].point
} else if self.dim == 1 {
// TODO: NLL
let (proj, location) = {
let seg = Segment::new(self.vertices[0].point, self.vertices[1].point);
seg.project_local_point_and_get_location(&Point::<Real>::origin(), true)
};
let (proj, location) = Segment::new(self.vertices[0].point, self.vertices[1].point)
.project_local_point_and_get_location(&Point::<Real>::origin(), true);

match location {
SegmentPointLocation::OnVertex(0) => {
Expand All @@ -123,15 +120,12 @@ impl VoronoiSimplex {
proj.point
} else {
assert!(self.dim == 2);
// TODO: NLL
let (proj, location) = {
let tri = Triangle::new(
self.vertices[0].point,
self.vertices[1].point,
self.vertices[2].point,
);
tri.project_local_point_and_get_location(&Point::<Real>::origin(), true)
};
let (proj, location) = Triangle::new(
self.vertices[0].point,
self.vertices[1].point,
self.vertices[2].point,
)
.project_local_point_and_get_location(&Point::<Real>::origin(), true);

match location {
TrianglePointLocation::OnVertex(i) => {
Expand Down
39 changes: 15 additions & 24 deletions src/query/gjk/voronoi_simplex3.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,8 @@ impl VoronoiSimplex {
self.proj[0] = 1.0;
self.vertices[0].point
} else if self.dim == 1 {
// TODO: NLL
let (proj, location) = {
let seg = Segment::new(self.vertices[0].point, self.vertices[1].point);
seg.project_local_point_and_get_location(&Point::<Real>::origin(), true)
};
let (proj, location) = Segment::new(self.vertices[0].point, self.vertices[1].point)
.project_local_point_and_get_location(&Point::<Real>::origin(), true);

match location {
SegmentPointLocation::OnVertex(0) => {
Expand All @@ -150,15 +147,12 @@ impl VoronoiSimplex {

proj.point
} else if self.dim == 2 {
// TODO: NLL
let (proj, location) = {
let tri = Triangle::new(
self.vertices[0].point,
self.vertices[1].point,
self.vertices[2].point,
);
tri.project_local_point_and_get_location(&Point::<Real>::origin(), true)
};
let (proj, location) = Triangle::new(
self.vertices[0].point,
self.vertices[1].point,
self.vertices[2].point,
)
.project_local_point_and_get_location(&Point::<Real>::origin(), true);

match location {
TrianglePointLocation::OnVertex(i) => {
Expand Down Expand Up @@ -192,16 +186,13 @@ impl VoronoiSimplex {
proj.point
} else {
assert!(self.dim == 3);
// TODO: NLL
let (proj, location) = {
let tetr = Tetrahedron::new(
self.vertices[0].point,
self.vertices[1].point,
self.vertices[2].point,
self.vertices[3].point,
);
tetr.project_local_point_and_get_location(&Point::<Real>::origin(), true)
};
let (proj, location) = Tetrahedron::new(
self.vertices[0].point,
self.vertices[1].point,
self.vertices[2].point,
self.vertices[3].point,
)
.project_local_point_and_get_location(&Point::<Real>::origin(), true);

match location {
TetrahedronPointLocation::OnVertex(i) => {
Expand Down

0 comments on commit cfd0b63

Please sign in to comment.