use struct
This commit is contained in:
@@ -110,7 +110,7 @@ fn reduce1(
|
||||
[v0]:Simplex<1>,
|
||||
mesh:&MinkowskiMesh,
|
||||
point:Planar64Vec3,
|
||||
)->(Planar64Vec3,Simplex1_3){
|
||||
)->Reduced{
|
||||
// --debug.profilebegin("reduceSimplex0")
|
||||
// local a = a1 - a0
|
||||
let p0=mesh.vert(v0);
|
||||
@@ -119,16 +119,19 @@ fn reduce1(
|
||||
let p=-(p0+point);
|
||||
|
||||
// local direction = p
|
||||
let mut direction=p;
|
||||
let mut dir=p;
|
||||
|
||||
// if direction.magnitude == 0 then
|
||||
// direction = chooseAnyDirection()
|
||||
if direction==vec3::zero(){
|
||||
direction=choose_any_direction();
|
||||
if dir==vec3::zero(){
|
||||
dir=choose_any_direction();
|
||||
}
|
||||
|
||||
// return direction, a0, a1
|
||||
(direction,Simplex1_3::Simplex1([v0]))
|
||||
Reduced{
|
||||
dir,
|
||||
simplex:Simplex1_3::Simplex1([v0]),
|
||||
}
|
||||
}
|
||||
|
||||
// local function reduceSimplex1(a0, a1, b0, b1)
|
||||
@@ -606,7 +609,7 @@ fn minimum_difference<const ENABLE_FAST_FAIL:bool,T>(
|
||||
direction=choose_any_direction();
|
||||
}
|
||||
let new_point=mesh.farthest_vert(direction);
|
||||
let (mut direction,mut simplex_small)=reduce1([new_point],mesh,point);
|
||||
let Reduced{dir:mut direction,simplex:mut simplex_small}=reduce1([new_point],mesh,point);
|
||||
|
||||
// exitRadius = testIntersection and 0 or exitRadius or 1/0
|
||||
// for _ = 1, 100 do
|
||||
|
||||
Reference in New Issue
Block a user