Add rayman2 source files
This commit is contained in:
428
Rayman_X/cpa/public/MTH/Specif/Mat/Msl12_3D.h
Normal file
428
Rayman_X/cpa/public/MTH/Specif/Mat/Msl12_3D.h
Normal file
@@ -0,0 +1,428 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : Msl12_3D.h
|
||||
MODULE : sl12 (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Matrix implementation
|
||||
|
||||
VERSION : sl12 V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
#ifndef __MATRICES_SL12_3D__
|
||||
#define __MATRICES_SL12_3D__
|
||||
|
||||
/* ##TYPEDEF#----------------------------------------------------------------------------
|
||||
Types definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------27/04/98 16:23-------------------
|
||||
* Conversion : OK avec version 23.04.98 19:26 (44803)
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#define sl12_3D_tdstMatrix MTH3D_tdstMatrix
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/*+ ##-######################################
|
||||
## MACRO AND FUNCTION FOR 3D MATHEMATICS
|
||||
######################################### */
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## Matrix operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vCopyMatrix
|
||||
DESCRIPTION : Copy MatA in MatDest
|
||||
INPUT : MatDest, MatA: address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vCopyMatrix( MatDest, MatA) MTH3D_M_vCopyMatrix( MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vAddMatrix
|
||||
DESCRIPTION : Add two matrix : MatDest= MatA + MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vAddMatrix( MatDest, MatA, MatB) MTH3D_M_vAddMatrix( MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSubMatrix
|
||||
DESCRIPTION : Sub two matrix : MatDest= MatA - MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSubMatrix( MatDest, MatA, MatB) MTH3D_M_vSubMatrix( MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vNegMatrix
|
||||
DESCRIPTION : Make the Nagation of a matrix : MatDest= -MatA
|
||||
INPUT : MatDest, MatA: address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vNegMatrix( MatDest, MatA) MTH3D_M_vNegMatrix( MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMulMatrixMatrixWithoutBuffer
|
||||
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB, MatDest must be a other matrix
|
||||
INPUT : MatDest, MatA, MatB: address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
|
||||
MTH3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMulMatrixMatrix
|
||||
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
|
||||
MTH3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMulTranspMatrixMatrixWithoutBuffer
|
||||
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
|
||||
MatDest must be a other matrix
|
||||
INPUT : MatDest, MatA, MatB: address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
|
||||
MTH3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMulTranspMatrixMatrix
|
||||
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
|
||||
INPUT : MatDest, MatA, MatB: address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
|
||||
MTH3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMulScalarMatrix
|
||||
DESCRIPTION : Multiply a scalar with a matrix : MatDest= a*MatA
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
a: SCA_td_sl12, MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sl12_3D_M_vMulScalarMatrix(MatDest, a, MatA) \
|
||||
MTH3D_M_vMulScalarMatrix(MatDest, a, MatA)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vDivScalarMatrix
|
||||
DESCRIPTION : Divide a matrix by a scalar : MatDest= MatA/a
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
MatA : address of sl12_3D_tdstMatrix, a: SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sl12_3D_M_vDivScalarMatrix(MatDest, MatA, a) \
|
||||
MTH3D_M_vDivScalarMatrix(MatDest, MatA, a)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSqrMatrix
|
||||
DESCRIPTION : Square a matrix : MatDest= MatA*MatA
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSqrMatrix(MatDest, MatA) MTH3D_M_vSqrMatrix(MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vTranspMatrixWithoutBuffer
|
||||
DESCRIPTION : Transpose a matrix : MatDest= transp MatA, Matdest must be a other matrix
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA) \
|
||||
MTH3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA)
|
||||
|
||||
|
||||
/* sl12_3D_M_vTranpMatrixWithoutBuffer(MatDest, MatA) : MatDest= transp MatA */
|
||||
#define sl12_3D_M_vTranpMatrixWithoutBuffer sl12_3D_M_vTranspMatrixWithoutBuffer
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vTranspMatrix
|
||||
DESCRIPTION : Transpose a matrix : MatDest= transp MatA
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vTranspMatrix(Mat_Dest, Mat_A) MTH3D_M_vTranspMatrix(Mat_Dest, Mat_A)
|
||||
|
||||
/* sl12_3D_M_vTranpMatrix(MatDest, MatA) : MatDest= transp MatA */
|
||||
#define sl12_3D_M_vTranpMatrix sl12_3D_M_vTranspMatrix
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xTraceMatrix
|
||||
DESCRIPTION : Return the trace of a matrix
|
||||
INPUT : MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : trace MatA : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xTraceMatrix(MatA) MTH3D_M_xTraceMatrix(MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetIdentityMatrix
|
||||
DESCRIPTION : Set a matrix to the Identity matrix : MatDest= Id
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetIdentityMatrix(MatDest) MTH3D_M_vSetIdentityMatrix(MatDest)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_bEqualMatrix
|
||||
DESCRIPTION : Test if two matrix are equal
|
||||
INPUT : MatA, MatB : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : MatA==MatB : Boolean
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_bEqualMatrix(MatA, MatB) MTH3D_M_bEqualMatrix(MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_bMatchMatrix
|
||||
DESCRIPTION : Test if two matrix are neary equal
|
||||
INPUT : MatA, MatB : address of sl12_3D_tdstMatrix
|
||||
eps : SCA_td_sl12
|
||||
OUTPUT : (MatA match MatB to within about eps) : Boolean
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sl12_3D_M_bMatchMatrix(MatA, MatB, eps) MTH3D_M_bMatchMatrix(MatA, MatB, eps)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vFillMatrix
|
||||
DESCRIPTION : Fill each matrix element with "a" value
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
a : SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vFillMatrix(MatDest, a) MTH3D_M_vFillMatrix(MatDest, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xDetMatrix
|
||||
DESCRIPTION : Return the determinant of a matrix
|
||||
INPUT : MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : det MatA : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xDetMatrix(MatA) MTH3D_M_xDetMatrix(MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vComMatrixWithoutBuffer
|
||||
DESCRIPTION : Calculate the Cofactor Matrix of a matrix : MatDest= Cofactor Matrix of MatA
|
||||
INPUT : Matdest, MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
|
||||
MTH3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vInverMatrix
|
||||
DESCRIPTION : Invert a matrix : MatDest= Inv MatA
|
||||
INPUT : Matdest, MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vInverMatrix(MatDest, MatA) MTH3D_M_vInverMatrix(MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetMatrixColumnElements
|
||||
DESCRIPTION : Get x, y, z column col values in MatA
|
||||
INPUT : x, y, z : SCA_td_sl12
|
||||
col : int
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA) \
|
||||
MTH3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetMatrixColumnElements
|
||||
DESCRIPTION : Set column col x, y, z values in MatDest
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
x, y, z : SCA_td_sl12
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col) \
|
||||
MTH3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xGetMatrixElement
|
||||
DESCRIPTION : Return element at (lin, col) in MatASet
|
||||
INPUT : MatA : address of sl12_3D_tdstMatrix
|
||||
lin, col : int
|
||||
OUTPUT : a : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xGetMatrixElement( lin, col, MatA) MTH3D_M_xGetMatrixElement( lin, col, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetMatrixElement
|
||||
DESCRIPTION : Set a element in MatDest at (lin, col)
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
a : SCA_td_sl12
|
||||
lin, col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetMatrixElement( MatDest, a, lin, col) MTH3D_M_vSetMatrixElement( MatDest, a, lin, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetMatrixCol0Elements
|
||||
DESCRIPTION : Set x, y, z values of column 0 in MatDest
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetMatrixCol1Elements
|
||||
DESCRIPTION : Set x, y, z values of column 1 in MatDest
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetMatrixCol2Elements
|
||||
DESCRIPTION : Set x, y, z values of column 2 in MatDest
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetMatrixLineXElements
|
||||
DESCRIPTION : Set x elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetMatrixLineYElements
|
||||
DESCRIPTION : Set y elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetMatrixLineZElements
|
||||
DESCRIPTION : Set z elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetMatrixCol0Elements
|
||||
DESCRIPTION : Get x, y, z values of column 0 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sl12
|
||||
INPUT : MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetMatrixCol1Elements
|
||||
DESCRIPTION : Get x, y, z values of column 1 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sl12
|
||||
INPUT : MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetMatrixCol2Elements
|
||||
DESCRIPTION : Get x, y, z values of column 2 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sl12
|
||||
INPUT : MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetMatrixLineXElements
|
||||
DESCRIPTION : Get x elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sl12
|
||||
INPUT : MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetMatrixLineYElements
|
||||
DESCRIPTION : Get y elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sl12
|
||||
INPUT : MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetMatrixLineZElements
|
||||
DESCRIPTION : Get z elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sl12
|
||||
INPUT : MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vPrintfVector
|
||||
DESCRIPTION : Print a Vector : Name + its values
|
||||
INPUT : Name : string
|
||||
VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
__inline void Pf2_sl12(td_sl12 _xValue)
|
||||
{
|
||||
printf( " %e",_xValue );
|
||||
}
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vPrintfMatrix
|
||||
DESCRIPTION : Print a Matrix : Name + its values
|
||||
INPUT : Name : string
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
|
||||
__inline void sl12_3D_fn_vPrintfMatrix( char * Name, sl12_3D_tdstMatrix * MatA) \
|
||||
{
|
||||
MTH3D_M_vPrintfMatrix( Name, MatA );
|
||||
}
|
||||
|
||||
#define sl12_3D_M_vPrintfMatrix( Name, MatA) sl12_3D_fn_vPrintfMatrix( Name, MatA)
|
||||
|
||||
#endif /* __MATRICES_SL12_3D__ */
|
427
Rayman_X/cpa/public/MTH/Specif/Mat/Msl_3D.h
Normal file
427
Rayman_X/cpa/public/MTH/Specif/Mat/Msl_3D.h
Normal file
@@ -0,0 +1,427 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : Msl_3D.h
|
||||
MODULE : sl (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Matrix implementation
|
||||
|
||||
VERSION : sl V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
#ifndef __MATRICES_SL_3D__
|
||||
#define __MATRICES_SL_3D__
|
||||
|
||||
/* ##TYPEDEF#----------------------------------------------------------------------------
|
||||
Types definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------27/04/98 16:23-------------------
|
||||
* Conversion : OK avec version 23.04.98 19:26 (43819)
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#define sl_3D_tdstMatrix MTH3D_tdstMatrix
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/*+ ##-######################################
|
||||
## MACRO AND FUNCTION FOR 3D MATHEMATICS
|
||||
######################################### */
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## Matrix operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vCopyMatrix
|
||||
DESCRIPTION : Copy MatA in MatDest
|
||||
INPUT : MatDest, MatA: address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vCopyMatrix( MatDest, MatA) MTH3D_M_vCopyMatrix( MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vAddMatrix
|
||||
DESCRIPTION : Add two matrix : MatDest= MatA + MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vAddMatrix( MatDest, MatA, MatB) MTH3D_M_vAddMatrix( MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSubMatrix
|
||||
DESCRIPTION : Sub two matrix : MatDest= MatA - MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSubMatrix( MatDest, MatA, MatB) MTH3D_M_vSubMatrix( MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vNegMatrix
|
||||
DESCRIPTION : Make the Nagation of a matrix : MatDest= -MatA
|
||||
INPUT : MatDest, MatA: address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vNegMatrix( MatDest, MatA) MTH3D_M_vNegMatrix( MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMulMatrixMatrixWithoutBuffer
|
||||
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB, MatDest must be a other matrix
|
||||
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
|
||||
MTH3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMulMatrixMatrix
|
||||
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
|
||||
MTH3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMulTranspMatrixMatrixWithoutBuffer
|
||||
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
|
||||
MatDest must be a other matrix
|
||||
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
|
||||
MTH3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMulTranspMatrixMatrix
|
||||
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
|
||||
INPUT : MatDest, MatA, MatB: address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
|
||||
MTH3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMulScalarMatrix
|
||||
DESCRIPTION : Multiply a scalar with a matrix : MatDest= a*MatA
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
a: SCA_td_sl, MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sl_3D_M_vMulScalarMatrix(MatDest, a, MatA) \
|
||||
MTH3D_M_vMulScalarMatrix(MatDest, a, MatA)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vDivScalarMatrix
|
||||
DESCRIPTION : Divide a matrix by a scalar : MatDest= MatA/a
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
MatA : address of sl_3D_tdstMatrix, a: SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sl_3D_M_vDivScalarMatrix(MatDest, MatA, a) \
|
||||
MTH3D_M_vDivScalarMatrix(MatDest, MatA, a)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSqrMatrix
|
||||
DESCRIPTION : Square a matrix : MatDest= MatA*MatA
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSqrMatrix(MatDest, MatA) MTH3D_M_vSqrMatrix(MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vTranspMatrixWithoutBuffer
|
||||
DESCRIPTION : Transpose a matrix : MatDest= transp MatA, Matdest must be a other matrix
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA) \
|
||||
MTH3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA)
|
||||
|
||||
|
||||
/* sl_3D_M_vTranpMatrixWithoutBuffer(MatDest, MatA) : MatDest= transp MatA */
|
||||
#define sl_3D_M_vTranpMatrixWithoutBuffer sl_3D_M_vTranspMatrixWithoutBuffer
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vTranspMatrix
|
||||
DESCRIPTION : Transpose a matrix : MatDest= transp MatA
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vTranspMatrix(Mat_Dest, Mat_A) MTH3D_M_vTranspMatrix(Mat_Dest, Mat_A)
|
||||
|
||||
/* sl_3D_M_vTranpMatrix(MatDest, MatA) : MatDest= transp MatA */
|
||||
#define sl_3D_M_vTranpMatrix sl_3D_M_vTranspMatrix
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xTraceMatrix
|
||||
DESCRIPTION : Return the trace of a matrix
|
||||
INPUT : MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : trace MatA : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xTraceMatrix(MatA) MTH3D_M_xTraceMatrix(MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetIdentityMatrix
|
||||
DESCRIPTION : Set a matrix to the Identity matrix : MatDest= Id
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetIdentityMatrix(MatDest) MTH3D_M_vSetIdentityMatrix(MatDest)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_bEqualMatrix
|
||||
DESCRIPTION : Test if two matrix are equal
|
||||
INPUT : MatA, MatB : address of sl_3D_tdstMatrix
|
||||
OUTPUT : MatA==MatB : Boolean
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_bEqualMatrix(MatA, MatB) MTH3D_M_bEqualMatrix(MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_bMatchMatrix
|
||||
DESCRIPTION : Test if two matrix are neary equal
|
||||
INPUT : MatA, MatB : address of sl_3D_tdstMatrix
|
||||
eps : SCA_td_sl
|
||||
OUTPUT : (MatA match MatB to within about eps) : Boolean
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sl_3D_M_bMatchMatrix(MatA, MatB, eps) MTH3D_M_bMatchMatrix(MatA, MatB, eps)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vFillMatrix
|
||||
DESCRIPTION : Fill each matrix element with "a" value
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
a : SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vFillMatrix(MatDest, a) MTH3D_M_vFillMatrix(MatDest, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xDetMatrix
|
||||
DESCRIPTION : Return the determinant of a matrix
|
||||
INPUT : MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : det MatA : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xDetMatrix(MatA) MTH3D_M_xDetMatrix(MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vComMatrixWithoutBuffer
|
||||
DESCRIPTION : Calculate the Cofactor Matrix of a matrix : MatDest= Cofactor Matrix of MatA
|
||||
INPUT : Matdest, MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
|
||||
MTH3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vInverMatrix
|
||||
DESCRIPTION : Invert a matrix : MatDest= Inv MatA
|
||||
INPUT : Matdest, MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vInverMatrix(MatDest, MatA) MTH3D_M_vInverMatrix(MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetMatrixColumnElements
|
||||
DESCRIPTION : Get x, y, z column col values in MatA
|
||||
INPUT : x, y, z : SCA_td_sl
|
||||
col : int
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA) \
|
||||
MTH3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetMatrixColumnElements
|
||||
DESCRIPTION : Set column col x, y, z values in MatDest
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
x, y, z : SCA_td_sl
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col) \
|
||||
MTH3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xGetMatrixElement
|
||||
DESCRIPTION : Return element at (lin, col) in MatASet
|
||||
INPUT : MatA : address of sl_3D_tdstMatrix
|
||||
lin, col : int
|
||||
OUTPUT : a : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xGetMatrixElement( lin, col, MatA) MTH3D_M_xGetMatrixElement( lin, col, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetMatrixElement
|
||||
DESCRIPTION : Set a element in MatDest at (lin, col)
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
a : SCA_td_sl
|
||||
lin, col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetMatrixElement( MatDest, a, lin, col) MTH3D_M_vSetMatrixElement( MatDest, a, lin, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetMatrixCol0Elements
|
||||
DESCRIPTION : Set x, y, z values of column 0 in MatDest
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetMatrixCol1Elements
|
||||
DESCRIPTION : Set x, y, z values of column 1 in MatDest
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetMatrixCol2Elements
|
||||
DESCRIPTION : Set x, y, z values of column 2 in MatDest
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetMatrixLineXElements
|
||||
DESCRIPTION : Set x elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetMatrixLineYElements
|
||||
DESCRIPTION : Set y elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetMatrixLineZElements
|
||||
DESCRIPTION : Set z elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetMatrixCol0Elements
|
||||
DESCRIPTION : Get x, y, z values of column 0 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sl
|
||||
INPUT : MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetMatrixCol1Elements
|
||||
DESCRIPTION : Get x, y, z values of column 1 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sl
|
||||
INPUT : MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetMatrixCol2Elements
|
||||
DESCRIPTION : Get x, y, z values of column 2 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sl
|
||||
INPUT : MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetMatrixLineXElements
|
||||
DESCRIPTION : Get x elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sl
|
||||
INPUT : MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetMatrixLineYElements
|
||||
DESCRIPTION : Get y elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sl
|
||||
INPUT : MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetMatrixLineZElements
|
||||
DESCRIPTION : Get z elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sl
|
||||
INPUT : MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vPrintfVector
|
||||
DESCRIPTION : Print a Vector : Name + its values
|
||||
INPUT : Name : string
|
||||
VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
__inline void Pf2_sl(td_sl _xValue)
|
||||
{
|
||||
printf( " %e",_xValue );
|
||||
}
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vPrintfMatrix
|
||||
DESCRIPTION : Print a Matrix : Name + its values
|
||||
INPUT : Name : string
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
|
||||
__inline sl_3D_fn_vPrintfMatrix( char * Name, sl_3D_tdstMatrix * MatA) \
|
||||
{
|
||||
MTH3D_M_vPrintfMatrix( Name, MatA );
|
||||
}
|
||||
|
||||
#define sl_3D_M_vPrintfMatrix( Name, MatA) sl_3D_fn_vPrintfMatrix( Name, MatA)
|
||||
|
||||
#endif /* __MATRICES_SL_3D__ */
|
427
Rayman_X/cpa/public/MTH/Specif/Mat/Msw12_3D.h
Normal file
427
Rayman_X/cpa/public/MTH/Specif/Mat/Msw12_3D.h
Normal file
@@ -0,0 +1,427 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : Msw12_3D.h
|
||||
MODULE : sw12 (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Matrix implementation
|
||||
|
||||
VERSION : sw12 V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
#ifndef __MATRICES_SW12_3D__
|
||||
#define __MATRICES_SW12_3D__
|
||||
|
||||
/* ##TYPEDEF#----------------------------------------------------------------------------
|
||||
Types definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------27/04/98 16:23-------------------
|
||||
* Conversion : OK avec version 24.04.98 16:46 (44694)
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#define sw12_3D_tdstMatrix MTH3D_tdstMatrix
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/*+ ##-######################################
|
||||
## MACRO AND FUNCTION FOR 3D MATHEMATICS
|
||||
######################################### */
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## Matrix operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vCopyMatrix
|
||||
DESCRIPTION : Copy MatA in MatDest
|
||||
INPUT : MatDest, MatA: address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vCopyMatrix( MatDest, MatA) MTH3D_M_vCopyMatrix( MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vAddMatrix
|
||||
DESCRIPTION : Add two matrix : MatDest= MatA + MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vAddMatrix( MatDest, MatA, MatB) MTH3D_M_vAddMatrix( MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSubMatrix
|
||||
DESCRIPTION : Sub two matrix : MatDest= MatA - MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSubMatrix( MatDest, MatA, MatB) MTH3D_M_vSubMatrix( MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vNegMatrix
|
||||
DESCRIPTION : Make the Nagation of a matrix : MatDest= -MatA
|
||||
INPUT : MatDest, MatA: address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vNegMatrix( MatDest, MatA) MTH3D_M_vNegMatrix( MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMulMatrixMatrixWithoutBuffer
|
||||
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB, MatDest must be a other matrix
|
||||
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
|
||||
MTH3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMulMatrixMatrix
|
||||
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
|
||||
MTH3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMulTranspMatrixMatrixWithoutBuffer
|
||||
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
|
||||
MatDest must be a other matrix
|
||||
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
|
||||
MTH3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMulTranspMatrixMatrix
|
||||
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
|
||||
INPUT : MatDest, MatA, MatB: address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
|
||||
MTH3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMulScalarMatrix
|
||||
DESCRIPTION : Multiply a scalar with a matrix : MatDest= a*MatA
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
a: SCA_td_sw12, MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sw12_3D_M_vMulScalarMatrix(MatDest, a, MatA) \
|
||||
MTH3D_M_vMulScalarMatrix(MatDest, a, MatA)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vDivScalarMatrix
|
||||
DESCRIPTION : Divide a matrix by a scalar : MatDest= MatA/a
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
MatA : address of sw12_3D_tdstMatrix, a: SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sw12_3D_M_vDivScalarMatrix(MatDest, MatA, a) \
|
||||
MTH3D_M_vDivScalarMatrix(MatDest, MatA, a)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSqrMatrix
|
||||
DESCRIPTION : Square a matrix : MatDest= MatA*MatA
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSqrMatrix(MatDest, MatA) MTH3D_M_vSqrMatrix(MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vTranspMatrixWithoutBuffer
|
||||
DESCRIPTION : Transpose a matrix : MatDest= transp MatA, Matdest must be a other matrix
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA) \
|
||||
MTH3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA)
|
||||
|
||||
|
||||
/* sw12_3D_M_vTranpMatrixWithoutBuffer(MatDest, MatA) : MatDest= transp MatA */
|
||||
#define sw12_3D_M_vTranpMatrixWithoutBuffer sw12_3D_M_vTranspMatrixWithoutBuffer
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vTranspMatrix
|
||||
DESCRIPTION : Transpose a matrix : MatDest= transp MatA
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vTranspMatrix(Mat_Dest, Mat_A) MTH3D_M_vTranspMatrix(Mat_Dest, Mat_A)
|
||||
|
||||
/* sw12_3D_M_vTranpMatrix(MatDest, MatA) : MatDest= transp MatA */
|
||||
#define sw12_3D_M_vTranpMatrix sw12_3D_M_vTranspMatrix
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xTraceMatrix
|
||||
DESCRIPTION : Return the trace of a matrix
|
||||
INPUT : MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : trace MatA : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xTraceMatrix(MatA) MTH3D_M_xTraceMatrix(MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetIdentityMatrix
|
||||
DESCRIPTION : Set a matrix to the Identity matrix : MatDest= Id
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetIdentityMatrix(MatDest) MTH3D_M_vSetIdentityMatrix(MatDest)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_bEqualMatrix
|
||||
DESCRIPTION : Test if two matrix are equal
|
||||
INPUT : MatA, MatB : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : MatA==MatB : Boolean
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_bEqualMatrix(MatA, MatB) MTH3D_M_bEqualMatrix(MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_bMatchMatrix
|
||||
DESCRIPTION : Test if two matrix are neary equal
|
||||
INPUT : MatA, MatB : address of sw12_3D_tdstMatrix
|
||||
eps : SCA_td_sw12
|
||||
OUTPUT : (MatA match MatB to within about eps) : Boolean
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sw12_3D_M_bMatchMatrix(MatA, MatB, eps) MTH3D_M_bMatchMatrix(MatA, MatB, eps)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vFillMatrix
|
||||
DESCRIPTION : Fill each matrix element with "a" value
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
a : SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vFillMatrix(MatDest, a) MTH3D_M_vFillMatrix(MatDest, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xDetMatrix
|
||||
DESCRIPTION : Return the determinant of a matrix
|
||||
INPUT : MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : det MatA : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xDetMatrix(MatA) MTH3D_M_xDetMatrix(MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vComMatrixWithoutBuffer
|
||||
DESCRIPTION : Calculate the Cofactor Matrix of a matrix : MatDest= Cofactor Matrix of MatA
|
||||
INPUT : Matdest, MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
|
||||
MTH3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vInverMatrix
|
||||
DESCRIPTION : Invert a matrix : MatDest= Inv MatA
|
||||
INPUT : Matdest, MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vInverMatrix(MatDest, MatA) MTH3D_M_vInverMatrix(MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetMatrixColumnElements
|
||||
DESCRIPTION : Get x, y, z column col values in MatA
|
||||
INPUT : x, y, z : SCA_td_sw12
|
||||
col : int
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA) \
|
||||
MTH3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetMatrixColumnElements
|
||||
DESCRIPTION : Set column col x, y, z values in MatDest
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
x, y, z : SCA_td_sw12
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col) \
|
||||
MTH3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xGetMatrixElement
|
||||
DESCRIPTION : Return element at (lin, col) in MatASet
|
||||
INPUT : MatA : address of sw12_3D_tdstMatrix
|
||||
lin, col : int
|
||||
OUTPUT : a : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xGetMatrixElement( lin, col, MatA) MTH3D_M_xGetMatrixElement( lin, col, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetMatrixElement
|
||||
DESCRIPTION : Set a element in MatDest at (lin, col)
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
a : SCA_td_sw12
|
||||
lin, col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetMatrixElement( MatDest, a, lin, col) MTH3D_M_vSetMatrixElement( MatDest, a, lin, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetMatrixCol0Elements
|
||||
DESCRIPTION : Set x, y, z values of column 0 in MatDest
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetMatrixCol1Elements
|
||||
DESCRIPTION : Set x, y, z values of column 1 in MatDest
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetMatrixCol2Elements
|
||||
DESCRIPTION : Set x, y, z values of column 2 in MatDest
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetMatrixLineXElements
|
||||
DESCRIPTION : Set x elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetMatrixLineYElements
|
||||
DESCRIPTION : Set y elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetMatrixLineZElements
|
||||
DESCRIPTION : Set z elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetMatrixCol0Elements
|
||||
DESCRIPTION : Get x, y, z values of column 0 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sw12
|
||||
INPUT : MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetMatrixCol1Elements
|
||||
DESCRIPTION : Get x, y, z values of column 1 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sw12
|
||||
INPUT : MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetMatrixCol2Elements
|
||||
DESCRIPTION : Get x, y, z values of column 2 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sw12
|
||||
INPUT : MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetMatrixLineXElements
|
||||
DESCRIPTION : Get x elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sw12
|
||||
INPUT : MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetMatrixLineYElements
|
||||
DESCRIPTION : Get y elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sw12
|
||||
INPUT : MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetMatrixLineZElements
|
||||
DESCRIPTION : Get z elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sw12
|
||||
INPUT : MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vPrintfVector
|
||||
DESCRIPTION : Print a Vector : Name + its values
|
||||
INPUT : Name : string
|
||||
VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
__inline void Pf2_sw12(td_sw12 _xValue)
|
||||
{
|
||||
printf( " %e",_xValue );
|
||||
}
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vPrintfMatrix
|
||||
DESCRIPTION : Print a Matrix : Name + its values
|
||||
INPUT : Name : string
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
|
||||
__inline void sw12_3D_fn_vPrintfMatrix( char * Name, sw12_3D_tdstMatrix * MatA) \
|
||||
{
|
||||
MTH3D_M_vPrintfMatrix( Name, MatA );
|
||||
}
|
||||
|
||||
#define sw12_3D_M_vPrintfMatrix( Name, MatA) sw12_3D_fn_vPrintfMatrix( Name, MatA)
|
||||
|
||||
#endif /* __MATRICES_SW12_3D__ */
|
427
Rayman_X/cpa/public/MTH/Specif/Mat/Msw_3D.h
Normal file
427
Rayman_X/cpa/public/MTH/Specif/Mat/Msw_3D.h
Normal file
@@ -0,0 +1,427 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : Msw_3D.h
|
||||
MODULE : sw (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Matrix implementation
|
||||
|
||||
VERSION : sw V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
#ifndef __MATRICES_SW_3D__
|
||||
#define __MATRICES_SW_3D__
|
||||
|
||||
/* ##TYPEDEF#----------------------------------------------------------------------------
|
||||
Types definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------27/04/98 16:23-------------------
|
||||
* Conversion : OK avec version 23.04.98 19:26 (44640)
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#define sw_3D_tdstMatrix MTH3D_tdstMatrix
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/*+ ##-######################################
|
||||
## MACRO AND FUNCTION FOR 3D MATHEMATICS
|
||||
######################################### */
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## Matrix operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vCopyMatrix
|
||||
DESCRIPTION : Copy MatA in MatDest
|
||||
INPUT : MatDest, MatA: address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vCopyMatrix( MatDest, MatA) MTH3D_M_vCopyMatrix( MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vAddMatrix
|
||||
DESCRIPTION : Add two matrix : MatDest= MatA + MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vAddMatrix( MatDest, MatA, MatB) MTH3D_M_vAddMatrix( MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSubMatrix
|
||||
DESCRIPTION : Sub two matrix : MatDest= MatA - MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSubMatrix( MatDest, MatA, MatB) MTH3D_M_vSubMatrix( MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vNegMatrix
|
||||
DESCRIPTION : Make the Nagation of a matrix : MatDest= -MatA
|
||||
INPUT : MatDest, MatA: address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vNegMatrix( MatDest, MatA) MTH3D_M_vNegMatrix( MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMulMatrixMatrixWithoutBuffer
|
||||
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB, MatDest must be a other matrix
|
||||
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
|
||||
MTH3D_M_vMulMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMulMatrixMatrix
|
||||
DESCRIPTION : Multiply two matrix : MatDest= MatA*MatB
|
||||
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
|
||||
MTH3D_M_vMulMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMulTranspMatrixMatrixWithoutBuffer
|
||||
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
|
||||
MatDest must be a other matrix
|
||||
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB) \
|
||||
MTH3D_M_vMulTranspMatrixMatrixWithoutBuffer(MatDest, MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMulTranspMatrixMatrix
|
||||
DESCRIPTION : Multiply the transposed matrix to a other: MatDest= (transp MatA)*MatB,
|
||||
INPUT : MatDest, MatA, MatB: address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B) \
|
||||
MTH3D_M_vMulTranspMatrixMatrix(Mat_Dest, Mat_A, Mat_B)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMulScalarMatrix
|
||||
DESCRIPTION : Multiply a scalar with a matrix : MatDest= a*MatA
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
a: SCA_td_sw, MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sw_3D_M_vMulScalarMatrix(MatDest, a, MatA) \
|
||||
MTH3D_M_vMulScalarMatrix(MatDest, a, MatA)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vDivScalarMatrix
|
||||
DESCRIPTION : Divide a matrix by a scalar : MatDest= MatA/a
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
MatA : address of sw_3D_tdstMatrix, a: SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sw_3D_M_vDivScalarMatrix(MatDest, MatA, a) \
|
||||
MTH3D_M_vDivScalarMatrix(MatDest, MatA, a)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSqrMatrix
|
||||
DESCRIPTION : Square a matrix : MatDest= MatA*MatA
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSqrMatrix(MatDest, MatA) MTH3D_M_vSqrMatrix(MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vTranspMatrixWithoutBuffer
|
||||
DESCRIPTION : Transpose a matrix : MatDest= transp MatA, Matdest must be a other matrix
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA) \
|
||||
MTH3D_M_vTranspMatrixWithoutBuffer(MatDest, MatA)
|
||||
|
||||
|
||||
/* sw_3D_M_vTranpMatrixWithoutBuffer(MatDest, MatA) : MatDest= transp MatA */
|
||||
#define sw_3D_M_vTranpMatrixWithoutBuffer sw_3D_M_vTranspMatrixWithoutBuffer
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vTranspMatrix
|
||||
DESCRIPTION : Transpose a matrix : MatDest= transp MatA
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vTranspMatrix(Mat_Dest, Mat_A) MTH3D_M_vTranspMatrix(Mat_Dest, Mat_A)
|
||||
|
||||
/* sw_3D_M_vTranpMatrix(MatDest, MatA) : MatDest= transp MatA */
|
||||
#define sw_3D_M_vTranpMatrix sw_3D_M_vTranspMatrix
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xTraceMatrix
|
||||
DESCRIPTION : Return the trace of a matrix
|
||||
INPUT : MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : trace MatA : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xTraceMatrix(MatA) MTH3D_M_xTraceMatrix(MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetIdentityMatrix
|
||||
DESCRIPTION : Set a matrix to the Identity matrix : MatDest= Id
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetIdentityMatrix(MatDest) MTH3D_M_vSetIdentityMatrix(MatDest)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_bEqualMatrix
|
||||
DESCRIPTION : Test if two matrix are equal
|
||||
INPUT : MatA, MatB : address of sw_3D_tdstMatrix
|
||||
OUTPUT : MatA==MatB : Boolean
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_bEqualMatrix(MatA, MatB) MTH3D_M_bEqualMatrix(MatA, MatB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_bMatchMatrix
|
||||
DESCRIPTION : Test if two matrix are neary equal
|
||||
INPUT : MatA, MatB : address of sw_3D_tdstMatrix
|
||||
eps : SCA_td_sw
|
||||
OUTPUT : (MatA match MatB to within about eps) : Boolean
|
||||
=======================================================================================*/
|
||||
/*
|
||||
#define sw_3D_M_bMatchMatrix(MatA, MatB, eps) MTH3D_M_bMatchMatrix(MatA, MatB, eps)
|
||||
*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vFillMatrix
|
||||
DESCRIPTION : Fill each matrix element with "a" value
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
a : SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vFillMatrix(MatDest, a) MTH3D_M_vFillMatrix(MatDest, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xDetMatrix
|
||||
DESCRIPTION : Return the determinant of a matrix
|
||||
INPUT : MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : det MatA : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xDetMatrix(MatA) MTH3D_M_xDetMatrix(MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vComMatrixWithoutBuffer
|
||||
DESCRIPTION : Calculate the Cofactor Matrix of a matrix : MatDest= Cofactor Matrix of MatA
|
||||
INPUT : Matdest, MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
|
||||
MTH3D_M_vComMatrixWithoutBuffer(MatDest, MatA) \
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vInverMatrix
|
||||
DESCRIPTION : Invert a matrix : MatDest= Inv MatA
|
||||
INPUT : Matdest, MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vInverMatrix(MatDest, MatA) MTH3D_M_vInverMatrix(MatDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetMatrixColumnElements
|
||||
DESCRIPTION : Get x, y, z column col values in MatA
|
||||
INPUT : x, y, z : SCA_td_sw
|
||||
col : int
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA) \
|
||||
MTH3D_M_vGetMatrixColumnElements( Vx, Vy, Vz, col, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetMatrixColumnElements
|
||||
DESCRIPTION : Set column col x, y, z values in MatDest
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
x, y, z : SCA_td_sw
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col) \
|
||||
MTH3D_M_vSetMatrixColumnElements( MatDest, Vx, Vy, Vz, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xGetMatrixElement
|
||||
DESCRIPTION : Return element at (lin, col) in MatASet
|
||||
INPUT : MatA : address of sw_3D_tdstMatrix
|
||||
lin, col : int
|
||||
OUTPUT : a : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xGetMatrixElement( lin, col, MatA) MTH3D_M_xGetMatrixElement( lin, col, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetMatrixElement
|
||||
DESCRIPTION : Set a element in MatDest at (lin, col)
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
a : SCA_td_sw
|
||||
lin, col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetMatrixElement( MatDest, a, lin, col) MTH3D_M_vSetMatrixElement( MatDest, a, lin, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetMatrixCol0Elements
|
||||
DESCRIPTION : Set x, y, z values of column 0 in MatDest
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol0Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetMatrixCol1Elements
|
||||
DESCRIPTION : Set x, y, z values of column 1 in MatDest
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol1Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetMatrixCol2Elements
|
||||
DESCRIPTION : Set x, y, z values of column 2 in MatDest
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
Vx, Vy, Vz : SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz) \
|
||||
MTH3D_M_vSetMatrixCol2Elements( MatDest, Vx, Vy, Vz)
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetMatrixLineXElements
|
||||
DESCRIPTION : Set x elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineXElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetMatrixLineYElements
|
||||
DESCRIPTION : Set y elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineYElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetMatrixLineZElements
|
||||
DESCRIPTION : Set z elements of all columns in MatDest
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
V0, V0, V0 : SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2) \
|
||||
MTH3D_M_vSetMatrixLineZElements( MatDest, V0, V1, V2)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetMatrixCol0Elements
|
||||
DESCRIPTION : Get x, y, z values of column 0 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sw
|
||||
INPUT : MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol0Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetMatrixCol1Elements
|
||||
DESCRIPTION : Get x, y, z values of column 1 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sw
|
||||
INPUT : MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol1Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetMatrixCol2Elements
|
||||
DESCRIPTION : Get x, y, z values of column 2 in MatA
|
||||
Vx, Vy, Vz : SCA_td_sw
|
||||
INPUT : MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA) \
|
||||
MTH3D_M_vGetMatrixCol2Elements( Vx, Vy, Vz, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetMatrixLineXElements
|
||||
DESCRIPTION : Get x elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sw
|
||||
INPUT : MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineXElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetMatrixLineYElements
|
||||
DESCRIPTION : Get y elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sw
|
||||
INPUT : MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineYElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetMatrixLineZElements
|
||||
DESCRIPTION : Get z elements of all columns in MatA
|
||||
V0, V0, V0 : SCA_td_sw
|
||||
INPUT : MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA) \
|
||||
MTH3D_M_vGetMatrixLineZElements( V0, V1, V2, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : Pf2_sw
|
||||
DESCRIPTION : Print a Vector : Name + its values
|
||||
INPUT : Name : string
|
||||
VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
__inline void Pf2_sw(td_sw _xValue)
|
||||
{
|
||||
printf( " %e",_xValue );
|
||||
}
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vPrintfMatrix
|
||||
DESCRIPTION : Print a Matrix : Name + its values
|
||||
INPUT : Name : string
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
|
||||
__inline sw_3D_fn_vPrintfMatrix( char * Name, sw_3D_tdstMatrix * MatA) \
|
||||
{
|
||||
MTH3D_M_vPrintfMatrix( Name, MatA );
|
||||
}
|
||||
|
||||
#define sw_3D_M_vPrintfMatrix( Name, MatA) sw_3D_fn_vPrintfMatrix( Name, MatA)
|
||||
|
||||
#endif /* __MATRICES_SW_3D__ */
|
139
Rayman_X/cpa/public/MTH/Specif/Mat/Xsl12_3D.h
Normal file
139
Rayman_X/cpa/public/MTH/Specif/Mat/Xsl12_3D.h
Normal file
@@ -0,0 +1,139 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : Xsl12_3D.h
|
||||
MODULE : sl12 (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Vector-Matrix implementation
|
||||
|
||||
VERSION : sl12 V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
/* -----------------27/04/98 16:23-------------------
|
||||
* Conversion : OK avec version 23.04.98 19:26 (14197)
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#ifndef __MATRICES_VECTOR_SL12_3D__
|
||||
#define __MATRICES_VECTOR_SL12_3D__
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* ##-###########################
|
||||
## Matrix-Vector operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMulMatrixVectorWithoutBuffer
|
||||
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA, VectDest must be
|
||||
a other vector
|
||||
INPUT : VectDest : address of sl12_3D_tdstVector
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA) \
|
||||
MTH3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMulMatrixVector
|
||||
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA
|
||||
INPUT : VectDest : address of sl12_3D_tdstVector
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMulMatrixVector( VectDest, MatA, VectA) \
|
||||
MTH3D_M_vMulMatrixVector( VectDest, MatA, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetColumnInMatrix
|
||||
DESCRIPTION : Get a Vector column of a Matrix to a Vector : VectDest= columm col of MatA
|
||||
INPUT : VectDest : address of sl12_3D_tdstVector
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetColumnInMatrix( VectDest, MatA, col ) \
|
||||
MTH3D_M_vGetColumnInMatrix( VectDest, MatA, col )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetColumnInMatrix
|
||||
DESCRIPTION : Put a Vector to a column of a Matrix : Set columm col of MatDest with VectA
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
VectA : address of sl12_3D_tdstVector
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetColumnInMatrix( MatDest, VectA, col) \
|
||||
MTH3D_M_vSetColumnInMatrix( MatDest, VectA, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetLineInMatrix
|
||||
DESCRIPTION : Get a Vector line of a Matrix to a Vector : VectDest= line lin of MatA
|
||||
INPUT : VectDest : address of sl12_3D_tdstVector
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
lin : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetLineInMatrix( VectDest, MatA, lin ) \
|
||||
MTH3D_M_vGetLineInMatrix( VectDest, MatA, lin )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetLineInMatrix
|
||||
DESCRIPTION : Put a Vector to a line of a Matrix : Set line lin of MatDest with VectA
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
VectA : address of sl12_3D_tdstVector
|
||||
lin : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetLineInMatrix( MatDest, VectA, lin) \
|
||||
MTH3D_M_vSetLineInMatrix( MatDest, VectA, lin)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetDiagInMatrix
|
||||
DESCRIPTION : Get a Vector diagonal of a Matrix to a Vector : VectDest= diagonal of MatA
|
||||
INPUT : VectDest : address of sl12_3D_tdstVector
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetDiagInMatrix( VectDest, MatA) \
|
||||
MTH3D_M_vGetDiagInMatrix( VectDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetDiagInMatrix
|
||||
DESCRIPTION : Put a Vector to a diagonal of a Matrix : Set diagonal of MatDest with VectA
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetDiagInMatrix( MatDest, VectA) \
|
||||
MTH3D_M_vSetDiagInMatrix( MatDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetVectorsInMatrix
|
||||
DESCRIPTION : Get all column Matrix to two Vectors
|
||||
INPUT : VaDest, VbDest, VcDest: address of sl12_3D_tdstVector
|
||||
MatA : address of sl12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA) \
|
||||
MTH3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetVectorsInMatrix
|
||||
DESCRIPTION : Set all column Matrix with two Vectors
|
||||
INPUT : MatDest : address of sl12_3D_tdstMatrix
|
||||
VectA, VectB, VectC : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC) \
|
||||
MTH3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC)
|
||||
|
||||
|
||||
|
||||
#endif /* __MATRICES_VECTOR_SL12_3D__ */
|
139
Rayman_X/cpa/public/MTH/Specif/Mat/Xsl_3D.h
Normal file
139
Rayman_X/cpa/public/MTH/Specif/Mat/Xsl_3D.h
Normal file
@@ -0,0 +1,139 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : Xsl_3D.h
|
||||
MODULE : sl (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Vector-Matrix implementation
|
||||
|
||||
VERSION : sl V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
/* -----------------27/04/98 16:23-------------------
|
||||
* Conversion : OK avec version 23.04.98 19:26 (14012)
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#ifndef __MATRICES_VECTOR_SL_3D__
|
||||
#define __MATRICES_VECTOR_SL_3D__
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* ##-###########################
|
||||
## Matrix-Vector operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMulMatrixVectorWithoutBuffer
|
||||
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA, VectDest must be
|
||||
a other vector
|
||||
INPUT : VectDest : address of sl_3D_tdstVector
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA) \
|
||||
MTH3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMulMatrixVector
|
||||
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA
|
||||
INPUT : VectDest : address of sl_3D_tdstVector
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMulMatrixVector( VectDest, MatA, VectA) \
|
||||
MTH3D_M_vMulMatrixVector( VectDest, MatA, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetColumnInMatrix
|
||||
DESCRIPTION : Get a Vector column of a Matrix to a Vector : VectDest= columm col of MatA
|
||||
INPUT : VectDest : address of sl_3D_tdstVector
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetColumnInMatrix( VectDest, MatA, col ) \
|
||||
MTH3D_M_vGetColumnInMatrix( VectDest, MatA, col )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetColumnInMatrix
|
||||
DESCRIPTION : Put a Vector to a column of a Matrix : Set columm col of MatDest with VectA
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
VectA : address of sl_3D_tdstVector
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetColumnInMatrix( MatDest, VectA, col) \
|
||||
MTH3D_M_vSetColumnInMatrix( MatDest, VectA, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetLineInMatrix
|
||||
DESCRIPTION : Get a Vector line of a Matrix to a Vector : VectDest= line lin of MatA
|
||||
INPUT : VectDest : address of sl_3D_tdstVector
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
lin : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetLineInMatrix( VectDest, MatA, lin ) \
|
||||
MTH3D_M_vGetLineInMatrix( VectDest, MatA, lin )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetLineInMatrix
|
||||
DESCRIPTION : Put a Vector to a line of a Matrix : Set line lin of MatDest with VectA
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
VectA : address of sl_3D_tdstVector
|
||||
lin : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetLineInMatrix( MatDest, VectA, lin) \
|
||||
MTH3D_M_vSetLineInMatrix( MatDest, VectA, lin)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetDiagInMatrix
|
||||
DESCRIPTION : Get a Vector diagonal of a Matrix to a Vector : VectDest= diagonal of MatA
|
||||
INPUT : VectDest : address of sl_3D_tdstVector
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetDiagInMatrix( VectDest, MatA) \
|
||||
MTH3D_M_vGetDiagInMatrix( VectDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetDiagInMatrix
|
||||
DESCRIPTION : Put a Vector to a diagonal of a Matrix : Set diagonal of MatDest with VectA
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetDiagInMatrix( MatDest, VectA) \
|
||||
MTH3D_M_vSetDiagInMatrix( MatDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetVectorsInMatrix
|
||||
DESCRIPTION : Get all column Matrix to two Vectors
|
||||
INPUT : VaDest, VbDest, VcDest: address of sl_3D_tdstVector
|
||||
MatA : address of sl_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA) \
|
||||
MTH3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetVectorsInMatrix
|
||||
DESCRIPTION : Set all column Matrix with two Vectors
|
||||
INPUT : MatDest : address of sl_3D_tdstMatrix
|
||||
VectA, VectB, VectC : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC) \
|
||||
MTH3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC)
|
||||
|
||||
|
||||
|
||||
#endif /* __MATRICES_VECTOR_SL_3D__ */
|
139
Rayman_X/cpa/public/MTH/Specif/Mat/Xsw12_3D.h
Normal file
139
Rayman_X/cpa/public/MTH/Specif/Mat/Xsw12_3D.h
Normal file
@@ -0,0 +1,139 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : Xsw12_3D.h
|
||||
MODULE : sw12 (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Vector-Matrix implementation
|
||||
|
||||
VERSION : sw12 V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
/* -----------------27/04/98 16:23-------------------
|
||||
* Conversion : OK avec version 24.04.98 17:45 (13587)
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#ifndef __MATRICES_VECTOR_SW12_3D__
|
||||
#define __MATRICES_VECTOR_SW12_3D__
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* ##-###########################
|
||||
## Matrix-Vector operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMulMatrixVectorWithoutBuffer
|
||||
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA, VectDest must be
|
||||
a other vector
|
||||
INPUT : VectDest : address of sw12_3D_tdstVector
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA) \
|
||||
MTH3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMulMatrixVector
|
||||
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA
|
||||
INPUT : VectDest : address of sw12_3D_tdstVector
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMulMatrixVector( VectDest, MatA, VectA) \
|
||||
MTH3D_M_vMulMatrixVector( VectDest, MatA, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetColumnInMatrix
|
||||
DESCRIPTION : Get a Vector column of a Matrix to a Vector : VectDest= columm col of MatA
|
||||
INPUT : VectDest : address of sw12_3D_tdstVector
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetColumnInMatrix( VectDest, MatA, col ) \
|
||||
MTH3D_M_vGetColumnInMatrix( VectDest, MatA, col )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetColumnInMatrix
|
||||
DESCRIPTION : Put a Vector to a column of a Matrix : Set columm col of MatDest with VectA
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
VectA : address of sw12_3D_tdstVector
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetColumnInMatrix( MatDest, VectA, col) \
|
||||
MTH3D_M_vSetColumnInMatrix( MatDest, VectA, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetLineInMatrix
|
||||
DESCRIPTION : Get a Vector line of a Matrix to a Vector : VectDest= line lin of MatA
|
||||
INPUT : VectDest : address of sw12_3D_tdstVector
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
lin : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetLineInMatrix( VectDest, MatA, lin ) \
|
||||
MTH3D_M_vGetLineInMatrix( VectDest, MatA, lin )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetLineInMatrix
|
||||
DESCRIPTION : Put a Vector to a line of a Matrix : Set line lin of MatDest with VectA
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
VectA : address of sw12_3D_tdstVector
|
||||
lin : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetLineInMatrix( MatDest, VectA, lin) \
|
||||
MTH3D_M_vSetLineInMatrix( MatDest, VectA, lin)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetDiagInMatrix
|
||||
DESCRIPTION : Get a Vector diagonal of a Matrix to a Vector : VectDest= diagonal of MatA
|
||||
INPUT : VectDest : address of sw12_3D_tdstVector
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetDiagInMatrix( VectDest, MatA) \
|
||||
MTH3D_M_vGetDiagInMatrix( VectDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetDiagInMatrix
|
||||
DESCRIPTION : Put a Vector to a diagonal of a Matrix : Set diagonal of MatDest with VectA
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetDiagInMatrix( MatDest, VectA) \
|
||||
MTH3D_M_vSetDiagInMatrix( MatDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetVectorsInMatrix
|
||||
DESCRIPTION : Get all column Matrix to two Vectors
|
||||
INPUT : VaDest, VbDest, VcDest: address of sw12_3D_tdstVector
|
||||
MatA : address of sw12_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA) \
|
||||
MTH3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetVectorsInMatrix
|
||||
DESCRIPTION : Set all column Matrix with two Vectors
|
||||
INPUT : MatDest : address of sw12_3D_tdstMatrix
|
||||
VectA, VectB, VectC : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC) \
|
||||
MTH3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC)
|
||||
|
||||
|
||||
|
||||
#endif /* __MATRICES_VECTOR_SW12_3D__ */
|
139
Rayman_X/cpa/public/MTH/Specif/Mat/Xsw_3D.h
Normal file
139
Rayman_X/cpa/public/MTH/Specif/Mat/Xsw_3D.h
Normal file
@@ -0,0 +1,139 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : Xsw_3D.h
|
||||
MODULE : sw (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Vector-Matrix implementation
|
||||
|
||||
VERSION : sw V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
/* -----------------27/04/98 16:23-------------------
|
||||
* Conversion : OK avec version 23.04.98 19:26 (13883)
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#ifndef __MATRICES_VECTOR_SW_3D__
|
||||
#define __MATRICES_VECTOR_SW_3D__
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* ##-###########################
|
||||
## Matrix-Vector operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMulMatrixVectorWithoutBuffer
|
||||
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA, VectDest must be
|
||||
a other vector
|
||||
INPUT : VectDest : address of sw_3D_tdstVector
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA) \
|
||||
MTH3D_M_vMulMatrixVectorWithoutBuffer( VectDest, MatA, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMulMatrixVector
|
||||
DESCRIPTION : Multiply a Matrix to a Vector : VectDest= MatA*VectA
|
||||
INPUT : VectDest : address of sw_3D_tdstVector
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMulMatrixVector( VectDest, MatA, VectA) \
|
||||
MTH3D_M_vMulMatrixVector( VectDest, MatA, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetColumnInMatrix
|
||||
DESCRIPTION : Get a Vector column of a Matrix to a Vector : VectDest= columm col of MatA
|
||||
INPUT : VectDest : address of sw_3D_tdstVector
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetColumnInMatrix( VectDest, MatA, col ) \
|
||||
MTH3D_M_vGetColumnInMatrix( VectDest, MatA, col )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetColumnInMatrix
|
||||
DESCRIPTION : Put a Vector to a column of a Matrix : Set columm col of MatDest with VectA
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
VectA : address of sw_3D_tdstVector
|
||||
col : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetColumnInMatrix( MatDest, VectA, col) \
|
||||
MTH3D_M_vSetColumnInMatrix( MatDest, VectA, col)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetLineInMatrix
|
||||
DESCRIPTION : Get a Vector line of a Matrix to a Vector : VectDest= line lin of MatA
|
||||
INPUT : VectDest : address of sw_3D_tdstVector
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
lin : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetLineInMatrix( VectDest, MatA, lin ) \
|
||||
MTH3D_M_vGetLineInMatrix( VectDest, MatA, lin )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetLineInMatrix
|
||||
DESCRIPTION : Put a Vector to a line of a Matrix : Set line lin of MatDest with VectA
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
VectA : address of sw_3D_tdstVector
|
||||
lin : int
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetLineInMatrix( MatDest, VectA, lin) \
|
||||
MTH3D_M_vSetLineInMatrix( MatDest, VectA, lin)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetDiagInMatrix
|
||||
DESCRIPTION : Get a Vector diagonal of a Matrix to a Vector : VectDest= diagonal of MatA
|
||||
INPUT : VectDest : address of sw_3D_tdstVector
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetDiagInMatrix( VectDest, MatA) \
|
||||
MTH3D_M_vGetDiagInMatrix( VectDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetDiagInMatrix
|
||||
DESCRIPTION : Put a Vector to a diagonal of a Matrix : Set diagonal of MatDest with VectA
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetDiagInMatrix( MatDest, VectA) \
|
||||
MTH3D_M_vSetDiagInMatrix( MatDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetVectorsInMatrix
|
||||
DESCRIPTION : Get all column Matrix to two Vectors
|
||||
INPUT : VaDest, VbDest, VcDest: address of sw_3D_tdstVector
|
||||
MatA : address of sw_3D_tdstMatrix
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA) \
|
||||
MTH3D_M_vGetVectorsInMatrix( VaDest, VbDest, VcDest, MatA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetVectorsInMatrix
|
||||
DESCRIPTION : Set all column Matrix with two Vectors
|
||||
INPUT : MatDest : address of sw_3D_tdstMatrix
|
||||
VectA, VectB, VectC : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC) \
|
||||
MTH3D_M_vSetVectorsInMatrix( MatDest, VectA, VectB, VectC)
|
||||
|
||||
|
||||
|
||||
#endif /* __MATRICES_VECTOR_SW_3D__ */
|
Reference in New Issue
Block a user