214 |
|
|
215 |
} |
} |
216 |
|
|
217 |
ZVec point(Vec dir, bool &success, float *ptfract = NULL) const { |
ZVec point(Vec dir, bool &success, float *ptfract = NULL, float tol = .01) const { |
218 |
float f0 = 0; |
float f0 = 0; |
219 |
float f1 = 1; |
float f1 = 1; |
220 |
float f; |
float f; |
231 |
|
|
232 |
Vec dir2 = dir.cw90(); |
Vec dir2 = dir.cw90(); |
233 |
double err; |
double err; |
234 |
double maxerr = .01 * node.r; |
double maxerr = tol * node.r; |
235 |
|
|
236 |
while (1) { |
while (1) { |
237 |
f = 0.5 * (f0 + f1); |
f = 0.5 * (f0 + f1); |
256 |
bool success; |
bool success; |
257 |
float ptfract; |
float ptfract; |
258 |
cutangle = M_PI/2 - tangentAngle; |
cutangle = M_PI/2 - tangentAngle; |
259 |
point(dir, success, &ptfract); |
point(dir, success, &ptfract, .0001); |
260 |
if (success) |
if (success) |
261 |
cutangle = lerp(0, M_PI/2 - tangentAngle, ptfract); |
cutangle = lerp(0, M_PI/2 - tangentAngle, ptfract); |
262 |
} |
} |