# HG changeset patch # User John Tsiombikas # Date 1440458761 -10800 # Node ID bed39534d471b8c1136de51a3d1067aad003f3b3 # Parent 92d662deb66e5ede39e03c9831fc1bff7a31062a fell back to the equi-radii capsule which works diff -r 92d662deb66e -r bed39534d471 src/dragon.cc --- a/src/dragon.cc Tue Aug 25 00:38:00 2015 +0300 +++ b/src/dragon.cc Tue Aug 25 02:26:01 2015 +0300 @@ -10,10 +10,11 @@ #define DYN_FCOUNT 64 #define DYN_VCOUNT (DYN_FCOUNT * 3) -#define NUM_NECK_SEG 8 +#define NUM_NECK_SEG 10 static const float nseg_sizes[NUM_NECK_SEG][2] = { - {1.0, 3.0}, {1.0, 1.5}, {1.5, 2.0}, {2.0, 2.5}, {2.5, 3.0}, {3.0, 3.5} + {2.0, 2.0}, {1.0, 1.0}, {1.0, 1.0}, {1.25, 1.25}, {1.3, 1.3}, {1.5, 1.5}, {1.6, 1.6}, {1.75, 1.75}, {2.0, 2.0}, {2.1, 2.1} }; +#define NSEG_SZ_SCALE 0.5f static Vector3 bezier(const Vector3 &a, const Vector3 &b, const Vector3 &c, const Vector3 &d, float t); static float mseval(struct metasurface *ms, float x, float y, float z); @@ -36,8 +37,9 @@ neck_seg = new Capsule[neck_seg_count]; for(int i=0; i= 1.0) { + return sphere_distance(b, rb, pt); + } + + Vector3 pproj = a + ab_dir * t; + return (pproj - pt).length() - ra; +} + +#if 0 float capsule_distance(const Vector3 &a, float ra, const Vector3 &b, float rb, const Vector3 &pt) { Vector3 ab_dir = b - a; @@ -304,3 +331,4 @@ } return dist; } +#endif