1 /******************************************************************************* 2 * matrices.h 3 * 4 * This module contains all defines, typedefs, and prototypes for MATRICES.CPP. 5 * 6 * --------------------------------------------------------------------------- 7 * Persistence of Vision Ray Tracer ('POV-Ray') version 3.7. 8 * Copyright 1991-2013 Persistence of Vision Raytracer Pty. Ltd. 9 * 10 * POV-Ray is free software: you can redistribute it and/or modify 11 * it under the terms of the GNU Affero General Public License as 12 * published by the Free Software Foundation, either version 3 of the 13 * License, or (at your option) any later version. 14 * 15 * POV-Ray is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Affero General Public License for more details. 19 * 20 * You should have received a copy of the GNU Affero General Public License 21 * along with this program. If not, see <http://www.gnu.org/licenses/>. 22 * --------------------------------------------------------------------------- 23 * POV-Ray is based on the popular DKB raytracer version 2.12. 24 * DKBTrace was originally written by David K. Buck. 25 * DKBTrace Ver 2.0-2.12 were written by David K. Buck & Aaron A. Collins. 26 * --------------------------------------------------------------------------- 27 * $File: //depot/public/povray/3.x/source/backend/math/matrices.h $ 28 * $Revision: #1 $ 29 * $Change: 6069 $ 30 * $DateTime: 2013/11/06 11:59:40 $ 31 * $Author: chrisc $ 32 *******************************************************************************/ 33 34 #ifndef MATRICES_H 35 #define MATRICES_H 36 37 namespace pov 38 { 39 40 /***************************************************************************** 41 * Global preprocessor defines 42 ******************************************************************************/ 43 44 45 46 47 /***************************************************************************** 48 * Global typedefs 49 ******************************************************************************/ 50 51 52 53 54 /***************************************************************************** 55 * Global variables 56 ******************************************************************************/ 57 58 59 60 61 /***************************************************************************** 62 * Global functions 63 ******************************************************************************/ 64 65 void MZero (MATRIX result); 66 void MIdentity (MATRIX result); 67 void MTimesA (MATRIX result, const MATRIX matrix2); 68 void MTimesB (const MATRIX matrix1, MATRIX result); 69 void MTimesC (MATRIX result, const MATRIX matrix1, const MATRIX matrix2); 70 void MAdd (MATRIX result, const MATRIX matrix1, const MATRIX matrix2); 71 void MSub (MATRIX result, const MATRIX matrix1, const MATRIX matrix2); 72 void MScale (MATRIX result, const MATRIX matrix1, DBL amount); 73 void MTranspose (MATRIX result); 74 void MTranspose (MATRIX result, const MATRIX matrix1); 75 void MTransPoint (VECTOR result, const VECTOR vector, const TRANSFORM *trans); 76 void MInvTransPoint (VECTOR result, const VECTOR vector, const TRANSFORM *trans); 77 void MTransDirection (VECTOR result, const VECTOR vector, const TRANSFORM *trans); 78 void MInvTransDirection (VECTOR result, const VECTOR vector, const TRANSFORM *trans); 79 void MTransNormal (VECTOR result, const VECTOR vector, const TRANSFORM *trans); 80 void MInvTransNormal (VECTOR result, const VECTOR vector, const TRANSFORM *trans); 81 void Compute_Matrix_Transform (TRANSFORM *result, const MATRIX matrix); 82 void Compute_Scaling_Transform (TRANSFORM *result, const VECTOR vector); 83 void Compute_Inversion_Transform (TRANSFORM *result); 84 void Compute_Translation_Transform (TRANSFORM *transform, const VECTOR vector); 85 void Compute_Rotation_Transform (TRANSFORM *transform, const VECTOR vector); 86 void Compute_Look_At_Transform (TRANSFORM *transform, const VECTOR Look_At, const VECTOR Up, const VECTOR Right); 87 void Compose_Transforms (TRANSFORM *transform, const TRANSFORM *Additional_Transform); 88 void Compute_Axis_Rotation_Transform (TRANSFORM *transform, const VECTOR AxisVect, DBL angle); 89 void Compute_Coordinate_Transform (TRANSFORM *trans, const VECTOR origin, VECTOR up, DBL r, DBL len); 90 TRANSFORM *Create_Transform (void); 91 TRANSFORM *Copy_Transform (const TRANSFORM *Old); 92 void Destroy_Transform (TRANSFORM *Trans); 93 UV_VECT *Create_UV_Vect (void); 94 VECTOR *Create_Vector (void); 95 VECTOR_4D *Create_Vector_4D (void); 96 DBL *Create_Float (void); 97 void MInvers (MATRIX r, const MATRIX m); 98 int MInvers3(const VECTOR inM[3], VECTOR outM[3]); 99 void MTransUVPoint(const DBL p[2], const DBL m[3][3], DBL t[2]); 100 void MSquareQuad(const UV_VECT st[4], DBL sq[3][3]); 101 102 } 103 104 #endif 105