From e9d5e9813c5cce45f14bb25bb82f2e88f5688351 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Sun, 20 Oct 2013 12:08:51 +0000 Subject: Code cleanup: added generic function copt_m3_m3d --- source/blender/blenlib/intern/math_matrix.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source/blender/blenlib/intern/math_matrix.c') diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 6b96f0515b9..2cda4425d8e 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -112,6 +112,22 @@ void copy_m4_m3(float m1[4][4], float m2[3][3]) /* no clear */ } +void copt_m3_m3d(float R[3][3], double A[3][3]) +{ + /* Keep it stupid simple for better data flow in CPU. */ + R[0][0] = A[0][0]; + R[0][1] = A[0][1]; + R[0][2] = A[0][2]; + + R[1][0] = A[1][0]; + R[1][1] = A[1][1]; + R[1][2] = A[1][2]; + + R[2][0] = A[2][0]; + R[2][1] = A[2][1]; + R[2][2] = A[2][2]; +} + void swap_m3m3(float m1[3][3], float m2[3][3]) { float t; -- cgit v1.2.3