diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-09-06 04:19:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-09-06 04:19:15 +0400 |
commit | c9dd69c11a639aece463dac9018e88dede4b9515 (patch) | |
tree | adb8bc5729742f0996a8131c39c5b920915dd9f8 /source | |
parent | 3b743ac5565663d2fd0be4bbbc92e404afafbce4 (diff) |
remove MTC_ functions, (don't merge)
replacements...
MTC_cross3Float -> Crossf
MTC_diff3Float -> VecSubf
MTC_dot3Float -> Inpf
MTC_Mat3CpyMat4 -> Mat3CpyMat4
MTC_Mat3MulVecd -> Mat3MulVecd
MTC_Mat3MulVecfl -> Mat3MulVecfl
MTC_Mat4CpyMat4 -> Mat4CpyMat4
MTC_Mat4Invert -> Mat4Invert
MTC_Mat4Mul3Vecfl -> Mat4Mul3Vecfl
MTC_Mat4MulMat4 -> Mat4MulMat4
MTC_Mat4MulSerie -> Mat4MulSerie
MTC_Mat4MulVec4fl -> Mat4MulVec4fl
MTC_Mat4MulVecfl -> Mat4MulVecfl
MTC_Mat4One -> Mat4One
MTC_Mat4Ortho -> Mat4Ortho
MTC_Mat4SwapMat4 -> Mat4SwapMat4
Diffstat (limited to 'source')
29 files changed, 216 insertions, 1040 deletions
diff --git a/source/blender/blenkernel/intern/modifier.c b/source/blender/blenkernel/intern/modifier.c index fa2f857cc8b..77d54125564 100644 --- a/source/blender/blenkernel/intern/modifier.c +++ b/source/blender/blenkernel/intern/modifier.c @@ -72,8 +72,8 @@ #include "BLI_editVert.h" -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" + + #include "BKE_main.h" #include "BKE_anim.h" @@ -1182,7 +1182,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, if(amd->end_cap && amd->end_cap != ob) end_cap = mesh_get_derived_final(amd->end_cap, CD_MASK_MESH); - MTC_Mat4One(offset); + Mat4One(offset); indexMap = MEM_callocN(sizeof(*indexMap) * dm->getNumVerts(dm), "indexmap"); @@ -1204,14 +1204,14 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, float result_mat[4][4]; if(ob) - MTC_Mat4Invert(obinv, ob->obmat); + Mat4Invert(obinv, ob->obmat); else - MTC_Mat4One(obinv); + Mat4One(obinv); - MTC_Mat4MulSerie(result_mat, offset, + Mat4MulSerie(result_mat, offset, obinv, amd->offset_ob->obmat, NULL, NULL, NULL, NULL, NULL); - MTC_Mat4CpyMat4(offset, result_mat); + Mat4CpyMat4(offset, result_mat); } if(amd->fit_type == MOD_ARR_FITCURVE && amd->curve_ob) { @@ -1236,7 +1236,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, prescribed length */ if(amd->fit_type == MOD_ARR_FITLENGTH || amd->fit_type == MOD_ARR_FITCURVE) { - float dist = sqrt(MTC_dot3Float(offset[3], offset[3])); + float dist = sqrt(Inpf(offset[3], offset[3])); if(dist > 1e-6f) /* this gives length = first copy start to last copy end @@ -1269,11 +1269,11 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, result = CDDM_from_template(dm, finalVerts, finalEdges, finalFaces); /* calculate the offset matrix of the final copy (for merging) */ - MTC_Mat4One(final_offset); + Mat4One(final_offset); for(j=0; j < count - 1; j++) { - MTC_Mat4MulMat4(tmp_mat, final_offset, offset); - MTC_Mat4CpyMat4(final_offset, tmp_mat); + Mat4MulMat4(tmp_mat, final_offset, offset); + Mat4CpyMat4(final_offset, tmp_mat); } numVerts = numEdges = numFaces = 0; @@ -1309,7 +1309,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, if((count > 1) && (amd->flags & MOD_ARR_MERGE)) { float tmp_co[3]; VECCOPY(tmp_co, mv->co); - MTC_Mat4MulVecfl(offset, tmp_co); + Mat4MulVecfl(offset, tmp_co); for(j = 0; j < maxVerts; j++) { /* if vertex already merged, don't use it */ @@ -1324,7 +1324,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, if(amd->flags & MOD_ARR_MERGEFINAL) { VECCOPY(tmp_co, inMV->co); inMV = &src_mvert[i]; - MTC_Mat4MulVecfl(final_offset, tmp_co); + Mat4MulVecfl(final_offset, tmp_co); if(VecLenCompare(tmp_co, inMV->co, amd->merge_dist)) indexMap[i].merge_final = 1; } @@ -1342,7 +1342,7 @@ static DerivedMesh *arrayModifier_doArray(ArrayModifierData *amd, *mv2 = *mv; numVerts++; - MTC_Mat4MulVecfl(offset, co); + Mat4MulVecfl(offset, co); VECCOPY(mv2->co, co); } } else if(indexMap[i].merge != i && indexMap[i].merge_final) { @@ -3174,7 +3174,7 @@ static void tag_and_count_extra_edges(SmoothMesh *mesh, float split_angle, /* we know the edge has 2 faces, so check the angle */ SmoothFace *face1 = edge->faces->link; SmoothFace *face2 = edge->faces->next->link; - float edge_angle_cos = MTC_dot3Float(face1->normal, + float edge_angle_cos = Inpf(face1->normal, face2->normal); if(edge_angle_cos < threshold) { @@ -4042,11 +4042,11 @@ static DerivedMesh *uvprojectModifier_do(UVProjectModifierData *umd, /* find the projector which the face points at most directly * (projector normal with largest dot product is best) */ - best_dot = MTC_dot3Float(projectors[0].normal, face_no); + best_dot = Inpf(projectors[0].normal, face_no); best_projector = &projectors[0]; for(j = 1; j < num_projectors; ++j) { - float tmp_dot = MTC_dot3Float(projectors[j].normal, + float tmp_dot = Inpf(projectors[j].normal, face_no); if(tmp_dot > best_dot) { best_dot = tmp_dot; diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c index 52b88de06e0..be005af7827 100644 --- a/source/blender/blenkernel/intern/texture.c +++ b/source/blender/blenkernel/intern/texture.c @@ -38,7 +38,7 @@ #include "PIL_dynlib.h" -#include "MTC_matrixops.h" + #include "BLI_blenlib.h" #include "BLI_arithb.h" diff --git a/source/blender/blenlib/MTC_matrixops.h b/source/blender/blenlib/MTC_matrixops.h deleted file mode 100644 index 2bc644be564..00000000000 --- a/source/blender/blenlib/MTC_matrixops.h +++ /dev/null @@ -1,162 +0,0 @@ -/* - * matrixops.h - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef MATRIXOPS_H -#define MATRIXOPS_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* ------------------------------------------------------------------------- */ -/* need rewriting: */ -/** - * copy the left upp3 3 by 3 of m2 to m1 - */ -void MTC_Mat3CpyMat4(float m1[][3], float m2[][4]); - -/* ------------------------------------------------------------------------- */ -/* operations based on 4 by 4 matrices */ - -/** - * Copy m1 to m2 - */ -void MTC_Mat4CpyMat4(float m1[][4], float m2[][4]); - -/** - * Multiply all matrices after the first, leave the result in the - * first argument - */ -void MTC_Mat4MulSerie(float answ[][4], - float m1[][4], float m2[][4], float m3[][4], - float m4[][4], float m5[][4], float m6[][4], - float m7[][4], float m8[][4]); - -/** - * m1 = m2 matprod m3 - */ -void MTC_Mat4MulMat4(float m1[][4], float m2[][4], float m3[][4]); - -/** - * Do vec^t prod mat, result in vec. Ignore vec[3] (vec is a - * float[3]) - */ -void MTC_Mat4MulVecfl(float mat[][4], float *vec); - -/** - * Invert mat, result in inverse. Always returns 1 - */ -int MTC_Mat4Invert(float inverse[][4], float mat[][4]); - -/** - * Make the set of mat orthonormal (mat should already be orthogonal)? - * (doesn't appear to normalize properly?) - */ -void MTC_Mat4Ortho(float mat[][4]); - -/** - * vec = mat prod vec, result in vec, ignore fourth component entirely - * (4th component is _not_ accessed!!! vec is 3d) - */ -void MTC_Mat4Mul3Vecfl(float mat[][4], float *vec); - -/** - * vec = mat prod vec, result in vec - */ -void MTC_Mat4MulVec4fl(float mat[][4], float *vec); - -/** - * Set <m> to the 4-D unity matrix - */ -void MTC_Mat4One(float m[][4]); - -/** - * Swap matrices m1 and m2 - */ -void MTC_Mat4SwapMat4(float m1[][4], float m2[][4]); - -/** - * Copy m2 to the top-left 3x3 of m1, don't touch the remaining elements. - */ -void MTC_Mat4CpyMat3nc(float m1[][4], float m2[][3]); - -/** - * m1 = m2 * m3, but only the top-left 3x3 - */ -void MTC_Mat4MulMat33(float m1[][3], float m2[][4], float m3[][3]); - -/* ------------------------------------------------------------------------- */ -/* Operations based on 3 by 3 matrices */ -/** - * Do vec^t prod mat, result in vec.(vex is 3d) - */ -void MTC_Mat3MulVecfl(float mat[][3], float *vec); - -/** - * Copy m1 to m2 - */ -void MTC_Mat3CpyMat3(float m1[][3], float m2[][3]); - -/** - * m1 = m2 prod m3 - */ -void MTC_Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]); - -/** - * vec = vec prod mat - */ -void MTC_Mat3MulVecd(float mat[][3], double *vec); - -/** - * Guess: invert matrix - * result goes to m1 - */ -void MTC_Mat3Inv(float m1[][3], float m2[][3]); - -/** - * Sort of a determinant matrix? Doesn't seem very adjoint to me... - * result goes to m1 - */ -void MTC_Mat3Adj(float m1[][3], float m[][3]); - -/** - * Set <m> to the 3D unity matrix - */ -void MTC_Mat3One(float m[][3]); - -/* ------------------------------------------------------------------------- */ - -#ifdef __cplusplus -} -#endif - -#endif /* MATRIXOPS_H */ - diff --git a/source/blender/blenlib/MTC_vectorops.h b/source/blender/blenlib/MTC_vectorops.h deleted file mode 100644 index 4fec93b37b9..00000000000 --- a/source/blender/blenlib/MTC_vectorops.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * vectorops.h - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -#ifndef VECTOROPS_H -#define VECTOROPS_H - -/* ------------------------------------------------------------------------- */ - -void MTC_diff3Int(int v1[3], int v2[3], int v3[3]); -void MTC_cross3Int(int v1[3], int v2[3], int v3[3]); -int MTC_dot3Int(int v1[3], int v2[3]); - -void MTC_diff3Float(float v1[3], float v2[3], float v3[3]); -void MTC_cross3Float(float v1[3], float v2[3], float v3[3]); -float MTC_dot3Float(float v1[3], float v2[3]); -void MTC_cp3Float(float v1[3], float v2[3]); -/** - * Copy vector with a minus sign (so a = -b) - */ -void MTC_cp3FloatInv(float v1[3], float v2[3]); - -void MTC_swapInt(int *i1, int *i2); - -void MTC_diff3DFF(double v1[3], float v2[3], float v3[3]); -void MTC_cross3Double(double v1[3], double v2[3], double v3[3]); -float MTC_normalize3DF(float n[3]); - -/* ------------------------------------------------------------------------- */ -#endif /* VECTOROPS_H */ - diff --git a/source/blender/blenlib/intern/matrixops.c b/source/blender/blenlib/intern/matrixops.c deleted file mode 100644 index 0f9fc65f016..00000000000 --- a/source/blender/blenlib/intern/matrixops.c +++ /dev/null @@ -1,438 +0,0 @@ -/* - * - * Some matrix operations. - * - * Always use - * - vector with x components : float x[3], int x[3], etc - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/* ------------------------------------------------------------------------- */ -#include <string.h> -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" -/* ------------------------------------------------------------------------- */ - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -#if defined(__sun__) || defined( __sun ) || defined (__sparc) || defined (__sparc__) -#include <strings.h> -#endif - -#define ABS(x) ((x) < 0 ? -(x) : (x)) -#define SWAP(type, a, b) { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; } - -void MTC_Mat4CpyMat4(float m1[][4], float m2[][4]) -{ - memcpy(m1, m2, 4*4*sizeof(float)); -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulSerie(float answ[][4], - float m1[][4], float m2[][4], float m3[][4], - float m4[][4], float m5[][4], float m6[][4], - float m7[][4], float m8[][4]) -{ - float temp[4][4]; - - if(m1==0 || m2==0) return; - - MTC_Mat4MulMat4(answ, m2, m1); - if(m3) { - MTC_Mat4MulMat4(temp, m3, answ); - if(m4) { - MTC_Mat4MulMat4(answ, m4, temp); - if(m5) { - MTC_Mat4MulMat4(temp, m5, answ); - if(m6) { - MTC_Mat4MulMat4(answ, m6, temp); - if(m7) { - MTC_Mat4MulMat4(temp, m7, answ); - if(m8) { - MTC_Mat4MulMat4(answ, m8, temp); - } - else MTC_Mat4CpyMat4(answ, temp); - } - } - else MTC_Mat4CpyMat4(answ, temp); - } - } - else MTC_Mat4CpyMat4(answ, temp); - } -} - -/* ------------------------------------------------------------------------- */ -void MTC_Mat4MulMat4(float m1[][4], float m2[][4], float m3[][4]) -{ - /* matrix product: c[j][k] = a[j][i].b[i][k] */ - - m1[0][0] = m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0] + m2[0][3]*m3[3][0]; - m1[0][1] = m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1] + m2[0][3]*m3[3][1]; - m1[0][2] = m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2] + m2[0][3]*m3[3][2]; - m1[0][3] = m2[0][0]*m3[0][3] + m2[0][1]*m3[1][3] + m2[0][2]*m3[2][3] + m2[0][3]*m3[3][3]; - - m1[1][0] = m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0] + m2[1][3]*m3[3][0]; - m1[1][1] = m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1] + m2[1][3]*m3[3][1]; - m1[1][2] = m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2] + m2[1][3]*m3[3][2]; - m1[1][3] = m2[1][0]*m3[0][3] + m2[1][1]*m3[1][3] + m2[1][2]*m3[2][3] + m2[1][3]*m3[3][3]; - - m1[2][0] = m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0] + m2[2][3]*m3[3][0]; - m1[2][1] = m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1] + m2[2][3]*m3[3][1]; - m1[2][2] = m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2] + m2[2][3]*m3[3][2]; - m1[2][3] = m2[2][0]*m3[0][3] + m2[2][1]*m3[1][3] + m2[2][2]*m3[2][3] + m2[2][3]*m3[3][3]; - - m1[3][0] = m2[3][0]*m3[0][0] + m2[3][1]*m3[1][0] + m2[3][2]*m3[2][0] + m2[3][3]*m3[3][0]; - m1[3][1] = m2[3][0]*m3[0][1] + m2[3][1]*m3[1][1] + m2[3][2]*m3[2][1] + m2[3][3]*m3[3][1]; - m1[3][2] = m2[3][0]*m3[0][2] + m2[3][1]*m3[1][2] + m2[3][2]*m3[2][2] + m2[3][3]*m3[3][2]; - m1[3][3] = m2[3][0]*m3[0][3] + m2[3][1]*m3[1][3] + m2[3][2]*m3[2][3] + m2[3][3]*m3[3][3]; - -} -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulVecfl(float mat[][4], float *vec) -{ - float x,y; - - x=vec[0]; - y=vec[1]; - vec[0]=x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2] + mat[3][0]; - vec[1]=x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2] + mat[3][1]; - vec[2]=x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2] + mat[3][2]; -} - -/* ------------------------------------------------------------------------- */ -void MTC_Mat3MulVecfl(float mat[][3], float *vec) -{ - float x,y; - - x=vec[0]; - y=vec[1]; - vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2]; - vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2]; - vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2]; -} - -/* ------------------------------------------------------------------------- */ - -int MTC_Mat4Invert(float inverse[][4], float mat[][4]) -{ - int i, j, k; - double temp; - float tempmat[4][4]; - float max; - int maxj; - - /* Set inverse to identity */ - for (i=0; i<4; i++) - for (j=0; j<4; j++) - inverse[i][j] = 0; - for (i=0; i<4; i++) - inverse[i][i] = 1; - - /* Copy original matrix so we don't mess it up */ - for(i = 0; i < 4; i++) - for(j = 0; j <4; j++) - tempmat[i][j] = mat[i][j]; - - for(i = 0; i < 4; i++) { - /* Look for row with max pivot */ - max = ABS(tempmat[i][i]); - maxj = i; - for(j = i + 1; j < 4; j++) { - if(ABS(tempmat[j][i]) > max) { - max = ABS(tempmat[j][i]); - maxj = j; - } - } - /* Swap rows if necessary */ - if (maxj != i) { - for( k = 0; k < 4; k++) { - SWAP(float, tempmat[i][k], tempmat[maxj][k]); - SWAP(float, inverse[i][k], inverse[maxj][k]); - } - } - - temp = tempmat[i][i]; - if (temp == 0) - return 0; /* No non-zero pivot */ - for(k = 0; k < 4; k++) { - tempmat[i][k] /= temp; - inverse[i][k] /= temp; - } - for(j = 0; j < 4; j++) { - if(j != i) { - temp = tempmat[j][i]; - for(k = 0; k < 4; k++) { - tempmat[j][k] -= tempmat[i][k]*temp; - inverse[j][k] -= inverse[i][k]*temp; - } - } - } - } - return 1; -} - -/* ------------------------------------------------------------------------- */ -void MTC_Mat3CpyMat4(float m1[][3], float m2[][4]) -{ - - m1[0][0]= m2[0][0]; - m1[0][1]= m2[0][1]; - m1[0][2]= m2[0][2]; - - m1[1][0]= m2[1][0]; - m1[1][1]= m2[1][1]; - m1[1][2]= m2[1][2]; - - m1[2][0]= m2[2][0]; - m1[2][1]= m2[2][1]; - m1[2][2]= m2[2][2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3CpyMat3(float m1[][3], float m2[][3]) -{ - memcpy(m1, m2, 3*3*sizeof(float)); -} - -/* ------------------------------------------------------------------------- */ -/* void Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]) */ -void MTC_Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]) -{ - /* be careful about this rewrite... */ - /* m1[i][j] = m2[i][k]*m3[k][j], args are flipped! */ - m1[0][0]= m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0]; - m1[0][1]= m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1]; - m1[0][2]= m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2]; - - m1[1][0]= m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0]; - m1[1][1]= m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1]; - m1[1][2]= m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2]; - - m1[2][0]= m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0]; - m1[2][1]= m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1]; - m1[2][2]= m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2]; - -/* m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6]; */ -/* m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7]; */ -/* m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8]; */ -/* m1+=3; */ -/* m2+=3; */ -/* m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6]; */ -/* m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7]; */ -/* m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8]; */ -/* m1+=3; */ -/* m2+=3; */ -/* m1[0]= m2[0]*m3[0] + m2[1]*m3[3] + m2[2]*m3[6]; */ -/* m1[1]= m2[0]*m3[1] + m2[1]*m3[4] + m2[2]*m3[7]; */ -/* m1[2]= m2[0]*m3[2] + m2[1]*m3[5] + m2[2]*m3[8]; */ -} /* end of void Mat3MulMat3(float m1[][3], float m3[][3], float m2[][3]) */ - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4Ortho(float mat[][4]) -{ - float len; - - len= MTC_normalize3DF(mat[0]); - if(len!=0.0) mat[0][3]/= len; - len= MTC_normalize3DF(mat[1]); - if(len!=0.0) mat[1][3]/= len; - len= MTC_normalize3DF(mat[2]); - if(len!=0.0) mat[2][3]/= len; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4Mul3Vecfl(float mat[][4], float *vec) -{ - float x,y; - /* vec = mat^T dot vec !!! or vec a row, then vec = vec dot mat*/ - - x= vec[0]; - y= vec[1]; - vec[0]= x*mat[0][0] + y*mat[1][0] + mat[2][0]*vec[2]; - vec[1]= x*mat[0][1] + y*mat[1][1] + mat[2][1]*vec[2]; - vec[2]= x*mat[0][2] + y*mat[1][2] + mat[2][2]*vec[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4One(float m[][4]) -{ - - m[0][0]= m[1][1]= m[2][2]= m[3][3]= 1.0; - m[0][1]= m[0][2]= m[0][3]= 0.0; - m[1][0]= m[1][2]= m[1][3]= 0.0; - m[2][0]= m[2][1]= m[2][3]= 0.0; - m[3][0]= m[3][1]= m[3][2]= 0.0; -} - - -/* ------------------------------------------------------------------------- */ -/* Result is a 3-vector!*/ -void MTC_Mat3MulVecd(float mat[][3], double *vec) -{ - double x,y; - - /* vec = mat^T dot vec !!! or vec a row, then vec = vec dot mat*/ - x=vec[0]; - y=vec[1]; - vec[0]= x * mat[0][0] + y * mat[1][0] + mat[2][0] * vec[2]; - vec[1]= x * mat[0][1] + y * mat[1][1] + mat[2][1] * vec[2]; - vec[2]= x * mat[0][2] + y * mat[1][2] + mat[2][2] * vec[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3Inv(float m1[][3], float m2[][3]) -{ - short a,b; - float det; - - /* first adjoint */ - MTC_Mat3Adj(m1,m2); - - /* then determinant old mat! */ - det= m2[0][0]* (m2[1][1]*m2[2][2] - m2[1][2]*m2[2][1]) - -m2[1][0]* (m2[0][1]*m2[2][2] - m2[0][2]*m2[2][1]) - +m2[2][0]* (m2[0][1]*m2[1][2] - m2[0][2]*m2[1][1]); - - if(det==0) det=1; - det= 1/det; - for(a=0;a<3;a++) { - for(b=0;b<3;b++) { - m1[a][b]*=det; - } - } -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3Adj(float m1[][3], float m[][3]) -{ - m1[0][0]=m[1][1]*m[2][2]-m[1][2]*m[2][1]; - m1[0][1]= -m[0][1]*m[2][2]+m[0][2]*m[2][1]; - m1[0][2]=m[0][1]*m[1][2]-m[0][2]*m[1][1]; - - m1[1][0]= -m[1][0]*m[2][2]+m[1][2]*m[2][0]; - m1[1][1]=m[0][0]*m[2][2]-m[0][2]*m[2][0]; - m1[1][2]= -m[0][0]*m[1][2]+m[0][2]*m[1][0]; - - m1[2][0]=m[1][0]*m[2][1]-m[1][1]*m[2][0]; - m1[2][1]= -m[0][0]*m[2][1]+m[0][1]*m[2][0]; - m1[2][2]=m[0][0]*m[1][1]-m[0][1]*m[1][0]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat3One(float m[][3]) -{ - - m[0][0]= m[1][1]= m[2][2]= 1.0; - m[0][1]= m[0][2]= 0.0; - m[1][0]= m[1][2]= 0.0; - m[2][0]= m[2][1]= 0.0; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4SwapMat4(float m1[][4], float m2[][4]) -{ - float t; - int i, j; - - for(i = 0; i < 4; i++) { - for (j = 0; j < 4; j++) { - t = m1[i][j]; - m1[i][j] = m2[i][j]; - m2[i][j] = t; - } - } -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulVec4fl(float mat[][4], float *vec) -{ - float x,y,z; - - x = vec[0]; - y = vec[1]; - z = vec[2]; - vec[0] = x*mat[0][0] + y*mat[1][0] + z*mat[2][0] + mat[3][0]*vec[3]; - vec[1] = x*mat[0][1] + y*mat[1][1] + z*mat[2][1] + mat[3][1]*vec[3]; - vec[2] = x*mat[0][2] + y*mat[1][2] + z*mat[2][2] + mat[3][2]*vec[3]; - vec[3] = x*mat[0][3] + y*mat[1][3] + z*mat[2][3] + mat[3][3]*vec[3]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4CpyMat3nc(float m1[][4], float m2[][3]) /* no clear */ -{ - m1[0][0]= m2[0][0]; - m1[0][1]= m2[0][1]; - m1[0][2]= m2[0][2]; - - m1[1][0]= m2[1][0]; - m1[1][1]= m2[1][1]; - m1[1][2]= m2[1][2]; - - m1[2][0]= m2[2][0]; - m1[2][1]= m2[2][1]; - m1[2][2]= m2[2][2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_Mat4MulMat33(float m1[][3], float m2[][4], float m3[][3]) -{ - /* m1_i_j = m2_i_k * m3_k_j ? */ - - m1[0][0] = m2[0][0]*m3[0][0] + m2[0][1]*m3[1][0] + m2[0][2]*m3[2][0]; - m1[0][1] = m2[0][0]*m3[0][1] + m2[0][1]*m3[1][1] + m2[0][2]*m3[2][1]; - m1[0][2] = m2[0][0]*m3[0][2] + m2[0][1]*m3[1][2] + m2[0][2]*m3[2][2]; - - m1[1][0] = m2[1][0]*m3[0][0] + m2[1][1]*m3[1][0] + m2[1][2]*m3[2][0]; - m1[1][1] = m2[1][0]*m3[0][1] + m2[1][1]*m3[1][1] + m2[1][2]*m3[2][1]; - m1[1][2] = m2[1][0]*m3[0][2] + m2[1][1]*m3[1][2] + m2[1][2]*m3[2][2]; - - m1[2][0] = m2[2][0]*m3[0][0] + m2[2][1]*m3[1][0] + m2[2][2]*m3[2][0]; - m1[2][1] = m2[2][0]*m3[0][1] + m2[2][1]*m3[1][1] + m2[2][2]*m3[2][1]; - m1[2][2] = m2[2][0]*m3[0][2] + m2[2][1]*m3[1][2] + m2[2][2]*m3[2][2]; - -} - -/* ------------------------------------------------------------------------- */ - -/* eof */ diff --git a/source/blender/blenlib/intern/vectorops.c b/source/blender/blenlib/intern/vectorops.c deleted file mode 100644 index 3bff5235cfd..00000000000 --- a/source/blender/blenlib/intern/vectorops.c +++ /dev/null @@ -1,166 +0,0 @@ -/* - * - * Some vector operations. - * - * Always use - * - vector with x components : float x[3], int x[3], etc - * - * $Id$ - * - * ***** BEGIN GPL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL LICENSE BLOCK ***** - */ - -/* ------------------------------------------------------------------------- */ -/* General format: op(a, b, c): a = b op c */ -/* Copying is done cp <from, to> */ -/* ------------------------------------------------------------------------- */ - -#include "MTC_vectorops.h" -#include <math.h> - -#ifdef HAVE_CONFIG_H -#include <config.h> -#endif - -void MTC_diff3Int(int v1[3], int v2[3], int v3[3]) -{ - v1[0] = v2[0] - v3[0]; - v1[1] = v2[1] - v3[1]; - v1[2] = v2[2] - v3[2]; -} - -/* ------------------------------------------------------------------------- */ -void MTC_diff3Float(float v1[3], float v2[3], float v3[3]) -{ - v1[0] = v2[0] - v3[0]; - v1[1] = v2[1] - v3[1]; - v1[2] = v2[2] - v3[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cross3Int(int v1[3], int v2[3], int v3[3]) -{ - v1[0] = v2[1]*v3[2] - v2[2]*v3[1]; - v1[1] = v2[2]*v3[0] - v2[0]*v3[2]; - v1[2] = v2[0]*v3[1] - v2[1]*v3[0]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cross3Float(float v1[3], float v2[3], float v3[3]) -{ - v1[0] = v2[1]*v3[2] - v2[2]*v3[1]; - v1[1] = v2[2]*v3[0] - v2[0]*v3[2]; - v1[2] = v2[0]*v3[1] - v2[1]*v3[0]; -} -/* ------------------------------------------------------------------------- */ - -void MTC_cross3Double(double v1[3], double v2[3], double v3[3]) -{ - v1[0] = v2[1]*v3[2] - v2[2]*v3[1]; - v1[1] = v2[2]*v3[0] - v2[0]*v3[2]; - v1[2] = v2[0]*v3[1] - v2[1]*v3[0]; -} - -/* ------------------------------------------------------------------------- */ - -int MTC_dot3Int(int v1[3], int v2[3]) -{ - return (v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]); -} - -/* ------------------------------------------------------------------------- */ - -float MTC_dot3Float(float v1[3], float v2[3]) -{ - return (v1[0]*v2[0] + v1[1]*v2[1] + v1[2]*v2[2]); -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cp3Float(float v1[3], float v2[3]) -{ - v2[0] = v1[0]; - v2[1] = v1[1]; - v2[2] = v1[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_cp3FloatInv(float v1[3], float v2[3]) -{ - v2[0] = -v1[0]; - v2[1] = -v1[1]; - v2[2] = -v1[2]; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_swapInt(int *i1, int *i2) -{ - int swap; - swap = *i1; - *i1 = *i2; - *i2 = swap; -} - -/* ------------------------------------------------------------------------- */ - -void MTC_diff3DFF(double v1[3], float v2[3], float v3[3]) -{ - v1[0] = v2[0] - v3[0]; - v1[1] = v2[1] - v3[1]; - v1[2] = v2[2] - v3[2]; -} - -/* ------------------------------------------------------------------------- */ -float MTC_normalize3DF(float n[3]) -{ - float d; - - d= n[0]*n[0]+n[1]*n[1]+n[2]*n[2]; - /* FLT_EPSILON is too large! A larger value causes normalize errors in */ - /* a scaled down utah teapot */ - if(d>0.0000000000001) { - - /* d= sqrt(d); This _should_ be sqrt, but internally it's a double*/ - /* anyway. This is safe. */ - d = sqrt(d); - - n[0]/=d; - n[1]/=d; - n[2]/=d; - } else { - n[0]=n[1]=n[2]= 0.0; - d= 0.0; - } - return d; -} - -/* ------------------------------------------------------------------------- */ - -/* eof */ diff --git a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c index 3a2c2b1def1..9fcc9dcb90c 100644 --- a/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c +++ b/source/blender/nodes/intern/TEX_nodes/TEX_rotate.c @@ -27,7 +27,7 @@ */ #include <math.h> -#include "MTC_vectorops.h" + #include "../TEX_util.h" static bNodeSocketType inputs[]= { @@ -64,19 +64,19 @@ static void colorfn(float *out, float *coord, bNode *node, bNodeStack **in, shor if(magsq == 0) magsq = 1; - ndx = MTC_dot3Float(coord, ax); + ndx = Inpf(coord, ax); para[0] = ax[0] * ndx * (1 - cos_a); para[1] = ax[1] * ndx * (1 - cos_a); para[2] = ax[2] * ndx * (1 - cos_a); - MTC_diff3Float(perp, coord, para); + VecSubf(perp, coord, para); perp[0] = coord[0] * cos_a; perp[1] = coord[1] * cos_a; perp[2] = coord[2] * cos_a; - MTC_cross3Float(cp, ax, coord); + Crossf(cp, ax, coord); cp[0] = cp[0] * sin_a; cp[1] = cp[1] * sin_a; diff --git a/source/blender/python/api2_2x/Effect.c b/source/blender/python/api2_2x/Effect.c index 4d3dce741fc..1a37856a4d6 100644 --- a/source/blender/python/api2_2x/Effect.c +++ b/source/blender/python/api2_2x/Effect.c @@ -41,7 +41,7 @@ #include "gen_utils.h" #include "blendef.h" #include "vector.h" -#include "MTC_matrixops.h" + #define EXPP_EFFECT_STA_MIN -250.0f #define EXPP_EFFECT_END_MIN 1.0f diff --git a/source/blender/render/intern/source/convertblender.c b/source/blender/render/intern/source/convertblender.c index 3c6b872a16d..24f4a6f7ad3 100644 --- a/source/blender/render/intern/source/convertblender.c +++ b/source/blender/render/intern/source/convertblender.c @@ -32,7 +32,7 @@ #include <limits.h> #include "blendef.h" -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" @@ -203,8 +203,8 @@ void RE_make_stars(Render *re, void (*initfunc)(void), if (re) re->flag |= R_HALO; else stargrid *= 1.0; /* then it draws fewer */ - if(re) MTC_Mat4Invert(mat, re->viewmat); - else MTC_Mat4One(mat); + if(re) Mat4Invert(mat, re->viewmat); + else Mat4One(mat); /* BOUNDING BOX CALCULATION * bbox goes from z = loc_near_var | loc_far_var, @@ -252,7 +252,7 @@ void RE_make_stars(Render *re, void (*initfunc)(void), done++; } else { - MTC_Mat4MulVecfl(re->viewmat, vec); + Mat4MulVecfl(re->viewmat, vec); /* in vec are global coordinates * calculate distance to camera @@ -841,7 +841,7 @@ static void autosmooth(Render *re, ObjectRen *obr, float mat[][4], int degr) /* rotate vertices and calculate normal of faces */ for(a=0; a<obr->totvert; a++) { ver= RE_findOrAddVert(obr, a); - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); } for(a=0; a<obr->totvlak; a++) { vlr= RE_findOrAddVlak(obr, a); @@ -1278,19 +1278,19 @@ static void particle_billboard(Render *re, ObjectRen *obr, Material *ma, Particl VECADD(vlr->v1->co, bb_center, xvec); VECADD(vlr->v1->co, vlr->v1->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v1->co); + Mat4MulVecfl(re->viewmat, vlr->v1->co); VECSUB(vlr->v2->co, bb_center, xvec); VECADD(vlr->v2->co, vlr->v2->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v2->co); + Mat4MulVecfl(re->viewmat, vlr->v2->co); VECSUB(vlr->v3->co, bb_center, xvec); VECSUB(vlr->v3->co, vlr->v3->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v3->co); + Mat4MulVecfl(re->viewmat, vlr->v3->co); VECADD(vlr->v4->co, bb_center, xvec); VECSUB(vlr->v4->co, vlr->v4->co, yvec); - MTC_Mat4MulVecfl(re->viewmat, vlr->v4->co); + Mat4MulVecfl(re->viewmat, vlr->v4->co); CalcNormFloat4(vlr->v4->co, vlr->v3->co, vlr->v2->co, vlr->v1->co, vlr->n); VECCOPY(vlr->v1->n,vlr->n); @@ -1581,8 +1581,8 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem } /* 2.5 setup matrices */ - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); /* need to be that way, for imat texture */ + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* need to be that way, for imat texture */ Mat3CpyMat4(nmat, ob->imat); Mat3Transp(nmat); @@ -1854,7 +1854,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem time= curlen/strandlen; VECCOPY(loc,state.co); - MTC_Mat4MulVecfl(re->viewmat,loc); + Mat4MulVecfl(re->viewmat,loc); if(strandbuf) { VECCOPY(svert->co, loc); @@ -1894,7 +1894,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem VECCOPY(loc,state.co); if(part->draw_as!=PART_DRAW_BB) - MTC_Mat4MulVecfl(re->viewmat,loc); + Mat4MulVecfl(re->viewmat,loc); switch(part->draw_as) { case PART_DRAW_LINE: @@ -1903,7 +1903,7 @@ static int render_new_particle_system(Render *re, ObjectRen *obr, ParticleSystem sd.size = hasize; VECCOPY(vel,state.vel); - MTC_Mat4Mul3Vecfl(re->viewmat,vel); + Mat4Mul3Vecfl(re->viewmat,vel); Normalize(vel); if(part->draw & PART_DRAW_VEL_LENGTH) @@ -1997,8 +1997,8 @@ static void make_render_halos(Render *re, ObjectRen *obr, Mesh *me, int totvert, float vec[3], hasize, mat[4][4], imat[3][3]; int a, ok, seed= ma->seed1; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat3CpyMat4(imat, ob->imat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat3CpyMat4(imat, ob->imat); re->flag |= R_HALO; @@ -2009,7 +2009,7 @@ static void make_render_halos(Render *re, ObjectRen *obr, Mesh *me, int totvert, hasize= ma->hasize; VECCOPY(vec, mvert->co); - MTC_Mat4MulVecfl(mat, vec); + Mat4MulVecfl(mat, vec); if(ma->mode & MA_HALOPUNO) { xn= mvert->no[0]; @@ -2142,7 +2142,7 @@ static void displace_render_vert(Render *re, ObjectRen *obr, ShadeInput *shi, Ve } if (texco & TEXCO_GLOB) { VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(re->viewinv, shi->gl); + Mat4MulVecfl(re->viewinv, shi->gl); } if (texco & TEXCO_NORM) { VECCOPY(shi->orn, shi->vn); @@ -2282,9 +2282,9 @@ static void init_render_mball(Render *re, ObjectRen *obr) if (ob!=find_basis_mball(ob)) return; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); - MTC_Mat3CpyMat4(imat, ob->imat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); + Mat3CpyMat4(imat, ob->imat); ma= give_render_material(re, ob, 1); @@ -2305,7 +2305,7 @@ static void init_render_mball(Render *re, ObjectRen *obr) ver= RE_findOrAddVert(obr, obr->totvert++); VECCOPY(ver->co, data); - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); /* render normals are inverted */ xn= -nors[0]; @@ -2389,7 +2389,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar, if(orco) { v1->orco= orco; orco+= 3; orcoret++; } - MTC_Mat4MulVecfl(mat, v1->co); + Mat4MulVecfl(mat, v1->co); for (v = 1; v < sizev; v++) { ver= RE_findOrAddVert(obr, obr->totvert++); @@ -2397,7 +2397,7 @@ static int dl_surf_to_renderdata(ObjectRen *obr, DispList *dl, Material **matar, if(orco) { ver->orco= orco; orco+= 3; orcoret++; } - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); } /* if V-cyclic, add extra vertices at end of the row */ if (dl->flag & DL_CYCL_U) { @@ -2547,8 +2547,8 @@ static void init_render_surf(Render *re, ObjectRen *obr) nu= cu->nurb.first; if(nu==0) return; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* material array */ memset(matar, 0, 4*32); @@ -2609,8 +2609,8 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) dl= cu->disp.first; if(cu->disp.first==NULL) return; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* material array */ memset(matar, 0, 4*32); @@ -2651,7 +2651,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) ver->flag = 0; } - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); if (orco) { ver->orco = orco; @@ -2703,7 +2703,7 @@ static void init_render_curve(Render *re, ObjectRen *obr, int timeoffset) ver= RE_findOrAddVert(obr, obr->totvert++); VECCOPY(ver->co, fp); - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); fp+= 3; if (orco) { @@ -2951,9 +2951,9 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) me= ob->data; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); - MTC_Mat3CpyMat4(imat, ob->imat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); + Mat3CpyMat4(imat, ob->imat); if(me->totvert==0) return; @@ -3046,7 +3046,7 @@ static void init_render_mesh(Render *re, ObjectRen *obr, int timeoffset) ver= RE_findOrAddVert(obr, obr->totvert++); VECCOPY(ver->co, mvert->co); if(do_autosmooth==0) /* autosmooth on original unrotated data to prevent differences between frames */ - MTC_Mat4MulVecfl(mat, ver->co); + Mat4MulVecfl(mat, ver->co); if(orco) { ver->orco= orco; @@ -3267,13 +3267,13 @@ static void initshadowbuf(Render *re, LampRen *lar, float mat[][4]) shb->soft= lar->soft; shb->shadhalostep= lar->shadhalostep; - MTC_Mat4Ortho(mat); - MTC_Mat4Invert(shb->winmat, mat); /* winmat is temp */ + Mat4Ortho(mat); + Mat4Invert(shb->winmat, mat); /* winmat is temp */ /* matrix: combination of inverse view and lampmat */ /* calculate again: the ortho-render has no correct viewinv */ - MTC_Mat4Invert(viewinv, re->viewmat); - MTC_Mat4MulMat4(shb->viewmat, viewinv, shb->winmat); + Mat4Invert(viewinv, re->viewmat); + Mat4MulMat4(shb->viewmat, viewinv, shb->winmat); /* projection */ shb->d= lar->clipsta; @@ -3351,11 +3351,11 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) BLI_addtail(&re->lampren, lar); go->lampren= lar; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); - MTC_Mat3CpyMat4(lar->mat, mat); - MTC_Mat3CpyMat4(lar->imat, ob->imat); + Mat3CpyMat4(lar->mat, mat); + Mat3CpyMat4(lar->imat, ob->imat); lar->bufsize = la->bufsize; lar->samp = la->samp; @@ -3527,7 +3527,7 @@ static GroupObject *add_render_lamp(Render *re, Object *ob) lar->sh_invcampos[0]= -lar->co[0]; lar->sh_invcampos[1]= -lar->co[1]; lar->sh_invcampos[2]= -lar->co[2]; - MTC_Mat3MulVecfl(lar->imat, lar->sh_invcampos); + Mat3MulVecfl(lar->imat, lar->sh_invcampos); /* z factor, for a normalized volume */ angle= saacos(lar->spotsi); @@ -4149,7 +4149,7 @@ static void set_dupli_tex_mat(Render *re, ObjectInstanceRen *obi, DupliObject *d obi->duplitexmat= BLI_memarena_alloc(re->memArena, sizeof(float)*4*4); Mat4Invert(imat, dob->mat); - MTC_Mat4MulSerie(obi->duplitexmat, re->viewmat, dob->omat, imat, re->viewinv, 0, 0, 0, 0); + Mat4MulSerie(obi->duplitexmat, re->viewmat, dob->omat, imat, re->viewinv, 0, 0, 0, 0); } } @@ -4273,8 +4273,8 @@ static void init_render_object(Render *re, Object *ob, Object *par, DupliObject else if(render_object_type(ob->type)) add_render_object(re, ob, par, dob, timeoffset, vectorlay); else { - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); } time= PIL_check_seconds_timer(); @@ -4516,8 +4516,8 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp for(SETLOOPER(re->scene, base)) { ob= base->object; /* imat objects has to be done here, since displace can have texture using Object map-input */ - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); /* each object should only be rendered once */ ob->flag &= ~OB_DONE; ob->transflag &= ~OB_RENDER_DUPLI; @@ -4663,8 +4663,8 @@ static void database_init_objects(Render *re, unsigned int renderlay, int nolamp if(redoimat) { for(SETLOOPER(re->scene, base)) { ob= base->object; - MTC_Mat4MulMat4(mat, ob->obmat, re->viewmat); - MTC_Mat4Invert(ob->imat, mat); + Mat4MulMat4(mat, ob->obmat, re->viewmat); + Mat4Invert(ob->imat, mat); } } @@ -5070,7 +5070,7 @@ static int load_fluidsimspeedvectors(Render *re, ObjectInstanceRen *obi, float * return 0; Mat4CpyMat4(mat, re->viewmat); - MTC_Mat4Invert(imat, mat); + Mat4Invert(imat, mat); /* set first vertex OK */ if(!fss->meshSurfNormals) return 0; diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 13fa9b17b71..46669fd8f47 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -51,7 +51,7 @@ #include "BKE_texture.h" #include "BKE_utildefines.h" -#include "MTC_matrixops.h" + /* this module */ #include "render_types.h" @@ -209,9 +209,9 @@ static void envmap_transmatrix(float mat[][4], int part) eul[2]= -M_PI/2.0; } - MTC_Mat4CpyMat4(tmat, mat); + Mat4CpyMat4(tmat, mat); EulToMat4(eul, rotmat); - MTC_Mat4MulSerie(mat, tmat, rotmat, + Mat4MulSerie(mat, tmat, rotmat, 0, 0, 0, 0, 0, 0); } @@ -229,12 +229,12 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode) int a; if(mode==0) { - MTC_Mat4Invert(tmat, mat); - MTC_Mat3CpyMat4(imat, tmat); + Mat4Invert(tmat, mat); + Mat3CpyMat4(imat, tmat); } else { - MTC_Mat4CpyMat4(tmat, mat); - MTC_Mat3CpyMat4(imat, mat); + Mat4CpyMat4(tmat, mat); + Mat3CpyMat4(imat, mat); } for(obi=re->instancetable.first; obi; obi=obi->next) { @@ -265,7 +265,7 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode) if((a & 255)==0) har= obr->bloha[a>>8]; else har++; - MTC_Mat4MulVecfl(tmat, har->co); + Mat4MulVecfl(tmat, har->co); } } @@ -278,22 +278,22 @@ static void env_rotate_scene(Render *re, float mat[][4], int mode) Mat3CpyMat3(cmat, lar->imat); Mat3MulMat3(lar->imat, cmat, imat); - MTC_Mat3MulVecfl(imat, lar->vec); - MTC_Mat4MulVecfl(tmat, lar->co); + Mat3MulVecfl(imat, lar->vec); + Mat4MulVecfl(tmat, lar->co); lar->sh_invcampos[0]= -lar->co[0]; lar->sh_invcampos[1]= -lar->co[1]; lar->sh_invcampos[2]= -lar->co[2]; - MTC_Mat3MulVecfl(lar->imat, lar->sh_invcampos); + Mat3MulVecfl(lar->imat, lar->sh_invcampos); lar->sh_invcampos[2]*= lar->sh_zfac; if(lar->shb) { if(mode==1) { - MTC_Mat4Invert(pmat, mat); - MTC_Mat4MulMat4(smat, pmat, lar->shb->viewmat); - MTC_Mat4MulMat4(lar->shb->persmat, smat, lar->shb->winmat); + Mat4Invert(pmat, mat); + Mat4MulMat4(smat, pmat, lar->shb->viewmat); + Mat4MulMat4(lar->shb->persmat, smat, lar->shb->winmat); } - else MTC_Mat4MulMat4(lar->shb->persmat, lar->shb->viewmat, lar->shb->winmat); + else Mat4MulMat4(lar->shb->persmat, lar->shb->viewmat, lar->shb->winmat); } } @@ -371,8 +371,8 @@ static void env_set_imats(Render *re) base= G.scene->base.first; while(base) { - MTC_Mat4MulMat4(mat, base->object->obmat, re->viewmat); - MTC_Mat4Invert(base->object->imat, mat); + Mat4MulMat4(mat, base->object->obmat, re->viewmat); + Mat4Invert(base->object->imat, mat); base= base->next; } @@ -391,18 +391,18 @@ static void render_envmap(Render *re, EnvMap *env) short part; /* need a recalc: ortho-render has no correct viewinv */ - MTC_Mat4Invert(oldviewinv, re->viewmat); + Mat4Invert(oldviewinv, re->viewmat); envre= envmap_render_copy(re, env); /* precalc orthmat for object */ - MTC_Mat4CpyMat4(orthmat, env->object->obmat); - MTC_Mat4Ortho(orthmat); + Mat4CpyMat4(orthmat, env->object->obmat); + Mat4Ortho(orthmat); /* need imat later for texture imat */ - MTC_Mat4MulMat4(mat, orthmat, re->viewmat); - MTC_Mat4Invert(tmat, mat); - MTC_Mat3CpyMat4(env->obimat, tmat); + Mat4MulMat4(mat, orthmat, re->viewmat); + Mat4Invert(tmat, mat); + Mat3CpyMat4(env->obimat, tmat); for(part=0; part<6; part++) { if(env->type==ENV_PLANE && part!=1) @@ -410,17 +410,17 @@ static void render_envmap(Render *re, EnvMap *env) re->display_clear(envre->result); - MTC_Mat4CpyMat4(tmat, orthmat); + Mat4CpyMat4(tmat, orthmat); envmap_transmatrix(tmat, part); - MTC_Mat4Invert(mat, tmat); + Mat4Invert(mat, tmat); /* mat now is the camera 'viewmat' */ - MTC_Mat4CpyMat4(envre->viewmat, mat); - MTC_Mat4CpyMat4(envre->viewinv, tmat); + Mat4CpyMat4(envre->viewmat, mat); + Mat4CpyMat4(envre->viewinv, tmat); /* we have to correct for the already rotated vertexcoords */ - MTC_Mat4MulMat4(tmat, oldviewinv, envre->viewmat); - MTC_Mat4Invert(env->imat, tmat); + Mat4MulMat4(tmat, oldviewinv, envre->viewmat); + Mat4Invert(env->imat, tmat); env_rotate_scene(envre, tmat, 1); init_render_world(envre); @@ -501,13 +501,13 @@ void make_envmaps(Render *re) float orthmat[4][4], mat[4][4], tmat[4][4]; /* precalc orthmat for object */ - MTC_Mat4CpyMat4(orthmat, env->object->obmat); - MTC_Mat4Ortho(orthmat); + Mat4CpyMat4(orthmat, env->object->obmat); + Mat4Ortho(orthmat); /* need imat later for texture imat */ - MTC_Mat4MulMat4(mat, orthmat, re->viewmat); - MTC_Mat4Invert(tmat, mat); - MTC_Mat3CpyMat4(env->obimat, tmat); + Mat4MulMat4(mat, orthmat, re->viewmat); + Mat4Invert(tmat, mat); + Mat3CpyMat4(env->obimat, tmat); } else { @@ -676,20 +676,20 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe /* rotate to envmap space, if object is set */ VECCOPY(vec, texvec); - if(env->object) MTC_Mat3MulVecfl(env->obimat, vec); - else MTC_Mat4Mul3Vecfl(R.viewinv, vec); + if(env->object) Mat3MulVecfl(env->obimat, vec); + else Mat4Mul3Vecfl(R.viewinv, vec); face= envcube_isect(env, vec, sco); ibuf= env->cube[face]; if(osatex) { if(env->object) { - MTC_Mat3MulVecfl(env->obimat, dxt); - MTC_Mat3MulVecfl(env->obimat, dyt); + Mat3MulVecfl(env->obimat, dxt); + Mat3MulVecfl(env->obimat, dyt); } else { - MTC_Mat4Mul3Vecfl(R.viewinv, dxt); - MTC_Mat4Mul3Vecfl(R.viewinv, dyt); + Mat4Mul3Vecfl(R.viewinv, dxt); + Mat4Mul3Vecfl(R.viewinv, dyt); } set_dxtdyt(dxts, dyts, dxt, dyt, face); imagewraposa(tex, NULL, ibuf, sco, dxts, dyts, texres); diff --git a/source/blender/render/intern/source/initrender.c b/source/blender/render/intern/source/initrender.c index 40c0edb6e5f..e5894606454 100644 --- a/source/blender/render/intern/source/initrender.c +++ b/source/blender/render/intern/source/initrender.c @@ -41,7 +41,7 @@ #include "BLI_blenlib.h" #include "BLI_jitter.h" -#include "MTC_matrixops.h" + #include "DNA_camera_types.h" #include "DNA_group_types.h" diff --git a/source/blender/render/intern/source/pixelshading.c b/source/blender/render/intern/source/pixelshading.c index af6093ab36c..58101b5126a 100644 --- a/source/blender/render/intern/source/pixelshading.c +++ b/source/blender/render/intern/source/pixelshading.c @@ -32,8 +32,8 @@ /* External modules: */ #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" + + #include "DNA_camera_types.h" #include "DNA_group_types.h" @@ -153,7 +153,7 @@ static void render_lighting_halo(HaloRen *har, float *colf) /* rotate view to lampspace */ VECCOPY(lvrot, lv); - MTC_Mat3MulVecfl(lar->imat, lvrot); + Mat3MulVecfl(lar->imat, lvrot); x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2])); /* 1.0/(sqrt(1+x*x)) is equivalent to cos(atan(x)) */ @@ -545,7 +545,7 @@ void shadeSkyView(float *colf, float *rco, float *view, float *dxyview, short th VECCOPY(lo, view); if(R.wrld.skytype & WO_SKYREAL) { - MTC_Mat3MulVecfl(R.imat, lo); + Mat3MulVecfl(R.imat, lo); SWAP(float, lo[1], lo[2]); @@ -587,7 +587,7 @@ void shadeSunView(float *colf, float *view) VECCOPY(sview, view); Normalize(sview); - MTC_Mat3MulVecfl(R.imat, sview); + Mat3MulVecfl(R.imat, sview); if (sview[2] < 0.0) sview[2] = 0.0; Normalize(sview); @@ -668,7 +668,7 @@ void shadeAtmPixel(struct SunSky *sunsky, float *collector, float fx, float fy, calc_view_vector(view, fx, fy); Normalize(view); - /*MTC_Mat3MulVecfl(R.imat, view);*/ + /*Mat3MulVecfl(R.imat, view);*/ AtmospherePixleShader(sunsky, view, distance, collector); } diff --git a/source/blender/render/intern/source/shadbuf.c b/source/blender/render/intern/source/shadbuf.c index c53a2b68c9c..cd7a0449d0e 100644 --- a/source/blender/render/intern/source/shadbuf.c +++ b/source/blender/render/intern/source/shadbuf.c @@ -26,7 +26,7 @@ #include <math.h> #include <string.h> -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" #include "DNA_group_types.h" @@ -403,7 +403,7 @@ void makeshadowbuf(Render *re, LampRen *lar) wsize= shb->pixsize*(shb->size/2.0); i_window(-wsize, wsize, -wsize, wsize, shb->d, shb->clipend, shb->winmat); - MTC_Mat4MulMat4(shb->persmat, shb->viewmat, shb->winmat); + Mat4MulMat4(shb->persmat, shb->viewmat, shb->winmat); if(ELEM(lar->buftype, LA_SHADBUF_REGULAR, LA_SHADBUF_HALFWAY)) { /* jitter, weights - not threadsafe! */ @@ -673,7 +673,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *rco, float *dxco, float *dy VECCOPY(co, rco); co[3]= 1.0f; - MTC_Mat4MulVec4fl(shb->persmat, co); /* rational hom co */ + Mat4MulVec4fl(shb->persmat, co); /* rational hom co */ xs1= siz*(1.0f+co[0]/co[3]); ys1= siz*(1.0f+co[1]/co[3]); @@ -714,7 +714,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *rco, float *dxco, float *dy co[1]= rco[1]+dxco[1]; co[2]= rco[2]+dxco[2]; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ + Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ dx[0]= xs1- siz*(1.0+co[0]/co[3]); dx[1]= ys1- siz*(1.0+co[1]/co[3]); @@ -722,7 +722,7 @@ float testshadowbuf(Render *re, ShadBuf *shb, float *rco, float *dxco, float *dy co[1]= rco[1]+dyco[1]; co[2]= rco[2]+dyco[2]; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ + Mat4MulVec4fl(shb->persmat,co); /* rational hom co */ dy[0]= xs1- siz*(1.0+co[0]/co[3]); dy[1]= ys1- siz*(1.0+co[1]/co[3]); @@ -858,7 +858,7 @@ float shadow_halo(LampRen *lar, float *p1, float *p2) co[1]= p1[1]; co[2]= p1[2]/lar->sh_zfac; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ + Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ xf1= siz*(1.0+co[0]/co[3]); yf1= siz*(1.0+co[1]/co[3]); zf1= (co[2]/co[3]); @@ -868,7 +868,7 @@ float shadow_halo(LampRen *lar, float *p1, float *p2) co[1]= p2[1]; co[2]= p2[2]/lar->sh_zfac; co[3]= 1.0; - MTC_Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ + Mat4MulVec4fl(shb->winmat, co); /* rational hom co */ xf2= siz*(1.0+co[0]/co[3]); yf2= siz*(1.0+co[1]/co[3]); zf2= (co[2]/co[3]); @@ -1659,7 +1659,7 @@ static int viewpixel_to_lampbuf(ShadBuf *shb, ObjectInstanceRen *obi, VlakRen *v } /* move 3d vector to lampbuf */ - MTC_Mat4MulVec4fl(shb->persmat, hoco); /* rational hom co */ + Mat4MulVec4fl(shb->persmat, hoco); /* rational hom co */ /* clip We can test for -1.0/1.0 because of the properties of the * coordinate transformations. */ diff --git a/source/blender/render/intern/source/shadeinput.c b/source/blender/render/intern/source/shadeinput.c index 1cd8ec110f9..7e3d906b035 100644 --- a/source/blender/render/intern/source/shadeinput.c +++ b/source/blender/render/intern/source/shadeinput.c @@ -29,7 +29,7 @@ #include <math.h> #include <string.h> -#include "MTC_matrixops.h" + #include "BLI_arithb.h" #include "BLI_blenlib.h" @@ -416,13 +416,13 @@ void shade_input_set_strand_texco(ShadeInput *shi, StrandRen *strand, StrandVert if(texco & TEXCO_GLOB) { VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(R.viewinv, shi->gl); + Mat4MulVecfl(R.viewinv, shi->gl); if(shi->osatex) { VECCOPY(shi->dxgl, shi->dxco); - MTC_Mat3MulVecfl(R.imat, shi->dxco); + Mat3MulVecfl(R.imat, shi->dxco); VECCOPY(shi->dygl, shi->dyco); - MTC_Mat3MulVecfl(R.imat, shi->dyco); + Mat3MulVecfl(R.imat, shi->dyco); } } @@ -974,12 +974,12 @@ void shade_input_set_shade_texco(ShadeInput *shi) if(texco & TEXCO_GLOB) { VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(R.viewinv, shi->gl); + Mat4MulVecfl(R.viewinv, shi->gl); if(shi->osatex) { VECCOPY(shi->dxgl, shi->dxco); - MTC_Mat3MulVecfl(R.imat, shi->dxco); + Mat3MulVecfl(R.imat, shi->dxco); VECCOPY(shi->dygl, shi->dyco); - MTC_Mat3MulVecfl(R.imat, shi->dyco); + Mat3MulVecfl(R.imat, shi->dyco); } } diff --git a/source/blender/render/intern/source/shadeoutput.c b/source/blender/render/intern/source/shadeoutput.c index 2fbd93df0ce..4bdd0b69699 100644 --- a/source/blender/render/intern/source/shadeoutput.c +++ b/source/blender/render/intern/source/shadeoutput.c @@ -30,7 +30,7 @@ #include <math.h> #include <string.h> -#include "MTC_matrixops.h" + #include "BLI_arithb.h" #include "BKE_colortools.h" @@ -168,7 +168,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) p1[0]= shi->co[0]-lar->co[0]; p1[1]= shi->co[1]-lar->co[1]; p1[2]= -lar->co[2]; - MTC_Mat3MulVecfl(lar->imat, p1); + Mat3MulVecfl(lar->imat, p1); VECCOPY(npos, p1); // npos is double! /* pre-scale */ @@ -180,7 +180,7 @@ static void spothalo(struct LampRen *lar, ShadeInput *shi, float *intens) /* rotate view */ VECCOPY(nray, shi->view); - MTC_Mat3MulVecd(lar->imat, nray); + Mat3MulVecd(lar->imat, nray); if(R.wrld.mode & WO_MIST) { /* patchy... */ @@ -1143,7 +1143,7 @@ float lamp_get_visibility(LampRen *lar, float *co, float *lv, float *dist) /* rotate view to lampspace */ VECCOPY(lvrot, lv); - MTC_Mat3MulVecfl(lar->imat, lvrot); + Mat3MulVecfl(lar->imat, lvrot); x= MAX2(fabs(lvrot[0]/lvrot[2]) , fabs(lvrot[1]/lvrot[2])); /* 1.0f/(sqrt(1+x*x)) is equivalent to cos(atan(x)) */ diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 007b69a9b97..3e8cf71605d 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -30,7 +30,7 @@ #include <string.h> #include <math.h> -#include "MTC_matrixops.h" + #include "BLI_blenlib.h" #include "BLI_arithb.h" @@ -829,7 +829,7 @@ static int cubemap_glob(float *n, float x, float y, float z, float *adr1, float else { VECCOPY(nor, n); } - MTC_Mat4Mul3Vecfl(R.viewinv, nor); + Mat4Mul3Vecfl(R.viewinv, nor); x1= fabs(nor[0]); y1= fabs(nor[1]); @@ -922,7 +922,7 @@ static int cubemap_ob(Object *ob, float *n, float x, float y, float z, float *ad if(n==NULL) return 0; VECCOPY(nor, n); - if(ob) MTC_Mat4Mul3Vecfl(ob->imat, nor); + if(ob) Mat4Mul3Vecfl(ob->imat, nor); x1= fabs(nor[0]); y1= fabs(nor[1]); @@ -1540,13 +1540,13 @@ void do_material_tex(ShadeInput *shi) VECCOPY(tempvec, shi->co); if(mtex->texflag & MTEX_OB_DUPLI_ORIG) if(shi->obi && shi->obi->duplitexmat) - MTC_Mat4MulVecfl(shi->obi->duplitexmat, tempvec); - MTC_Mat4MulVecfl(ob->imat, tempvec); + Mat4MulVecfl(shi->obi->duplitexmat, tempvec); + Mat4MulVecfl(ob->imat, tempvec); if(shi->osatex) { VECCOPY(dxt, shi->dxco); VECCOPY(dyt, shi->dyco); - MTC_Mat4Mul3Vecfl(ob->imat, dxt); - MTC_Mat4Mul3Vecfl(ob->imat, dyt); + Mat4Mul3Vecfl(ob->imat, dxt); + Mat4Mul3Vecfl(ob->imat, dyt); } } else { @@ -2237,7 +2237,7 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f case TEXCO_OBJECT: if(mtex->object) { VECCOPY(tempvec, lo); - MTC_Mat4MulVecfl(mtex->object->imat, tempvec); + Mat4MulVecfl(mtex->object->imat, tempvec); co= tempvec; } break; @@ -2245,16 +2245,16 @@ void do_sky_tex(float *rco, float *lo, float *dxyview, float *hor, float *zen, f case TEXCO_GLOB: if(rco) { VECCOPY(tempvec, rco); - MTC_Mat4MulVecfl(R.viewinv, tempvec); + Mat4MulVecfl(R.viewinv, tempvec); co= tempvec; } else co= lo; // VECCOPY(shi->dxgl, shi->dxco); -// MTC_Mat3MulVecfl(R.imat, shi->dxco); +// Mat3MulVecfl(R.imat, shi->dxco); // VECCOPY(shi->dygl, shi->dyco); -// MTC_Mat3MulVecfl(R.imat, shi->dyco); +// Mat3MulVecfl(R.imat, shi->dyco); break; } @@ -2376,12 +2376,12 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef dx= dxt; dy= dyt; VECCOPY(tempvec, shi->co); - MTC_Mat4MulVecfl(ob->imat, tempvec); + Mat4MulVecfl(ob->imat, tempvec); if(shi->osatex) { VECCOPY(dxt, shi->dxco); VECCOPY(dyt, shi->dyco); - MTC_Mat4Mul3Vecfl(ob->imat, dxt); - MTC_Mat4Mul3Vecfl(ob->imat, dyt); + Mat4Mul3Vecfl(ob->imat, dxt); + Mat4Mul3Vecfl(ob->imat, dyt); } } else { @@ -2392,12 +2392,12 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef else if(mtex->texco==TEXCO_GLOB) { co= shi->gl; dx= shi->dxco; dy= shi->dyco; VECCOPY(shi->gl, shi->co); - MTC_Mat4MulVecfl(R.viewinv, shi->gl); + Mat4MulVecfl(R.viewinv, shi->gl); } else if(mtex->texco==TEXCO_VIEW) { VECCOPY(tempvec, lavec); - MTC_Mat3MulVecfl(la->imat, tempvec); + Mat3MulVecfl(la->imat, tempvec); if(la->type==LA_SPOT) { tempvec[0]*= la->spottexfac; @@ -2410,8 +2410,8 @@ void do_lamp_tex(LampRen *la, float *lavec, ShadeInput *shi, float *colf, int ef VECCOPY(dxt, shi->dxlv); VECCOPY(dyt, shi->dylv); /* need some matrix conversion here? la->imat is a [3][3] matrix!!! **/ - MTC_Mat3MulVecfl(la->imat, dxt); - MTC_Mat3MulVecfl(la->imat, dyt); + Mat3MulVecfl(la->imat, dxt); + Mat3MulVecfl(la->imat, dyt); VecMulf(dxt, la->spottexfac); VecMulf(dyt, la->spottexfac); diff --git a/source/blender/render/intern/source/zbuf.c b/source/blender/render/intern/source/zbuf.c index 509ac81c58b..19ec0059a08 100644 --- a/source/blender/render/intern/source/zbuf.c +++ b/source/blender/render/intern/source/zbuf.c @@ -42,7 +42,7 @@ #include "BLI_jitter.h" #include "BLI_threads.h" -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" #include "DNA_lamp_types.h" @@ -2314,7 +2314,7 @@ void RE_zbufferall_radio(struct RadView *vw, RNode **rg_elem, int rg_totelem, Re hashlist_projectvert(NULL, winmat, NULL); /* needed for projectvert */ - MTC_Mat4MulMat4(winmat, vw->viewmat, vw->winmat); + Mat4MulMat4(winmat, vw->viewmat, vw->winmat); /* 1.0f for clipping in clippyra()... bad stuff actually */ zbuf_alloc_span(&zspan, vw->rectx, vw->recty, 1.0f); diff --git a/source/blender/src/drawobject.c b/source/blender/src/drawobject.c index ef37b184a85..fddbadac22d 100644 --- a/source/blender/src/drawobject.c +++ b/source/blender/src/drawobject.c @@ -41,7 +41,7 @@ #include "IMB_imbuf.h" -#include "MTC_matrixops.h" + #include "DNA_armature_types.h" #include "DNA_camera_types.h" @@ -1040,7 +1040,7 @@ static void drawcamera(Object *ob, int flag) Mat4Ortho(vec); mymultmatrix(vec); - MTC_Mat4SwapMat4(G.vd->persmat, tmat); + Mat4SwapMat4(G.vd->persmat, tmat); mygetsingmatrix(G.vd->persmat); if(cam->flag & CAM_SHOWLIMITS) { @@ -1053,7 +1053,7 @@ static void drawcamera(Object *ob, int flag) if(cam->flag & CAM_SHOWMIST) if(wrld) draw_limit_line(wrld->miststa, wrld->miststa+wrld->mistdist, 0xFFFFFF); - MTC_Mat4SwapMat4(G.vd->persmat, tmat); + Mat4SwapMat4(G.vd->persmat, tmat); } } } diff --git a/source/blender/src/editface.c b/source/blender/src/editface.c index f6a0b88cbc8..1430c6ad0d5 100644 --- a/source/blender/src/editface.c +++ b/source/blender/src/editface.c @@ -39,7 +39,7 @@ #include "BLI_edgehash.h" #include "BLI_editVert.h" -#include "MTC_matrixops.h" + #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" diff --git a/source/blender/src/editfont.c b/source/blender/src/editfont.c index 682125dabb1..30097f9e786 100644 --- a/source/blender/src/editfont.c +++ b/source/blender/src/editfont.c @@ -42,7 +42,7 @@ #include <io.h> #endif -#include "MTC_matrixops.h" + #include "MEM_guardedalloc.h" diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c index 3dbbe7d7336..980478945cb 100644 --- a/source/blender/src/editmesh_mods.c +++ b/source/blender/src/editmesh_mods.c @@ -39,7 +39,7 @@ editmesh_mods.c, UI level access, no geometry changes #include "MEM_guardedalloc.h" -#include "MTC_matrixops.h" + #include "DNA_mesh_types.h" #include "DNA_material_types.h" diff --git a/source/blender/src/editmesh_tools.c b/source/blender/src/editmesh_tools.c index 0fb072c1af4..4c72d7450b6 100644 --- a/source/blender/src/editmesh_tools.c +++ b/source/blender/src/editmesh_tools.c @@ -106,7 +106,7 @@ editmesh_tool.c: UI called tools for editmesh, geometry changes here, otherwise #include "editmesh.h" -#include "MTC_vectorops.h" + #include "PIL_time.h" diff --git a/source/blender/src/fluidsim.c b/source/blender/src/fluidsim.c index 4be00b63ecb..c176ff7800e 100644 --- a/source/blender/src/fluidsim.c +++ b/source/blender/src/fluidsim.c @@ -57,7 +57,7 @@ #include "BLI_blenlib.h" #include "BLI_threads.h" #include "BLI_arithb.h" -#include "MTC_matrixops.h" + #include "BKE_customdata.h" #include "BKE_displist.h" @@ -801,7 +801,7 @@ void fluidsimBake(struct Object *ob) } // init trafo matrix - MTC_Mat4CpyMat4(domainMat, fsDomain->obmat); + Mat4CpyMat4(domainMat, fsDomain->obmat); if(!Mat4Invert(invDomMat, domainMat)) { snprintf(debugStrBuffer,256,"fluidsimBake::error - Invalid obj matrix?\n"); elbeemDebugOut(debugStrBuffer); diff --git a/source/blender/src/previewrender.c b/source/blender/src/previewrender.c index 21be4b2cf49..98cdb99b6d2 100644 --- a/source/blender/src/previewrender.c +++ b/source/blender/src/previewrender.c @@ -47,7 +47,7 @@ #include "BLI_arithb.h" #include "BLI_blenlib.h" -#include "MTC_matrixops.h" + #include "DNA_texture_types.h" #include "DNA_world_types.h" diff --git a/source/blender/src/vpaint.c b/source/blender/src/vpaint.c index 8da5e1b2572..2b4c4b33ddf 100644 --- a/source/blender/src/vpaint.c +++ b/source/blender/src/vpaint.c @@ -43,7 +43,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" -#include "MTC_matrixops.h" + #include "DNA_action_types.h" #include "DNA_armature_types.h" @@ -1204,7 +1204,7 @@ void weight_paint(void) else totindex= 0; } - MTC_Mat4SwapMat4(G.vd->persmat, mat); + Mat4SwapMat4(G.vd->persmat, mat); if(Gwp.flag & VP_COLINDEX) { for(index=0; index<totindex; index++) { @@ -1313,7 +1313,7 @@ void weight_paint(void) } } - MTC_Mat4SwapMat4(G.vd->persmat, mat); + Mat4SwapMat4(G.vd->persmat, mat); } else BIF_wait_for_statechange(); @@ -1436,7 +1436,7 @@ void vertex_paint() else totindex= 0; } - MTC_Mat4SwapMat4(G.vd->persmat, mat); + Mat4SwapMat4(G.vd->persmat, mat); if(Gvp.flag & VP_COLINDEX) { for(index=0; index<totindex; index++) { @@ -1497,7 +1497,7 @@ void vertex_paint() } } - MTC_Mat4SwapMat4(G.vd->persmat, mat); + Mat4SwapMat4(G.vd->persmat, mat); do_shared_vertexcol(me); diff --git a/source/blender/yafray/intern/export_File.cpp b/source/blender/yafray/intern/export_File.cpp index ea700965826..425ec66bab3 100644 --- a/source/blender/yafray/intern/export_File.cpp +++ b/source/blender/yafray/intern/export_File.cpp @@ -6,6 +6,8 @@ using namespace std; +#define MTC_cp3Float(_a, _b) VecCopyf(_b, _a) + static string command_path = ""; #ifdef WIN32 @@ -20,7 +22,6 @@ static string command_path = ""; #define FILE_MAXFILE 80 #endif - static string find_path() { HKEY hkey; @@ -1036,10 +1037,10 @@ void yafrayFileRender_t::writeMaterialsAndModulators() // In this case this means the inverse of that matrix float texmat[4][4], itexmat[4][4]; if ((mtex->texco & TEXCO_OBJECT) && (mtex->object)) - MTC_Mat4CpyMat4(texmat, mtex->object->obmat); + Mat4CpyMat4(texmat, mtex->object->obmat); else // also for refl. map - MTC_Mat4CpyMat4(texmat, maincam_obj->obmat); - MTC_Mat4Invert(itexmat, texmat); + Mat4CpyMat4(texmat, maincam_obj->obmat); + Mat4Invert(itexmat, texmat); ostr << "\n\t\tm00=\"" << itexmat[0][0] << "\" m01=\"" << itexmat[1][0] << "\" m02=\"" << itexmat[2][0] << "\" m03=\"" << itexmat[3][0] << "\"\n"; ostr << "\t\tm10=\"" << itexmat[0][1] << "\" m11=\"" << itexmat[1][1] @@ -1304,8 +1305,8 @@ void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vector<V // for deformed objects, object->imat is no longer valid, // so have to create inverse render matrix ourselves here float mat[4][4], imat[4][4]; - MTC_Mat4MulMat4(mat, obj->obmat, re->viewmat); - MTC_Mat4Invert(imat, mat); + Mat4MulMat4(mat, obj->obmat, re->viewmat); + Mat4Invert(imat, mat); for (vector<VlakRen*>::const_iterator fci=VLR_list.begin(); fci!=VLR_list.end();++fci) @@ -1319,7 +1320,7 @@ void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vector<V vert_idx[vlr->v1] = vidx++; ver = vlr->v1; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); ostr << "\t\t\t<p x=\"" << tvec[0] << "\" y=\"" << tvec[1] << "\" z=\"" << tvec[2] << "\" />\n"; @@ -1340,7 +1341,7 @@ void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vector<V vert_idx[vlr->v2] = vidx++; ver = vlr->v2; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); ostr << "\t\t\t<p x=\"" << tvec[0] << "\" y=\"" << tvec[1] << "\" z=\"" << tvec[2] << "\" />\n"; @@ -1361,7 +1362,7 @@ void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vector<V vert_idx[vlr->v3] = vidx++; ver = vlr->v3; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); ostr << "\t\t\t<p x=\"" << tvec[0] << "\" y=\"" << tvec[1] << "\" z=\"" << tvec[2] << "\" />\n"; @@ -1382,7 +1383,7 @@ void yafrayFileRender_t::writeObject(Object* obj, ObjectRen *obr, const vector<V vert_idx[vlr->v4] = vidx++; ver = vlr->v4; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); ostr << "\t\t\t<p x=\"" << tvec[0] << "\" y=\"" << tvec[1] << "\" z=\"" << tvec[2] << "\" />\n"; @@ -1532,7 +1533,7 @@ void yafrayFileRender_t::writeAllObjects() for (int j=0;j<4;j++) obmat[i][j] = dupMtx->second[(i<<2)+j]; - MTC_Mat4Invert(imat, obmat); + Mat4Invert(imat, obmat); // first object written as normal (but with transform of first duplivert) Object* obj = dup_srcob[dupMtx->first]; @@ -1546,7 +1547,7 @@ void yafrayFileRender_t::writeAllObjects() for (int j=0;j<4;j++) nmat[i][j] = dupMtx->second[curmtx+(i<<2)+j]; - MTC_Mat4MulMat4(cmat, imat, nmat); // transform with respect to original = inverse_original * new + Mat4MulMat4(cmat, imat, nmat); // transform with respect to original = inverse_original * new ostr.str(""); // yafray matrix = transpose of Blender @@ -1592,13 +1593,13 @@ void yafrayFileRender_t::writeAreaLamp(LampRen* lamp, int num, float iview[4][4] // transform area lamp coords back to world float lpco[4][3]; MTC_cp3Float(a, lpco[0]); - MTC_Mat4MulVecfl(iview, lpco[0]); + Mat4MulVecfl(iview, lpco[0]); MTC_cp3Float(b, lpco[1]); - MTC_Mat4MulVecfl(iview, lpco[1]); + Mat4MulVecfl(iview, lpco[1]); MTC_cp3Float(c, lpco[2]); - MTC_Mat4MulVecfl(iview, lpco[2]); + Mat4MulVecfl(iview, lpco[2]); MTC_cp3Float(d, lpco[3]); - MTC_Mat4MulVecfl(iview, lpco[3]); + Mat4MulVecfl(iview, lpco[3]); ostr << "\t<a x=\""<< lpco[0][0] <<"\" y=\""<< lpco[0][1] <<"\" z=\"" << lpco[0][2] <<"\" />\n"; ostr << "\t<b x=\""<< lpco[1][0] <<"\" y=\""<< lpco[1][1] <<"\" z=\"" << lpco[1][2] <<"\" />\n"; ostr << "\t<c x=\""<< lpco[2][0] <<"\" y=\""<< lpco[2][1] <<"\" z=\"" << lpco[2][2] <<"\" />\n"; @@ -1618,7 +1619,7 @@ void yafrayFileRender_t::writeLamps() float iview[4][4]; // re->viewinv != inv.re->viewmat because of possible ortho mode (see convertBlenderScene.c) // have to invert it here - MTC_Mat4Invert(iview, re->viewmat); + Mat4Invert(iview, re->viewmat); // all lamps for(go=(GroupObject *)re->lights.first; go; go= go->next, i++) { @@ -1751,9 +1752,9 @@ void yafrayFileRender_t::writeLamps() // transform lamp co & vec back to world float lpco[3], lpvec[3]; MTC_cp3Float(lamp->co, lpco); - MTC_Mat4MulVecfl(iview, lpco); + Mat4MulVecfl(iview, lpco); MTC_cp3Float(lamp->vec, lpvec); - MTC_Mat4Mul3Vecfl(iview, lpvec); + Mat4Mul3Vecfl(iview, lpvec); // position, (==-blendir for sun/hemi) if ((lamp->type==LA_SUN) || (lamp->type==LA_HEMI)) diff --git a/source/blender/yafray/intern/export_Plugin.cpp b/source/blender/yafray/intern/export_Plugin.cpp index db9fb7ccc72..cabb90f44c4 100644 --- a/source/blender/yafray/intern/export_Plugin.cpp +++ b/source/blender/yafray/intern/export_Plugin.cpp @@ -6,6 +6,7 @@ using namespace std; +#define MTC_cp3Float(_a, _b) VecCopyf(_b, _a) #ifdef WIN32 #define WIN32_SKIP_HKEY_PROTECTION @@ -19,7 +20,6 @@ using namespace std; #define FILE_MAXFILE 80 #endif - static string find_path() { HKEY hkey; @@ -939,10 +939,10 @@ void yafrayPluginRender_t::writeMaterialsAndModulators() // In this case this means the inverse of that matrix float texmat[4][4], itexmat[4][4]; if ((mtex->texco & TEXCO_OBJECT) && (mtex->object)) - MTC_Mat4CpyMat4(texmat, mtex->object->obmat); + Mat4CpyMat4(texmat, mtex->object->obmat); else // also for refl. map - MTC_Mat4CpyMat4(texmat, maincam_obj->obmat); - MTC_Mat4Invert(itexmat, texmat); + Mat4CpyMat4(texmat, maincam_obj->obmat); + Mat4Invert(itexmat, texmat); #define flp yafray::parameter_t params["m00"]=flp(itexmat[0][0]); params["m01"]=flp(itexmat[1][0]); params["m02"]=flp(itexmat[2][0]); params["m03"]=flp(itexmat[3][0]); @@ -1231,15 +1231,15 @@ void yafrayPluginRender_t::genVertices(vector<yafray::point3d_t> &verts, int &vi // for deformed objects, object->imat is no longer valid, // so have to create inverse render matrix ourselves here float mat[4][4], imat[4][4]; - MTC_Mat4MulMat4(mat, obj->obmat, re->viewmat); - MTC_Mat4Invert(imat, mat); + Mat4MulMat4(mat, obj->obmat, re->viewmat); + Mat4Invert(imat, mat); if (vert_idx.find(vlr->v1)==vert_idx.end()) { vert_idx[vlr->v1] = vidx++; ver = vlr->v1; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); // has_orco now an int, if 1 -> strand mapping, if 2 -> normal orco mapping if (has_orco==1) @@ -1252,7 +1252,7 @@ void yafrayPluginRender_t::genVertices(vector<yafray::point3d_t> &verts, int &vi vert_idx[vlr->v2] = vidx++; ver = vlr->v2; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); // has_orco now an int, if 1 -> strand mapping, if 2 -> normal orco mapping if (has_orco==1) @@ -1265,7 +1265,7 @@ void yafrayPluginRender_t::genVertices(vector<yafray::point3d_t> &verts, int &vi vert_idx[vlr->v3] = vidx++; ver = vlr->v3; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); // has_orco now an int, if 1 -> strand mapping, if 2 -> normal orco mapping if (has_orco==1) @@ -1278,7 +1278,7 @@ void yafrayPluginRender_t::genVertices(vector<yafray::point3d_t> &verts, int &vi vert_idx[vlr->v4] = vidx++; ver = vlr->v4; MTC_cp3Float(ver->co, tvec); - MTC_Mat4MulVecfl(imat, tvec); + Mat4MulVecfl(imat, tvec); verts.push_back(yafray::point3d_t(tvec[0], tvec[1], tvec[2])); // has_orco now an int, if 1 -> strand mapping, if 2 -> normal orco mapping if (has_orco==1) @@ -1414,7 +1414,7 @@ void yafrayPluginRender_t::writeAllObjects() for (int i=0;i<4;i++) for (int j=0;j<4;j++) obmat[i][j] = dupMtx->second[(i<<2)+j]; - MTC_Mat4Invert(imat, obmat); + Mat4Invert(imat, obmat); // first object written as normal (but with transform of first duplivert) Object* obj = dup_srcob[dupMtx->first]; @@ -1428,7 +1428,7 @@ void yafrayPluginRender_t::writeAllObjects() for (int j=0;j<4;j++) nmat[i][j] = dupMtx->second[curmtx+(i<<2)+j]; - MTC_Mat4MulMat4(cmat, imat, nmat); // transform with respect to original = inverse_original * new + Mat4MulMat4(cmat, imat, nmat); // transform with respect to original = inverse_original * new float mtr[4*4]; mtr[0*4+0]=cmat[0][0]; mtr[0*4+1]=cmat[1][0]; mtr[0*4+2]=cmat[2][0]; mtr[0*4+3]=cmat[3][0]; @@ -1475,13 +1475,13 @@ void yafrayPluginRender_t::writeAreaLamp(LampRen* lamp, int num, float iview[4][ // transform area lamp coords back to world float lpco[4][3]; MTC_cp3Float(a, lpco[0]); - MTC_Mat4MulVecfl(iview, lpco[0]); + Mat4MulVecfl(iview, lpco[0]); MTC_cp3Float(b, lpco[1]); - MTC_Mat4MulVecfl(iview, lpco[1]); + Mat4MulVecfl(iview, lpco[1]); MTC_cp3Float(c, lpco[2]); - MTC_Mat4MulVecfl(iview, lpco[2]); + Mat4MulVecfl(iview, lpco[2]); MTC_cp3Float(d, lpco[3]); - MTC_Mat4MulVecfl(iview, lpco[3]); + Mat4MulVecfl(iview, lpco[3]); params["a"] = yafray::parameter_t(yafray::point3d_t(lpco[0][0], lpco[0][1], lpco[0][2])); params["b"] = yafray::parameter_t(yafray::point3d_t(lpco[1][0], lpco[1][1], lpco[1][2])); params["c"] = yafray::parameter_t(yafray::point3d_t(lpco[2][0], lpco[2][1], lpco[2][2])); @@ -1500,7 +1500,7 @@ void yafrayPluginRender_t::writeLamps() float iview[4][4]; // re->viewinv != inv.re->viewmat because of possible ortho mode (see convertBlenderScene.c) // have to invert it here - MTC_Mat4Invert(iview, re->viewmat); + Mat4Invert(iview, re->viewmat); // all lamps for(go=(GroupObject *)re->lights.first; go; go= go->next, i++) @@ -1641,9 +1641,9 @@ void yafrayPluginRender_t::writeLamps() // transform lamp co & vec back to world float lpco[3], lpvec[3]; MTC_cp3Float(lamp->co, lpco); - MTC_Mat4MulVecfl(iview, lpco); + Mat4MulVecfl(iview, lpco); MTC_cp3Float(lamp->vec, lpvec); - MTC_Mat4Mul3Vecfl(iview, lpvec); + Mat4Mul3Vecfl(iview, lpvec); // position, (==-blendir for sun/hemi) if ((lamp->type==LA_SUN) || (lamp->type==LA_HEMI)) diff --git a/source/blender/yafray/intern/yafray_Render.cpp b/source/blender/yafray/intern/yafray_Render.cpp index 01da4683d71..97a3f3b518a 100644 --- a/source/blender/yafray/intern/yafray_Render.cpp +++ b/source/blender/yafray/intern/yafray_Render.cpp @@ -85,7 +85,7 @@ bool yafrayRender_t::getAllMatTexObs() if(obi->flag & R_DUPLI_TRANSFORMED) { // compute object matrix with dupli transform, need to transform // obi->mat out of view space for it - MTC_Mat4MulSerie(mat, re->viewinv, obi->mat, re->viewmat, obi->obr->ob->obmat, 0, 0, 0, 0); + Mat4MulSerie(mat, re->viewinv, obi->mat, re->viewmat, obi->obr->ob->obmat, 0, 0, 0, 0); addDupliMtx(obi->obr->ob, mat); } } diff --git a/source/blender/yafray/intern/yafray_Render.h b/source/blender/yafray/intern/yafray_Render.h index 43d2c6c602a..b3ab12e8ae9 100644 --- a/source/blender/yafray/intern/yafray_Render.h +++ b/source/blender/yafray/intern/yafray_Render.h @@ -29,8 +29,7 @@ extern "C" { #include "renderpipeline.h" /* useful matrix & vector operations */ -#include "MTC_matrixops.h" -#include "MTC_vectorops.h" +#include "BLI_arithb.h" #include "BLI_blenlib.h" |