routes
[carveJwlIkooP6JGAAIwe30JlM.git] / common.h
index 952b51d8b6b6053db9580acbb1d02740dc04e2ff..5e2f48298dbdafcb43c784d532b87b799f3c794e 100644 (file)
--- a/common.h
+++ b/common.h
@@ -32,4 +32,16 @@ struct ray_hit
    v3f pos, normal;
 };
 
+/* TODO: he needs a home somewhere */
+static void eval_bezier_time( v3f p0, v3f p1, v3f h0, v3f h1, float t, v3f p )
+{
+   float tt = t*t,
+         ttt = tt*t;
+
+   v3_muls( p1, ttt, p );
+   v3_muladds( p, h1, 3.0f*tt  -3.0f*ttt, p );
+   v3_muladds( p, h0, 3.0f*ttt -6.0f*tt  +3.0f*t, p );
+   v3_muladds( p, p0, 3.0f*tt  -ttt -3.0f*t +1.0f, p );
+}
+
 #endif /* COMMON_H */