forked from StrafesNET/strafe-client
jkwenfjnwef
This commit is contained in:
parent
086b47c406
commit
1f636116c0
@ -39,7 +39,7 @@ where <E as DirectedEdge>::UndirectedEdge:std::fmt::Debug{
|
|||||||
let n=n.cross(edge_n);
|
let n=n.cross(edge_n);
|
||||||
let verts=mesh.edge_verts(directed_edge_id.as_undirected());
|
let verts=mesh.edge_verts(directed_edge_id.as_undirected());
|
||||||
let d=n.dot(mesh.vert(verts[0])+mesh.vert(verts[1]));
|
let d=n.dot(mesh.vert(verts[0])+mesh.vert(verts[1]));
|
||||||
println!("Face Edge n={} d={}",n,d/2);
|
println!("Face Edge boundary_n={} boundary_d={}",n,d/2);
|
||||||
//WARNING: d is moved out of the *2 block because of adding two vertices!
|
//WARNING: d is moved out of the *2 block because of adding two vertices!
|
||||||
for t in zeroes2(n.dot(body.position)*2-d,n.dot(body.velocity)*2,n.dot(body.acceleration)){
|
for t in zeroes2(n.dot(body.position)*2-d,n.dot(body.velocity)*2,n.dot(body.acceleration)){
|
||||||
let t=body.time+Time::from(t);
|
let t=body.time+Time::from(t);
|
||||||
@ -63,7 +63,7 @@ where <E as DirectedEdge>::UndirectedEdge:std::fmt::Debug{
|
|||||||
//edge_n gets parity from the order of edge_faces
|
//edge_n gets parity from the order of edge_faces
|
||||||
let n=face_n.cross(edge_n)*((i as i64)*2-1);
|
let n=face_n.cross(edge_n)*((i as i64)*2-1);
|
||||||
let d=n.dot(vert_sum);
|
let d=n.dot(vert_sum);
|
||||||
println!("Edge Face={:?} n={} d={}",edge_face_id,n,d/2);
|
println!("Edge Face={:?} boundary_n={} boundary_d={}",edge_face_id,n,d/2);
|
||||||
//WARNING yada yada d *2
|
//WARNING yada yada d *2
|
||||||
for t in zeroes2((n.dot(body.position))*2-d,n.dot(body.velocity)*2,n.dot(body.acceleration)){
|
for t in zeroes2((n.dot(body.position))*2-d,n.dot(body.velocity)*2,n.dot(body.acceleration)){
|
||||||
let t=body.time+Time::from(t);
|
let t=body.time+Time::from(t);
|
||||||
@ -80,7 +80,7 @@ where <E as DirectedEdge>::UndirectedEdge:std::fmt::Debug{
|
|||||||
//vertex normal gets parity from vert index
|
//vertex normal gets parity from vert index
|
||||||
let n=edge_n*(1-2*(i as i64));
|
let n=edge_n*(1-2*(i as i64));
|
||||||
let d=n.dot(mesh.vert(vert_id));
|
let d=n.dot(mesh.vert(vert_id));
|
||||||
println!("Edge Vert n={} d={}",n,d);
|
println!("Edge Vert boundary_n={} boundary_d={}",n,d);
|
||||||
for t in zeroes2((n.dot(body.position)-d)*2,n.dot(body.velocity)*2,n.dot(body.acceleration)){
|
for t in zeroes2((n.dot(body.position)-d)*2,n.dot(body.velocity)*2,n.dot(body.acceleration)){
|
||||||
let t=body.time+Time::from(t);
|
let t=body.time+Time::from(t);
|
||||||
println!("dt={} low={} upp={} into={}",t-body.time,time<=t,t<best_time,n.dot(body.extrapolated_velocity(t))<Planar64::ZERO);
|
println!("dt={} low={} upp={} into={}",t-body.time,time<=t,t<best_time,n.dot(body.extrapolated_velocity(t))<Planar64::ZERO);
|
||||||
@ -99,7 +99,7 @@ where <E as DirectedEdge>::UndirectedEdge:std::fmt::Debug{
|
|||||||
//edge is directed away from vertex, but we want the dot product to turn out negative
|
//edge is directed away from vertex, but we want the dot product to turn out negative
|
||||||
let n=-mesh.directed_edge_n(directed_edge_id);
|
let n=-mesh.directed_edge_n(directed_edge_id);
|
||||||
let d=n.dot(mesh.vert(vert_id));
|
let d=n.dot(mesh.vert(vert_id));
|
||||||
println!("Vert Edge={:?} n={} d={}",directed_edge_id,n,d);
|
println!("Vert Edge={:?} boundary_n={} boundary_d={}",directed_edge_id,n,d);
|
||||||
for t in zeroes2((n.dot(body.position)-d)*2,n.dot(body.velocity)*2,n.dot(body.acceleration)){
|
for t in zeroes2((n.dot(body.position)-d)*2,n.dot(body.velocity)*2,n.dot(body.acceleration)){
|
||||||
let t=body.time+Time::from(t);
|
let t=body.time+Time::from(t);
|
||||||
println!("dt={} low={} upp={} into={}",t-body.time,time<=t,t<best_time,n.dot(body.extrapolated_velocity(t))<Planar64::ZERO);
|
println!("dt={} low={} upp={} into={}",t-body.time,time<=t,t<best_time,n.dot(body.extrapolated_velocity(t))<Planar64::ZERO);
|
||||||
|
@ -441,6 +441,7 @@ impl MinkowskiMesh<'_>{
|
|||||||
}
|
}
|
||||||
/// This function drops a vertex down to an edge or a face if the path from infinity did not cross any vertex-edge boundaries but the point is supposed to have already crossed a boundary down from a vertex
|
/// This function drops a vertex down to an edge or a face if the path from infinity did not cross any vertex-edge boundaries but the point is supposed to have already crossed a boundary down from a vertex
|
||||||
fn infinity_fev(&self,infinity_dir:Planar64Vec3,point:Planar64Vec3)->FEV::<MinkowskiFace,MinkowskiDirectedEdge,MinkowskiVert>{
|
fn infinity_fev(&self,infinity_dir:Planar64Vec3,point:Planar64Vec3)->FEV::<MinkowskiFace,MinkowskiDirectedEdge,MinkowskiVert>{
|
||||||
|
println!("infinity_fev dir={} point={}",infinity_dir,point);
|
||||||
//start on any vertex
|
//start on any vertex
|
||||||
//cross uncrossable vertex-edge boundaries until you find the closest vertex or edge
|
//cross uncrossable vertex-edge boundaries until you find the closest vertex or edge
|
||||||
//cross edge-face boundary if it's uncrossable
|
//cross edge-face boundary if it's uncrossable
|
||||||
|
Loading…
Reference in New Issue
Block a user