From fde4686d77dd72ccfa88febdea360136bfd17a36 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 27 Dec 2009 01:32:58 +0000 Subject: barycentric transform utility geometry function. From 2 triangles and 1 point, the relative position between the point and the first triangle is applied to the second triangle to find the target point. the barycentric weights are calculated in 2D space with a signed area so values outside the triangle bounds are supported. wrapped by python: pt_to = Geometry.BarycentricTransform(pt_from, t1a, t1b, t1c, t2a, t1b, t1c) NOTE: - moved some barycentric weight functions out of projection painting into the math lib. - ended up making some of the math functions use const args. TODO: - support exceptional cases. zero area tries and similar. --- source/blender/blenlib/intern/math_rotation.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenlib/intern/math_rotation.c') diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 084db725409..61d5eeaaa2c 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -327,7 +327,7 @@ void normalize_qt(float *q) } } -void rotation_between_vecs_to_quat(float *q, float v1[3], float v2[3]) +void rotation_between_vecs_to_quat(float *q, const float v1[3], const float v2[3]) { float axis[3]; float angle; -- cgit v1.2.3