Improved solid selection stability
[convexer.git] / src / cxr_math.h
index d03d8862cd68eeb241a0c5bf51709dd05f8fbee6..17c9902b390e3539a8a46af711f4d601727288a8 100644 (file)
@@ -576,3 +576,12 @@ CXR_INLINE double plane_polarity( double p[4], double a[3] )
        -(p[0]*p[3] * p[0] + p[1]*p[3] * p[1] + p[2]*p[3] * p[2])
        ;
 }
+
+CXR_INLINE void plane_project_point( v4f plane, v3f a, v3f d )
+{
+   v3f ref, delta;
+   v3_muls( plane, plane[3], ref );
+
+   v3_sub( a, ref, delta );
+   v3_muladds( a, plane, -v3_dot(delta,plane), d );
+}