-
-
Notifications
You must be signed in to change notification settings - Fork 27
Open
Description
You can see this is doing some form of iterative search. Below is equivalent code. Note, "abc" and "d" are the normal and plane-distance for that node. And below that I went ahead and uploaded the results of a cleanup pass I did last night. I will say it seems to do double-duty by allocating the Node and Poly objects separately when in fact they're the same objects.
double BspTree::Poly::intersection(double *p1, double *p2, double *po)
{
double *abc = norm(), p2_p1[3];
for(int i=3;i-->0;) p2_p1[i] = p2[i]-p1[i];
double t = (d-dot_product(abc,p1))/dot_product(abc,p2_p1);
lerp3(po,p1,p2,t); return t;
}
https://github.com/mick-p1982/mm3d/blob/widgets95-ui/src/libmm3d/bsptree.cc
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels