curvedraw
diff src/curve.h @ 13:4da693339d99
- distance from curve
- hover/selection of curves directly on the curve
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 20 Dec 2015 08:22:24 +0200 |
parents | 84a647283237 |
children | 7f795f7fecd6 |
line diff
1.1 --- a/src/curve.h Sun Dec 20 07:21:32 2015 +0200 1.2 +++ b/src/curve.h Sun Dec 20 08:22:24 2015 +0200 1.3 @@ -70,9 +70,11 @@ 1.4 void normalize(); 1.5 1.6 // project a point to the curve (nearest point on the curve) 1.7 - Vector3 proj_point(const Vector3 &p) const; 1.8 - // equivalent to (proj_point(p) - p).length(); 1.9 + Vector3 proj_point(const Vector3 &p, float refine_thres = 0.01) const; 1.10 + // equivalent to (proj_point(p) - p).length() 1.11 float distance(const Vector3 &p) const; 1.12 + // equivalent to fabs((proj_point(p) - p).length_sq()) 1.13 + float distance_sq(const Vector3 &p) const; 1.14 1.15 Vector3 interpolate_segment(int a, int b, float t) const; 1.16 Vector3 interpolate(float t) const;