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__ */
|
234
Rayman_X/cpa/public/MTH/Specif/SCA/SCA_sl.h
Normal file
234
Rayman_X/cpa/public/MTH/Specif/SCA/SCA_sl.h
Normal file
@@ -0,0 +1,234 @@
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* Filename : SCA_sl.h */
|
||||
/* Author : Frederic Philippe */
|
||||
/* : Marc Trabucato */
|
||||
/* Target : PC */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------15/04/98 15:58-------------------
|
||||
* Conversion : OK (avec SCA_sl.h du 23.04.98 19:26 (18017))
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#ifndef _SLREAL_H_
|
||||
#define _SLREAL_H_
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/*-----------------*/
|
||||
/* Fixed coma case */
|
||||
/*-----------------*/
|
||||
/* 1.31.0 */
|
||||
|
||||
/*---------------------------------*/
|
||||
/* Specific Values for fixed point */
|
||||
/*---------------------------------*/
|
||||
#define SCA_td_sl MTH_tdxReal
|
||||
|
||||
/*#define SCA_sl_C_slComaDecal 0*/
|
||||
/*#define SCA_sl_C_slComaCoef 1*/
|
||||
|
||||
/*#define SCA_sl_C_dfMax 2147483648*/
|
||||
/*#define SCA_sl_C_dfMin (-SCA_sl_C_dfMax)*/
|
||||
|
||||
/*#define SCA_sl_C_slMax (0x7FFFFFE0)*/
|
||||
/*#define SCA_sl_C_slMin (0xEFFFFFE0)*/
|
||||
/*#define SCA_sl_C_slError (0x7FFFFFFF)*/
|
||||
|
||||
/*#define SCA_sl_C_slNegMask (0x80000000)*/
|
||||
/*#define SCA_sl_C_slPosMask (0x7FFFFFFF)*/
|
||||
/*#define SCA_sl_C_slDecMask (0x00000000)*/
|
||||
/*#define SCA_sl_C_slEntMask (0xFFFFFFFF)*/
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* ---------------- Constants ---------------------------*/
|
||||
/*--------------------------------------------------------*/
|
||||
#define SCA_sl_C_ZERO MTH_C_ZERO
|
||||
#define SCA_sl_C_ONE MTH_C_ONE
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Conversion functions */
|
||||
/*--------------------------------------------------------*/
|
||||
__inline SCA_td_sl SCA_sl_fn_slDouble2Real( double _dfValue )
|
||||
{
|
||||
return MTH_M_xDoubleToReal( _dfValue );
|
||||
}
|
||||
/*--------------------------------------------------------*/
|
||||
__inline double SCA_sl_fn_Real2Double( SCA_td_sl _xValue )
|
||||
{
|
||||
return MTH_M_xRealToDouble( _xValue );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
/* Conversions : Macros definitions */
|
||||
/*--------------------------------------------*/
|
||||
#define SCA_sl_M_slDoubleToReal(_dfValue) MTH_M_xDoubleToReal(_dfValue)
|
||||
#define SCA_sl_M_slFloatToReal(_fValue) MTH_M_xFloatToReal(_fValue)
|
||||
#define SCA_sl_M_slIntToReal(_iValue) MTH_M_xLongToReal(_iValue) /*???*/
|
||||
|
||||
#define SCA_sl_M_RealToDouble(_xValue) MTH_M_xRealToDouble(_xValue)
|
||||
#define SCA_sl_M_RealToFloat(_xValue) MTH_M_xrealToFloat(_xValue)
|
||||
#define SCA_sl_M_RealToInt(_xValue) MTh_M_xRealToLong(_xValue) /*???*/
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Constantes */
|
||||
/*--------------------------------------------------------*/
|
||||
#define SCA_sl_C_slTwo MTH_C_2
|
||||
|
||||
/* ##CONSTANTE#--------------------------------------------------------------------------
|
||||
Real Constantes declaration
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
#define SCA_sl_C_InfinitPlus MTH_C_InfinitPlus
|
||||
#define SCA_sl_InfinitMinus MTH_C_InfinitMinus
|
||||
#define SCA_sl_EpsilonPlus MTH_C_EpsilonPlus
|
||||
#define SCA_sl_EpsilonMinus MTH_C_EpsilonMinus
|
||||
|
||||
#define SCA_sl_Pi MTH_C_Pi
|
||||
#define SCA_sl_2Pi MTH_C_2Pi
|
||||
#define SCA_sl_PiBy2 MTH_C_PiBy2
|
||||
#define SCA_sl_PiBy4 MTH_C_PiBy4
|
||||
#define SCA_sl_PiBy8 MTH_C_PiBy8
|
||||
#define SCA_sl_PiBy180 MTH_C_PiBy180
|
||||
#define SCA_sl_180ByPi MTH_C_180ByPi
|
||||
#define SCA_sl_e MTH_C_e
|
||||
|
||||
#define SCA_sl_MinusONE MTH_C_MinusONE
|
||||
|
||||
#define SCA_sl_2 MTH_C_2
|
||||
#define SCA_sl_3 MTH_C_3
|
||||
#define SCA_sl_4 MTH_C_4
|
||||
#define SCA_sl_5 MTH_C_5
|
||||
#define SCA_sl_8 (double) 8.0
|
||||
|
||||
#define SCA_sl_Minus2 MTH_C_Minus2
|
||||
#define SCA_sl_Minus3 MTH_C_Minus3
|
||||
#define SCA_sl_Minus4 MTH_C_Minus4
|
||||
#define SCA_sl_Minus5 MTH_C_Minus5
|
||||
|
||||
#define SCA_sl_Inv2 MTH_C_Inv2
|
||||
#define SCA_sl_Inv3 MTH_C_Inv3
|
||||
#define SCA_sl_Inv4 MTH_C_Inv4
|
||||
#define SCA_sl_Inv5 MTH_C_Inv5
|
||||
|
||||
#define SCA_sl_MinusInv2 MTH_C_MinusInv2
|
||||
#define SCA_sl_MinusInv3 MTH_C_MinusInv3
|
||||
#define SCA_sl_MinusInv4 MTH_C_MinusInv4
|
||||
#define SCA_sl_MinusInv5 MTH_C_MinusInv5
|
||||
|
||||
#define SCA_sl_Sqrt2 MTH_C_Sqrt2
|
||||
#define SCA_sl_Sqrt3 MTH_C_Sqrt3
|
||||
#define SCA_sl_Sqrt4 MTH_C_Sqrt4
|
||||
#define SCA_sl_Sqrt5 MTH_C_Sqrt5
|
||||
|
||||
#define SCA_sl_MinusSqrt2 MTH_C_MinusSqrt2
|
||||
#define SCA_sl_MinusSqrt3 MTH_C_MinusSqrt3
|
||||
#define SCA_sl_MinusSqrt4 MTH_C_MinusSqrt4
|
||||
#define SCA_sl_MinusSqrt5 MTH_C_MinusSqrt5
|
||||
|
||||
#define SCA_sl_InvSqrt2 MTH_C_InvSqrt2
|
||||
#define SCA_sl_InvSqrt3 MTH_C_InvSqrt3
|
||||
#define SCA_sl_InvSqrt4 MTH_C_InvSqrt4
|
||||
#define SCA_sl_InvSqrt5 MTH_C_InvSqrt5
|
||||
|
||||
#define SCA_sl_MinusInvSqrt2 MTH_C_MinusInvSqrt2
|
||||
#define SCA_sl_MinusInvSqrt3 MTH_C_MinusInvSqrt3
|
||||
#define SCA_sl_MinusInvSqrt4 MTH_C_MinusInvSqrt4
|
||||
#define SCA_sl_MinusInvSqrt5 MTH_C_MinusInvSqrt5
|
||||
|
||||
#define SCA_sl_MAX_UNSIGNED_CHAR MTH_C_MAX_UNSIGNED_CHAR
|
||||
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Operations */
|
||||
/*--------------------------------------------------------*/
|
||||
/* Comparaisons */
|
||||
#define SCA_sl_M_bIsNull(_xOp) MTH_M_bIsNull(_xOp)
|
||||
#define SCA_sl_M_bEqualZero(_xOp) MTH_M_bEqualZero(_xOp)
|
||||
#define SCA_sl_M_bIsNegative(_xOp) MTH_M_bLessZero(_xOp)
|
||||
#define SCA_sl_M_bIsPositive(_xOp) MTH_M_bGreaterZero(_xOp)
|
||||
#define SCA_sl_M_bGreater(_xOp1,_xOp2) MTH_M_bGreater(_xOp1,_xOp2)
|
||||
#define SCA_sl_M_bLess(_xOp1,_xOp2) MTH_M_bLess_xOp1,_xOp2)
|
||||
#define SCA_sl_M_bGreaterEqual(_xOp1,_xOp2) MTH_M_bGreaterEqual(_xOp1,_xOp2)
|
||||
#define SCA_sl_M_bLessEqual(_xOp1,_xOp2) MTH_M_bLessEqual(_xOp1,_xOp2)
|
||||
#define SCA_sl_M_bEqual(_xOp1,_xOp2) MTH_M_bEqual(_xOp1,_xOp2)
|
||||
#define SCA_sl_M_bDifferent(_xOp1,_xOp2) MTH_M_bDifferent(_xOp1,_xOp2)
|
||||
|
||||
/* Operations */
|
||||
#define SCA_sl_M_slNeg(_xOp) MTH_M_xNeg(_xOp)
|
||||
#define SCA_sl_M_slAdd(_xOp1,_xOp2) MTH_M_xAdd(_xOp1,_xOp2)
|
||||
#define SCA_sl_M_slSub(_xOp1,_xOp2) MTH_M_xsub(_xOp1,_xOp2)
|
||||
#define SCA_sl_M_slMul(_xOp1,_xOp2) MTH_M_xMul(_xOp1,_xOp2)
|
||||
#define SCA_sl_M_slDiv(_xOp1,_xOp2) MTH_M_xDiv(_xOp1,_xOp2)
|
||||
|
||||
#define SCA_sl_M_slAbs(_xOp) MTH_M_xAbs(_xOp)
|
||||
#define SCA_sl_M_slNegAbs(_xOp) MTH_M_xNegAbs(_xOp)
|
||||
#define SCA_sl_M_slInv(_xOp) MTH_M_xInv(_xOp)
|
||||
#define SCA_sl_M_slSqr(_xOp) MTH_M_xSqr(_xOp,_xOp)
|
||||
#define SCA_sl_M_slCub(_xOp) MTH_M_xMul(_xOp,MTH_M_xSqr(_xOp))
|
||||
#define SCA_sl_M_slSqrt(_xOp) MTH_M_xSqrt(_xOp)
|
||||
#define SCA_sl_M_slInvSqrt(_xOp) MTH_M_xInvSqrt(_xOp)
|
||||
|
||||
#define SCA_sl_M_slSin(_xOp) MTH_M_xSin(_xOp)
|
||||
#define SCA_sl_M_slCos(_xOp) MTH_M_xSin(_xOp)
|
||||
/*
|
||||
#define sl_M_Tan(_xOp) (SCA_sl_fn_Tan(_xOp))
|
||||
#define sl_M_ASin(_xOp) (SCA_sl_fn_ASin(_xOp))
|
||||
#define sl_M_ACos(_xOp) (SCA_sl_fn_ACos(_xOp))
|
||||
*/
|
||||
/*
|
||||
#define sl_M_Sin(_xOp) SCA_sl_M_slDoubleToReal(sin(sl_M_Real2Double(_xOp)))
|
||||
#define sl_M_Cos(_xOp) SCA_sl_M_slDoubleToReal(cos(sl_M_Real2Double(_xOp)))
|
||||
*/
|
||||
|
||||
#define SCA_sl_M_slTan(_xOp) MTH_M_xTan(_xOp)
|
||||
#define SCA_sl_M_slASin(_xOp) MTH_M_xASin(_xOp)
|
||||
#define SCA_sl_M_slACos(_xOp) MTH_M_xACos(_xOp)
|
||||
|
||||
|
||||
/* ##-##############################
|
||||
## Tools for MulMatrixMatrix 3D
|
||||
################################# */
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl_M_slMulSubMul
|
||||
DESCRIPTION : Return the subtraction of two multiplications
|
||||
INPUT : a, b, c, d : SCA_td_sl
|
||||
OUTPUT : a*b - c*d : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define SCA_sl_M_slMulSubMul(a, b, c, d) MTH_M_xMulSubMul(a, b, c, d)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl_M_slMulAddMulAddMul
|
||||
DESCRIPTION : Return the adition of three multiplications
|
||||
INPUT : a, b, c, d, e, f : SCA_td_sl
|
||||
OUTPUT : a*b + c*d + e*f : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define SCA_sl_M_slMulAddMulAddMul(a, b, c, d, e, f) MTH_M_xMulAddMulAddMul(a, b, c, d, e, f)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl_M_slSqrAddSqrAddSqr
|
||||
DESCRIPTION : Return the adition of three squares
|
||||
INPUT : a, b, c : SCA_td_sl
|
||||
OUTPUT : a*a + b*b + c*c : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define SCA_sl_M_slSqrAddSqrAddSqr(a, b, c) MTH_M_xSqrAddSqrAddSqr(a, b, c)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl_M_slMul3
|
||||
DESCRIPTION : Return the multiplication of three real numbers
|
||||
INPUT : a, b, c : SCA_td_sl
|
||||
OUTPUT : a*b*c : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define SCA_sl_M_slMul3(a, b, c) MTH_M_xMul3(a, b, c)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl_M_slAdd3
|
||||
DESCRIPTION : Return the addition of three real numbers
|
||||
INPUT : a, b, c : SCA_td_sl
|
||||
OUTPUT : a+b+c : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define SCA_sl_M_slAdd3(a, b, c) MTH_M_xAdd3(a, b, c)
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* _SLREAL_H_ */
|
284
Rayman_X/cpa/public/MTH/Specif/SCA/SCA_sl12.h
Normal file
284
Rayman_X/cpa/public/MTH/Specif/SCA/SCA_sl12.h
Normal file
@@ -0,0 +1,284 @@
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* Filename : SCA_sl12.h */
|
||||
/* Author : Frederic Philippe */
|
||||
/* : Marc Trabucato */
|
||||
/* Target : PC */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------15/04/98 17:52-------------------
|
||||
* Conversion : OK (avec version 23.04.98 19:26 (20523))
|
||||
* --------------------------------------------------*/
|
||||
#ifndef _SCA_sl12_H_
|
||||
#define _SCA_sl12_H_
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/*-----------------*/
|
||||
/* Fixed coma case */
|
||||
/*-----------------*/
|
||||
/* 1.19.12 */
|
||||
|
||||
/*---------------------------------*/
|
||||
/* Specific Values for Fixed point */
|
||||
/*---------------------------------*/
|
||||
#define SCA_td_sl12 MTH_tdxReal
|
||||
|
||||
/*#define SCA_sl12_C_sl12ComaDecal 12*/
|
||||
/*#define SCA_sl12_C_sl12ComaCoef 4096*/
|
||||
|
||||
/*#define SCA_sl12_C_dfMax 524000.0*/
|
||||
/*#define SCA_sl12_C_dfMin (-SCA_sl12_C_dfMax)*/
|
||||
|
||||
/*#define SCA_sl12_C_sl12Max (0x7FFFFFE0)*/
|
||||
/*#define SCA_sl12_C_sl12Min (0xEFFFFFE0)*/
|
||||
/*#define SCA_sl12_C_sl12ForceMinus (0x80000000)*/
|
||||
/*#define SCA_sl12_C_sl12ForcePlus (0x7FFFFFFF)*/
|
||||
/*#define SCA_sl12_C_sl12Error (0x7FFFFFFF)*/
|
||||
|
||||
/*#define SCA_sl12_C_sl12NegMask (0x80000000)*/
|
||||
/*#define SCA_sl12_C_sl12PosMask (0x7FFFFFFF)*/
|
||||
/*#define SCA_sl12_C_sl12DecMask (0x00000FFF)*/
|
||||
/*#define SCA_sl12_C_sl12EntMask (0xFFFFF000)*/
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* ---------------- Constants ---------------------------*/
|
||||
/*--------------------------------------------------------*/
|
||||
#define SCA_sl12_C_ZERO MTH_C_ZERO
|
||||
#define SCA_sl12_C_ONE MTH_C_ONE
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Conversion functions */
|
||||
/*--------------------------------------------------------*/
|
||||
__inline SCA_td_sl12 SCA_sl12_fn_sl12Double2Real( double _dfValue )
|
||||
{
|
||||
return MTH_M_xDoubleToReal( _dfValue );
|
||||
}
|
||||
/*--------------------------------------------------------*/
|
||||
__inline double SCA_sl12_fn_Real2Double( SCA_td_sl12 _xValue )
|
||||
{
|
||||
return MTH_M_xRealToDouble( _xValue );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
/* Conversions : Macros definitions */
|
||||
/*--------------------------------------------*/
|
||||
#define SCA_sl12_M_sl12DoubleToReal(_dfValue) MTH_M_xDoubleToReal(_dfValue)
|
||||
#define SCA_sl12_M_sl12FloatToReal(_fValue) MTH_M_xFloatToReal(_fValue)
|
||||
#define SCA_sl12_M_sl12IntToReal(_iValue) MTH_M_xLongToReal(_iValue) /*???*/
|
||||
|
||||
#define SCA_sl12_M_RealToDouble(_xValue) MTH_M_xRealToDouble(_xValue)
|
||||
#define SCA_sl12_M_RealToFloat(_xValue) MTH_M_xrealToFloat(_xValue)
|
||||
#define SCA_sl12_M_RealToInt(_xValue) MTh_M_xRealToLong(_xValue) /*???*/
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Constantes */
|
||||
/*--------------------------------------------------------*/
|
||||
#define SCA_sl12_C_sl12Two MTH_C_2
|
||||
|
||||
/* ##CONSTANTE#--------------------------------------------------------------------------
|
||||
Real Constantes declaration
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
#define SCA_sl12_C_InfinitPlus MTH_C_InfinitPlus
|
||||
#define SCA_sl12_InfinitMinus MTH_C_InfinitMinus
|
||||
#define SCA_sl12_EpsilonPlus MTH_C_EpsilonPlus
|
||||
#define SCA_sl12_EpsilonMinus MTH_C_EpsilonMinus
|
||||
|
||||
#define SCA_sl12_Pi MTH_C_Pi
|
||||
#define SCA_sl12_2Pi MTH_C_2Pi
|
||||
#define SCA_sl12_PiBy2 MTH_C_PiBy2
|
||||
#define SCA_sl12_PiBy4 MTH_C_PiBy4
|
||||
#define SCA_sl12_PiBy8 MTH_C_PiBy8
|
||||
#define SCA_sl12_PiBy180 MTH_C_PiBy180
|
||||
#define SCA_sl12_180ByPi MTH_C_180ByPi
|
||||
#define SCA_sl12_e MTH_C_e
|
||||
|
||||
#define SCA_sl12_MinusONE MTH_C_MinusONE
|
||||
|
||||
#define SCA_sl12_2 MTH_C_2
|
||||
#define SCA_sl12_3 MTH_C_3
|
||||
#define SCA_sl12_4 MTH_C_4
|
||||
#define SCA_sl12_5 MTH_C_5
|
||||
#define SCA_sl12_8 (double) 8.0
|
||||
|
||||
#define SCA_sl12_Minus2 MTH_C_Minus2
|
||||
#define SCA_sl12_Minus3 MTH_C_Minus3
|
||||
#define SCA_sl12_Minus4 MTH_C_Minus4
|
||||
#define SCA_sl12_Minus5 MTH_C_Minus5
|
||||
|
||||
#define SCA_sl12_Inv2 MTH_C_Inv2
|
||||
#define SCA_sl12_Inv3 MTH_C_Inv3
|
||||
#define SCA_sl12_Inv4 MTH_C_Inv4
|
||||
#define SCA_sl12_Inv5 MTH_C_Inv5
|
||||
|
||||
#define SCA_sl12_MinusInv2 MTH_C_MinusInv2
|
||||
#define SCA_sl12_MinusInv3 MTH_C_MinusInv3
|
||||
#define SCA_sl12_MinusInv4 MTH_C_MinusInv4
|
||||
#define SCA_sl12_MinusInv5 MTH_C_MinusInv5
|
||||
|
||||
#define SCA_sl12_Sqrt2 MTH_C_Sqrt2
|
||||
#define SCA_sl12_Sqrt3 MTH_C_Sqrt3
|
||||
#define SCA_sl12_Sqrt4 MTH_C_Sqrt4
|
||||
#define SCA_sl12_Sqrt5 MTH_C_Sqrt5
|
||||
|
||||
#define SCA_sl12_MinusSqrt2 MTH_C_MinusSqrt2
|
||||
#define SCA_sl12_MinusSqrt3 MTH_C_MinusSqrt3
|
||||
#define SCA_sl12_MinusSqrt4 MTH_C_MinusSqrt4
|
||||
#define SCA_sl12_MinusSqrt5 MTH_C_MinusSqrt5
|
||||
|
||||
#define SCA_sl12_InvSqrt2 MTH_C_InvSqrt2
|
||||
#define SCA_sl12_InvSqrt3 MTH_C_InvSqrt3
|
||||
#define SCA_sl12_InvSqrt4 MTH_C_InvSqrt4
|
||||
#define SCA_sl12_InvSqrt5 MTH_C_InvSqrt5
|
||||
|
||||
#define SCA_sl12_MinusInvSqrt2 MTH_C_MinusInvSqrt2
|
||||
#define SCA_sl12_MinusInvSqrt3 MTH_C_MinusInvSqrt3
|
||||
#define SCA_sl12_MinusInvSqrt4 MTH_C_MinusInvSqrt4
|
||||
#define SCA_sl12_MinusInvSqrt5 MTH_C_MinusInvSqrt5
|
||||
|
||||
#define SCA_sl12_MAX_UNSIGNED_CHAR MTH_C_MAX_UNSIGNED_CHAR
|
||||
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Operations */
|
||||
/*--------------------------------------------------------*/
|
||||
/* Comparaisons */
|
||||
#define SCA_sl12_M_bIsNull(_xOp) MTH_M_bIsNull(_xOp)
|
||||
#define SCA_sl12_M_bEqualZero(_sl12Op) MTH_M_bEqualZero(_sl12Op)
|
||||
#define SCA_sl12_M_bIsNegative(_xOp) MTH_M_bLessZero((_xOp)
|
||||
#define SCA_sl12_M_bIsPositive(_xOp) MTH_M_bGreaterZero(_xOp)
|
||||
#define SCA_sl12_M_bGreater(_xOp1,_xOp2) MTH_M_bGreater(_xOp1,_xOp2)
|
||||
#define SCA_sl12_M_bLess(_xOp1,_xOp2) MTH_M_bLess_xOp1,_xOp2)
|
||||
#define SCA_sl12_M_bGreaterEqual(_xOp1,_xOp2) MTH_M_bGreaterEqual(_xOp1,_xOp2)
|
||||
#define SCA_sl12_M_bLessEqual(_xOp1,_xOp2) MTH_M_bLessEqual(_xOp1,_xOp2)
|
||||
#define SCA_sl12_M_bEqual(_xOp1,_xOp2) MTH_M_bEqual(_xOp1,_xOp2)
|
||||
#define SCA_sl12_M_bDifferent(_xOp1,_xOp2) MTH_M_bDifferent(_xOp1,_xOp2)
|
||||
#define SCA_sl12_M_sl12Min(A,B) MTH_M_xMin(A,B)
|
||||
#define SCA_sl12_M_sl12Max(A,B) MTH_M_xMax(A,B)
|
||||
|
||||
/* Operations */
|
||||
#define SCA_sl12_M_sl12Neg(_xOp) MTH_M_xNeg(_xOp)
|
||||
#define SCA_sl12_M_sl12Add(_xOp1,_xOp2) MTH_M_xAdd(_xOp1,_xOp2)
|
||||
#define SCA_sl12_M_sl12Sub(_xOp1,_xOp2) MTH_M_xsub(_xOp1,_xOp2)
|
||||
#define SCA_sl12_M_sl12Mul(_xOp1,_xOp2) MTH_M_xMul(_xOp1,_xOp2)
|
||||
#define SCA_sl12_M_sl12Div(_xOp1,_xOp2) MTH_M_xDiv(_xOp1,_xOp2)
|
||||
|
||||
#define SCA_sl12_M_sl12Abs(_xOp) MTH_M_xAbs(_xOp)
|
||||
#define SCA_sl12_M_sl12NegAbs(_xOp) MTH_M_xNegAbs(_xOp)
|
||||
#define SCA_sl12_M_sl12Inv(_xOp) MTH_M_xInv(_xOp)
|
||||
#define SCA_sl12_M_sl12Sqr(_xOp) MTH_M_xSqr(_xOp,_xOp)
|
||||
#define SCA_sl12_M_sl12Cub(_xOp) MTH_M_xMul(_xOp,MTH_M_xSqr(_xOp))
|
||||
#define SCA_sl12_M_sl12Sqrt(_xOp) MTH_M_xSqrt(_xOp)
|
||||
#define SCA_sl12_M_sl12InvSqrt(_xOp) MTH_M_xInvSqrt(_xOp)
|
||||
|
||||
#define SCA_sl12_M_sl12Sin(_xOp) MTH_M_xSin(_xOp)
|
||||
#define SCA_sl12_M_sl12Cos(_xOp) MTH_M_xSin(_xOp)
|
||||
/*
|
||||
#define sl12_M_Tan(_xOp) (SCA_sl12_fn_Tan(_xOp))
|
||||
#define sl12_M_ASin(_xOp) (SCA_sl12_fn_ASin(_xOp))
|
||||
#define sl12_M_ACos(_xOp) (SCA_sl12_fn_ACos(_xOp))
|
||||
*/
|
||||
/*
|
||||
#define sl12_M_Sin(_xOp) SCA_sl12_M_sl12DoubleToReal(sin(sl12_M_Real2Double(_xOp)))
|
||||
#define sl12_M_Cos(_xOp) SCA_sl12_M_sl12DoubleToReal(cos(sl12_M_Real2Double(_xOp)))
|
||||
*/
|
||||
|
||||
#define SCA_sl12_M_sl12Tan(_xOp) MTH_M_xTan(_xOp)
|
||||
#define SCA_sl12_M_sl12ASin(_xOp) MTH_M_xASin(_xOp)
|
||||
#define SCA_sl12_M_sl12ACos(_xOp) MTH_M_xACos(_xOp)
|
||||
|
||||
|
||||
/* ##-##############################
|
||||
## Tools for MulMatrixMatrix 3D
|
||||
################################# */
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl12_M_sl12MulSubMul
|
||||
DESCRIPTION : Return the subtraction of two multiplications
|
||||
INPUT : a, b, c, d : SCA_td_sl12
|
||||
OUTPUT : a*b - c*d : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define SCA_sl12_M_sl12MulSubMul(a, b, c, d) MTH_M_xMulSubMul(a, b, c, d)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl12_M_sl12MulAddMulAddMul
|
||||
DESCRIPTION : Return the adition of three multiplications
|
||||
INPUT : a, b, c, d, e, f : SCA_td_sl12
|
||||
OUTPUT : a*b + c*d + e*f : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define SCA_sl12_M_sl12MulAddMulAddMul(a, b, c, d, e, f) MTH_M_xMulAddMulAddMul(a, b, c, d, e, f)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl12_M_sl12SqrAddSqrAddSqr
|
||||
DESCRIPTION : Return the adition of three squares
|
||||
INPUT : a, b, c : SCA_td_sl12
|
||||
OUTPUT : a*a + b*b + c*c : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define SCA_sl12_M_sl12SqrAddSqrAddSqr(a, b, c) MTH_M_xSqrAddSqrAddSqr(a, b, c)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl12_M_sl12Mul3
|
||||
DESCRIPTION : Return the multiplication of three real numbers
|
||||
INPUT : a, b, c : SCA_td_sl12
|
||||
OUTPUT : a*b*c : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define SCA_sl12_M_sl12Mul3(a, b, c) MTH_M_xMul3(a, b, c)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl12_M_sl12Add3
|
||||
DESCRIPTION : Return the addition of three real numbers
|
||||
INPUT : a, b, c : SCA_td_sl12
|
||||
OUTPUT : a+b+c : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define SCA_sl12_M_sl12Add3(a, b, c) MTH_M_xAdd3(a, b, c)
|
||||
|
||||
#define SCA_sl12_M_sl12ACos(_xOp) MTH_M_xACos(_xOp)
|
||||
|
||||
|
||||
/* ##-##############################
|
||||
## Tools for MulMatrixMatrix 3D
|
||||
################################# */
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl12_M_sl12MulSubMul
|
||||
DESCRIPTION : Return the subtraction of two multiplications
|
||||
INPUT : a, b, c, d : SCA_td_sl12
|
||||
OUTPUT : a*b - c*d : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define SCA_sl12_M_sl12MulSubMul(a, b, c, d) MTH_M_xMulSubMul(a, b, c, d)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl12_M_sl12MulAddMulAddMul
|
||||
DESCRIPTION : Return the adition of three multiplications
|
||||
INPUT : a, b, c, d, e, f : SCA_td_sl12
|
||||
OUTPUT : a*b + c*d + e*f : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define SCA_sl12_M_sl12MulAddMulAddMul(a, b, c, d, e, f) MTH_M_xMulAddMulAddMul(a, b, c, d, e, f)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl12_M_sl12SqrAddSqrAddSqr
|
||||
DESCRIPTION : Return the adition of three squares
|
||||
INPUT : a, b, c : SCA_td_sl12
|
||||
OUTPUT : a*a + b*b + c*c : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define SCA_sl12_M_sl12SqrAddSqrAddSqr(a, b, c) MTH_M_xSqrAddSqrAddSqr(a, b, c)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl12_M_sl12Mul3
|
||||
DESCRIPTION : Return the multiplication of three real numbers
|
||||
INPUT : a, b, c : SCA_td_sl12
|
||||
OUTPUT : a*b*c : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define SCA_sl12_M_sl12Mul3(a, b, c) MTH_M_xMul3(a, b, c)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sl12_M_sl12Add3
|
||||
DESCRIPTION : Return the addition of three real numbers
|
||||
INPUT : a, b, c : SCA_td_sl12
|
||||
OUTPUT : a+b+c : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define SCA_sl12_M_sl12Add3(a, b, c) MTH_M_xAdd3(a, b, c)
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* _SCA_sl12_H_ */
|
237
Rayman_X/cpa/public/MTH/Specif/SCA/SCA_sw.h
Normal file
237
Rayman_X/cpa/public/MTH/Specif/SCA/SCA_sw.h
Normal file
@@ -0,0 +1,237 @@
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* Filename : SCA_sw.h */
|
||||
/* Author : Frederic Philippe */
|
||||
/* : Marc Trabucato */
|
||||
/* Target : PC */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------15/04/98 17:45-------------------
|
||||
* Conversion : OK (avec version 23.04.98 19:26 (18823))
|
||||
* --------------------------------------------------*/
|
||||
#ifndef _SCA_sw_H_
|
||||
#define _SCA_sw_H_
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* New */
|
||||
/*-----------------*/
|
||||
/* Fixed coma case */
|
||||
/*-----------------*/
|
||||
/* 1.15.0 */
|
||||
|
||||
/*---------------------------------*/
|
||||
/* Specific Values for fixed point */
|
||||
/*---------------------------------*/
|
||||
#define SCA_td_sw MTH_tdxReal
|
||||
|
||||
/*#define SCA_sw_C_swComaDecal 0*/
|
||||
/*#define SCA_sw_C_swComaCoef 1*/
|
||||
|
||||
/*#define SCA_sw_C_dfMax 32768*/
|
||||
/*#define SCA_sw_C_dfMin (-SCA_sw_C_dfMax)*/
|
||||
|
||||
/*#define SCA_sw_C_swMax 32767*/
|
||||
/*#define SCA_sw_C_swMin -32767*/
|
||||
/*#define SCA_sw_C_swError -32768*/
|
||||
|
||||
/*#define SCA_sw_C_swNegMask (0x8000)*/
|
||||
/*#define SCA_sw_C_swPosMask (0x7FFF)*/
|
||||
/*#define SCA_sw_C_swDecMask (0x0000)*/
|
||||
/*#define SCA_sw_C_swEntMask (0xFFFF)*/
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* ---------------- Constants ---------------------------*/
|
||||
/*--------------------------------------------------------*/
|
||||
#define SCA_sw_C_ZERO MTH_C_ZERO
|
||||
#define SCA_sw_C_ONE MTH_C_ONE
|
||||
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Conversion functions */
|
||||
/*--------------------------------------------------------*/
|
||||
__inline SCA_td_sw SCA_sw_fn_swDouble2Real( double _dfValue )
|
||||
{
|
||||
return MTH_M_xDoubleToReal( _dfValue );
|
||||
}
|
||||
/*--------------------------------------------------------*/
|
||||
__inline double SCA_sw_fn_Real2Double( SCA_td_sw _xValue )
|
||||
{
|
||||
return MTH_M_xRealToDouble( _xValue );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
/* Conversions : Macros definitions */
|
||||
/*--------------------------------------------*/
|
||||
#define SCA_sw_M_swDoubleToReal(_dfValue) MTH_M_xDoubleToReal(_dfValue)
|
||||
#define SCA_sw_M_swFloatToReal(_fValue) MTH_M_xFloatToReal(_fValue)
|
||||
#define SCA_sw_M_swIntToReal(_iValue) MTH_M_xLongToReal(_iValue) /*???*/
|
||||
|
||||
#define SCA_sw_M_RealToDouble(_xValue) MTH_M_xRealToDouble(_xValue)
|
||||
#define SCA_sw_M_RealToFloat(_xValue) MTH_M_xrealToFloat(_xValue)
|
||||
#define SCA_sw_M_RealToInt(_xValue) MTh_M_xRealToLong(_xValue) /*???*/
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Constantes */
|
||||
/*--------------------------------------------------------*/
|
||||
#define SCA_sw_C_swTwo MTH_C_2
|
||||
|
||||
/* ##CONSTANTE#--------------------------------------------------------------------------
|
||||
Real Constantes declaration
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
#define SCA_sw_C_InfinitPlus MTH_C_InfinitPlus
|
||||
#define SCA_sw_InfinitMinus MTH_C_InfinitMinus
|
||||
#define SCA_sw_EpsilonPlus MTH_C_EpsilonPlus
|
||||
#define SCA_sw_EpsilonMinus MTH_C_EpsilonMinus
|
||||
|
||||
#define SCA_sw_Pi MTH_C_Pi
|
||||
#define SCA_sw_2Pi MTH_C_2Pi
|
||||
#define SCA_sw_PiBy2 MTH_C_PiBy2
|
||||
#define SCA_sw_PiBy4 MTH_C_PiBy4
|
||||
#define SCA_sw_PiBy8 MTH_C_PiBy8
|
||||
#define SCA_sw_PiBy180 MTH_C_PiBy180
|
||||
#define SCA_sw_180ByPi MTH_C_180ByPi
|
||||
#define SCA_sw_e MTH_C_e
|
||||
|
||||
#define SCA_sw_MinusONE MTH_C_MinusONE
|
||||
|
||||
#define SCA_sw_2 MTH_C_2
|
||||
#define SCA_sw_3 MTH_C_3
|
||||
#define SCA_sw_4 MTH_C_4
|
||||
#define SCA_sw_5 MTH_C_5
|
||||
#define SCA_sw_8 (double) 8.0
|
||||
|
||||
#define SCA_sw_Minus2 MTH_C_Minus2
|
||||
#define SCA_sw_Minus3 MTH_C_Minus3
|
||||
#define SCA_sw_Minus4 MTH_C_Minus4
|
||||
#define SCA_sw_Minus5 MTH_C_Minus5
|
||||
|
||||
#define SCA_sw_Inv2 MTH_C_Inv2
|
||||
#define SCA_sw_Inv3 MTH_C_Inv3
|
||||
#define SCA_sw_Inv4 MTH_C_Inv4
|
||||
#define SCA_sw_Inv5 MTH_C_Inv5
|
||||
|
||||
#define SCA_sw_MinusInv2 MTH_C_MinusInv2
|
||||
#define SCA_sw_MinusInv3 MTH_C_MinusInv3
|
||||
#define SCA_sw_MinusInv4 MTH_C_MinusInv4
|
||||
#define SCA_sw_MinusInv5 MTH_C_MinusInv5
|
||||
|
||||
#define SCA_sw_Sqrt2 MTH_C_Sqrt2
|
||||
#define SCA_sw_Sqrt3 MTH_C_Sqrt3
|
||||
#define SCA_sw_Sqrt4 MTH_C_Sqrt4
|
||||
#define SCA_sw_Sqrt5 MTH_C_Sqrt5
|
||||
|
||||
#define SCA_sw_MinusSqrt2 MTH_C_MinusSqrt2
|
||||
#define SCA_sw_MinusSqrt3 MTH_C_MinusSqrt3
|
||||
#define SCA_sw_MinusSqrt4 MTH_C_MinusSqrt4
|
||||
#define SCA_sw_MinusSqrt5 MTH_C_MinusSqrt5
|
||||
|
||||
#define SCA_sw_InvSqrt2 MTH_C_InvSqrt2
|
||||
#define SCA_sw_InvSqrt3 MTH_C_InvSqrt3
|
||||
#define SCA_sw_InvSqrt4 MTH_C_InvSqrt4
|
||||
#define SCA_sw_InvSqrt5 MTH_C_InvSqrt5
|
||||
|
||||
#define SCA_sw_MinusInvSqrt2 MTH_C_MinusInvSqrt2
|
||||
#define SCA_sw_MinusInvSqrt3 MTH_C_MinusInvSqrt3
|
||||
#define SCA_sw_MinusInvSqrt4 MTH_C_MinusInvSqrt4
|
||||
#define SCA_sw_MinusInvSqrt5 MTH_C_MinusInvSqrt5
|
||||
|
||||
#define SCA_sw_MAX_UNSIGNED_CHAR MTH_C_MAX_UNSIGNED_CHAR
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Operations */
|
||||
/*--------------------------------------------------------*/
|
||||
/* Comparaisons */
|
||||
#define SCA_sw_M_bIsNull(_xOp) MTH_M_bIsNull(_xOp)
|
||||
#define SCA_sw_M_bEqualZero(_xOp) MTH_M_bEqualZero(_xOp)
|
||||
#define SCA_sw_M_bIsNegative(_xOp) MTH_M_bLessZero(_xOp)
|
||||
#define SCA_sw_M_bIsPositive(_xOp) MTH_M_bGreaterZero(_xOp)
|
||||
#define SCA_sw_M_bGreater(_xOp1,_xOp2) MTH_M_bGreater(_xOp1,_xOp2)
|
||||
#define SCA_sw_M_bLess(_xOp1,_xOp2) MTH_M_bLess_xOp1,_xOp2)
|
||||
#define SCA_sw_M_bGreaterEqual(_xOp1,_xOp2) MTH_M_bGreaterEqual(_xOp1,_xOp2)
|
||||
#define SCA_sw_M_bLessEqual(_xOp1,_xOp2) MTH_M_bLessEqual(_xOp1,_xOp2)
|
||||
#define SCA_sw_M_bEqual(_xOp1,_xOp2) MTH_M_bEqual(_xOp1,_xOp2)
|
||||
#define SCA_sw_M_bDifferent(_xOp1,_xOp2) MTH_M_bDifferent(_xOp1,_xOp2)
|
||||
#define SCA_sw_M_swMax(A,B) MTH_M_xMax(A,B)
|
||||
#define SCA_sw_M_swMin(A,B) MTH_M_xMin(A,B)
|
||||
|
||||
|
||||
/* Operations */
|
||||
#define SCA_sw_M_swNeg(_xOp) MTH_M_xNeg(_xOp)
|
||||
#define SCA_sw_M_swAdd(_xOp1,_xOp2) MTH_M_xAdd(_xOp1,_xOp2)
|
||||
#define SCA_sw_M_swSub(_xOp1,_xOp2) MTH_M_xsub(_xOp1,_xOp2)
|
||||
#define SCA_sw_M_swMul(_xOp1,_xOp2) MTH_M_xMul(_xOp1,_xOp2)
|
||||
#define SCA_sw_M_swDiv(_xOp1,_xOp2) MTH_M_xDiv(_xOp1,_xOp2)
|
||||
|
||||
#define SCA_sw_M_swAbs(_xOp) MTH_M_xAbs(_xOp)
|
||||
#define SCA_sw_M_swNegAbs(_xOp) MTH_M_xNegAbs(_xOp)
|
||||
#define SCA_sw_M_swInv(_xOp) MTH_M_xInv(_xOp)
|
||||
#define SCA_sw_M_swSqr(_xOp) MTH_M_xSqr(_xOp,_xOp)
|
||||
#define SCA_sw_M_swCub(_xOp) MTH_M_xMul(_xOp,MTH_M_xSqr(_xOp))
|
||||
#define SCA_sw_M_swSqrt(_xOp) MTH_M_xSqrt(_xOp)
|
||||
#define SCA_sw_M_swInvSqrt(_xOp) MTH_M_xInvSqrt(_xOp)
|
||||
|
||||
#define SCA_sw_M_swSin(_xOp) MTH_M_xSin(_xOp)
|
||||
#define SCA_sw_M_swCos(_xOp) MTH_M_xSin(_xOp)
|
||||
/*
|
||||
#define sw_M_Tan(_xOp) (SCA_sw_fn_Tan(_xOp))
|
||||
#define sw_M_ASin(_xOp) (SCA_sw_fn_ASin(_xOp))
|
||||
#define sw_M_ACos(_xOp) (SCA_sw_fn_ACos(_xOp))
|
||||
*/
|
||||
/*
|
||||
#define sw_M_Sin(_xOp) SCA_sw_M_swDoubleToReal(sin(sw_M_Real2Double(_xOp)))
|
||||
#define sw_M_Cos(_xOp) SCA_sw_M_swDoubleToReal(cos(sw_M_Real2Double(_xOp)))
|
||||
*/
|
||||
|
||||
#define SCA_sw_M_swTan(_xOp) MTH_M_xTan(_xOp)
|
||||
#define SCA_sw_M_swASin(_xOp) MTH_M_xASin(_xOp)
|
||||
#define SCA_sw_M_swACos(_xOp) MTH_M_xACos(_xOp)
|
||||
|
||||
|
||||
/* ##-##############################
|
||||
## Tools for MulMatrixMatrix 3D
|
||||
################################# */
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sw_M_swMulSubMul
|
||||
DESCRIPTION : Return the subtraction of two multiplications
|
||||
INPUT : a, b, c, d : SCA_td_sw
|
||||
OUTPUT : a*b - c*d : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define SCA_sw_M_swMulSubMul(a, b, c, d) MTH_M_xMulSubMul(a, b, c, d)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sw_M_swMulAddMulAddMul
|
||||
DESCRIPTION : Return the adition of three multiplications
|
||||
INPUT : a, b, c, d, e, f : SCA_td_sw
|
||||
OUTPUT : a*b + c*d + e*f : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define SCA_sw_M_swMulAddMulAddMul(a, b, c, d, e, f) MTH_M_xMulAddMulAddMul(a, b, c, d, e, f)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sw_M_swSqrAddSqrAddSqr
|
||||
DESCRIPTION : Return the adition of three squares
|
||||
INPUT : a, b, c : SCA_td_sw
|
||||
OUTPUT : a*a + b*b + c*c : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define SCA_sw_M_swSqrAddSqrAddSqr(a, b, c) MTH_M_xSqrAddSqrAddSqr(a, b, c)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sw_M_swMul3
|
||||
DESCRIPTION : Return the multiplication of three real numbers
|
||||
INPUT : a, b, c : SCA_td_sw
|
||||
OUTPUT : a*b*c : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define SCA_sw_M_swMul3(a, b, c) MTH_M_xMul3(a, b, c)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sw_M_swAdd3
|
||||
DESCRIPTION : Return the addition of three real numbers
|
||||
INPUT : a, b, c : SCA_td_sw
|
||||
OUTPUT : a+b+c : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define SCA_sw_M_swAdd3(a, b, c) MTH_M_xAdd3(a, b, c)
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* _SCA_sw_H_ */
|
237
Rayman_X/cpa/public/MTH/Specif/SCA/SCA_sw12.h
Normal file
237
Rayman_X/cpa/public/MTH/Specif/SCA/SCA_sw12.h
Normal file
@@ -0,0 +1,237 @@
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* Filename : SCA_sw12.h */
|
||||
/* Author : Frederic Philippe */
|
||||
/* : Marc Trabucato */
|
||||
/* Target : PC */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------15/04/98 17:45-------------------
|
||||
* Conversion : OK (avec version du 23.04.98 19:26 (19635))
|
||||
* --------------------------------------------------*/
|
||||
#ifndef _SCA_sw12_H_
|
||||
#define _SCA_sw12_H_
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* New */
|
||||
/*-----------------*/
|
||||
/* Fixed coma case */
|
||||
/*-----------------*/
|
||||
/* 1.3.12 */
|
||||
|
||||
/*---------------------------------*/
|
||||
/* Specific Values for fixed point */
|
||||
/*---------------------------------*/
|
||||
#define SCA_td_sw12 MTH_tdxReal
|
||||
|
||||
/*#define SCA_sw12_C_sw12ComaDecal 0*/
|
||||
/*#define SCA_sw12_C_sw12ComaCoef 1*/
|
||||
|
||||
/*#define SCA_sw12_C_dfMax 32768*/
|
||||
/*#define SCA_sw12_C_dfMin (-SCA_sw12_C_dfMax)*/
|
||||
|
||||
/*#define SCA_sw12_C_sw12Max 32767*/
|
||||
/*#define SCA_sw12_C_sw12Min -32767*/
|
||||
/*#define SCA_sw12_C_sw12Error -32768*/
|
||||
|
||||
/*#define SCA_sw12_C_sw12NegMask (0x8000)*/
|
||||
/*#define SCA_sw12_C_sw12PosMask (0x7FFF)*/
|
||||
/*#define SCA_sw12_C_sw12DecMask (0x0000)*/
|
||||
/*#define SCA_sw12_C_sw12EntMask (0xFFFF)*/
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* ---------------- Constants ---------------------------*/
|
||||
/*--------------------------------------------------------*/
|
||||
#define SCA_sw12_C_ZERO MTH_C_ZERO
|
||||
#define SCA_sw12_C_ONE MTH_C_ONE
|
||||
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Conversion functions */
|
||||
/*--------------------------------------------------------*/
|
||||
__inline SCA_td_sw12 SCA_sw12_fn_sw12Double2Real( double _dfValue )
|
||||
{
|
||||
return MTH_M_xDoubleToReal( _dfValue );
|
||||
}
|
||||
/*--------------------------------------------------------*/
|
||||
__inline double SCA_sw12_fn_Real2Double( SCA_td_sw12 _xValue )
|
||||
{
|
||||
return MTH_M_xRealToDouble( _xValue );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
/* Conversions : Macros definitions */
|
||||
/*--------------------------------------------*/
|
||||
#define SCA_sw12_M_sw12DoubleToReal(_dfValue) MTH_M_xDoubleToReal(_dfValue)
|
||||
#define SCA_sw12_M_sw12FloatToReal(_fValue) MTH_M_xFloatToReal(_fValue)
|
||||
#define SCA_sw12_M_sw12IntToReal(_iValue) MTH_M_xLongToReal(_iValue) /*???*/
|
||||
|
||||
#define SCA_sw12_M_RealToDouble(_xValue) MTH_M_xRealToDouble(_xValue)
|
||||
#define SCA_sw12_M_RealToFloat(_xValue) MTH_M_xrealToFloat(_xValue)
|
||||
#define SCA_sw12_M_RealToInt(_xValue) MTh_M_xRealToLong(_xValue) /*???*/
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Constantes */
|
||||
/*--------------------------------------------------------*/
|
||||
#define SCA_sw12_C_sw12Two MTH_C_2
|
||||
|
||||
/* ##CONSTANTE#--------------------------------------------------------------------------
|
||||
Real Constantes declaration
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
#define SCA_sw12_C_InfinitPlus MTH_C_InfinitPlus
|
||||
#define SCA_sw12_InfinitMinus MTH_C_InfinitMinus
|
||||
#define SCA_sw12_EpsilonPlus MTH_C_EpsilonPlus
|
||||
#define SCA_sw12_EpsilonMinus MTH_C_EpsilonMinus
|
||||
|
||||
#define SCA_sw12_Pi MTH_C_Pi
|
||||
#define SCA_sw12_2Pi MTH_C_2Pi
|
||||
#define SCA_sw12_PiBy2 MTH_C_PiBy2
|
||||
#define SCA_sw12_PiBy4 MTH_C_PiBy4
|
||||
#define SCA_sw12_PiBy8 MTH_C_PiBy8
|
||||
#define SCA_sw12_PiBy180 MTH_C_PiBy180
|
||||
#define SCA_sw12_180ByPi MTH_C_180ByPi
|
||||
#define SCA_sw12_e MTH_C_e
|
||||
|
||||
#define SCA_sw12_MinusONE MTH_C_MinusONE
|
||||
|
||||
#define SCA_sw12_2 MTH_C_2
|
||||
#define SCA_sw12_3 MTH_C_3
|
||||
#define SCA_sw12_4 MTH_C_4
|
||||
#define SCA_sw12_5 MTH_C_5
|
||||
#define SCA_sw12_8 (double) 8.0
|
||||
|
||||
#define SCA_sw12_Minus2 MTH_C_Minus2
|
||||
#define SCA_sw12_Minus3 MTH_C_Minus3
|
||||
#define SCA_sw12_Minus4 MTH_C_Minus4
|
||||
#define SCA_sw12_Minus5 MTH_C_Minus5
|
||||
|
||||
#define SCA_sw12_Inv2 MTH_C_Inv2
|
||||
#define SCA_sw12_Inv3 MTH_C_Inv3
|
||||
#define SCA_sw12_Inv4 MTH_C_Inv4
|
||||
#define SCA_sw12_Inv5 MTH_C_Inv5
|
||||
|
||||
#define SCA_sw12_MinusInv2 MTH_C_MinusInv2
|
||||
#define SCA_sw12_MinusInv3 MTH_C_MinusInv3
|
||||
#define SCA_sw12_MinusInv4 MTH_C_MinusInv4
|
||||
#define SCA_sw12_MinusInv5 MTH_C_MinusInv5
|
||||
|
||||
#define SCA_sw12_Sqrt2 MTH_C_Sqrt2
|
||||
#define SCA_sw12_Sqrt3 MTH_C_Sqrt3
|
||||
#define SCA_sw12_Sqrt4 MTH_C_Sqrt4
|
||||
#define SCA_sw12_Sqrt5 MTH_C_Sqrt5
|
||||
|
||||
#define SCA_sw12_MinusSqrt2 MTH_C_MinusSqrt2
|
||||
#define SCA_sw12_MinusSqrt3 MTH_C_MinusSqrt3
|
||||
#define SCA_sw12_MinusSqrt4 MTH_C_MinusSqrt4
|
||||
#define SCA_sw12_MinusSqrt5 MTH_C_MinusSqrt5
|
||||
|
||||
#define SCA_sw12_InvSqrt2 MTH_C_InvSqrt2
|
||||
#define SCA_sw12_InvSqrt3 MTH_C_InvSqrt3
|
||||
#define SCA_sw12_InvSqrt4 MTH_C_InvSqrt4
|
||||
#define SCA_sw12_InvSqrt5 MTH_C_InvSqrt5
|
||||
|
||||
#define SCA_sw12_MinusInvSqrt2 MTH_C_MinusInvSqrt2
|
||||
#define SCA_sw12_MinusInvSqrt3 MTH_C_MinusInvSqrt3
|
||||
#define SCA_sw12_MinusInvSqrt4 MTH_C_MinusInvSqrt4
|
||||
#define SCA_sw12_MinusInvSqrt5 MTH_C_MinusInvSqrt5
|
||||
|
||||
#define SCA_sw12_MAX_UNSIGNED_CHAR MTH_C_MAX_UNSIGNED_CHAR
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* Operations */
|
||||
/*--------------------------------------------------------*/
|
||||
/* Comparaisons */
|
||||
#define SCA_sw12_M_bIsNull(_xOp) MTH_M_bIsNull(_xOp)
|
||||
#define SCA_sw12_M_bEqualZero(_sw12Op) MTH_M_bEqualZero(_sw12Op)
|
||||
#define SCA_sw12_M_bIsNegative(_xOp) MTH_M_bLessZero((_xOp)
|
||||
#define SCA_sw12_M_bIsPositive(_xOp) MTH_M_bGreaterZero(_xOp)
|
||||
#define SCA_sw12_M_bGreater(_xOp1,_xOp2) MTH_M_bGreater(_xOp1,_xOp2)
|
||||
#define SCA_sw12_M_bLess(_xOp1,_xOp2) MTH_M_bLess_xOp1,_xOp2)
|
||||
#define SCA_sw12_M_bGreaterEqual(_xOp1,_xOp2) MTH_M_bGreaterEqual(_xOp1,_xOp2)
|
||||
#define SCA_sw12_M_bLessEqual(_xOp1,_xOp2) MTH_M_bLessEqual(_xOp1,_xOp2)
|
||||
#define SCA_sw12_M_bEqual(_xOp1,_xOp2) MTH_M_bEqual(_xOp1,_xOp2)
|
||||
#define SCA_sw12_M_bDifferent(_xOp1,_xOp2) MTH_M_bDifferent(_xOp1,_xOp2)
|
||||
#define SCA_sw12_M_sw12Max(A,B) MTH_M_xMax(A,B)
|
||||
#define SCA_sw12_M_sw12Min(A,B) MTH_M_xMin(A,B)
|
||||
|
||||
/* Operations */
|
||||
#define SCA_sw12_M_sw12Neg(_xOp) MTH_M_xNeg(_xOp)
|
||||
#define SCA_sw12_M_sw12Add(_xOp1,_xOp2) MTH_M_xAdd(_xOp1,_xOp2)
|
||||
#define SCA_sw12_M_sw12Sub(_xOp1,_xOp2) MTH_M_xsub(_xOp1,_xOp2)
|
||||
#define SCA_sw12_M_sw12Mul(_xOp1,_xOp2) MTH_M_xMul(_xOp1,_xOp2)
|
||||
#define SCA_sw12_M_sw12Div(_xOp1,_xOp2) MTH_M_xDiv(_xOp1,_xOp2)
|
||||
|
||||
#define SCA_sw12_M_sw12Abs(_xOp) MTH_M_xAbs(_xOp)
|
||||
#define SCA_sw12_M_sw12NegAbs(_xOp) MTH_M_xNegAbs(_xOp)
|
||||
#define SCA_sw12_M_sw12Inv(_xOp) MTH_M_xInv(_xOp)
|
||||
#define SCA_sw12_M_sw12Sqr(_xOp) MTH_M_xSqr(_xOp,_xOp)
|
||||
#define SCA_sw12_M_sw12Cub(_xOp) MTH_M_xMul(_xOp,MTH_M_xSqr(_xOp))
|
||||
#define SCA_sw12_M_sw12Sqrt(_xOp) MTH_M_xSqrt(_xOp)
|
||||
#define SCA_sw12_M_sw12InvSqrt(_xOp) MTH_M_xInvSqrt(_xOp)
|
||||
|
||||
#define SCA_sw12_M_sw12Sin(_xOp) MTH_M_xSin(_xOp)
|
||||
#define SCA_sw12_M_sw12Cos(_xOp) MTH_M_xSin(_xOp)
|
||||
/*
|
||||
#define sw12_M_Tan(_xOp) (SCA_sw12_fn_Tan(_xOp))
|
||||
#define sw12_M_ASin(_xOp) (SCA_sw12_fn_ASin(_xOp))
|
||||
#define sw12_M_ACos(_xOp) (SCA_sw12_fn_ACos(_xOp))
|
||||
*/
|
||||
/*
|
||||
#define sw12_M_Sin(_xOp) SCA_sw12_M_sw12DoubleToReal(sin(sw12_M_Real2Double(_xOp)))
|
||||
#define sw12_M_Cos(_xOp) SCA_sw12_M_sw12DoubleToReal(cos(sw12_M_Real2Double(_xOp)))
|
||||
*/
|
||||
|
||||
#define SCA_sw12_M_sw12Tan(_xOp) MTH_M_xTan(_xOp)
|
||||
#define SCA_sw12_M_sw12ASin(_xOp) MTH_M_xASin(_xOp)
|
||||
#define SCA_sw12_M_sw12ACos(_xOp) MTH_M_xACos(_xOp)
|
||||
|
||||
|
||||
/* ##-##############################
|
||||
## Tools for MulMatrixMatrix 3D
|
||||
################################# */
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sw12_M_sw12MulSubMul
|
||||
DESCRIPTION : Return the subtraction of two multiplications
|
||||
INPUT : a, b, c, d : SCA_td_sw12
|
||||
OUTPUT : a*b - c*d : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define SCA_sw12_M_sw12MulSubMul(a, b, c, d) MTH_M_xMulSubMul(a, b, c, d)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sw12_M_sw12MulAddMulAddMul
|
||||
DESCRIPTION : Return the adition of three multiplications
|
||||
INPUT : a, b, c, d, e, f : SCA_td_sw12
|
||||
OUTPUT : a*b + c*d + e*f : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define SCA_sw12_M_sw12MulAddMulAddMul(a, b, c, d, e, f) MTH_M_xMulAddMulAddMul(a, b, c, d, e, f)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sw12_M_sw12SqrAddSqrAddSqr
|
||||
DESCRIPTION : Return the adition of three squares
|
||||
INPUT : a, b, c : SCA_td_sw12
|
||||
OUTPUT : a*a + b*b + c*c : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define SCA_sw12_M_sw12SqrAddSqrAddSqr(a, b, c) MTH_M_xSqrAddSqrAddSqr(a, b, c)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sw12_M_sw12Mul3
|
||||
DESCRIPTION : Return the multiplication of three real numbers
|
||||
INPUT : a, b, c : SCA_td_sw12
|
||||
OUTPUT : a*b*c : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define SCA_sw12_M_sw12Mul3(a, b, c) MTH_M_xMul3(a, b, c)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : SCA_sw12_M_sw12Add3
|
||||
DESCRIPTION : Return the addition of three real numbers
|
||||
INPUT : a, b, c : SCA_td_sw12
|
||||
OUTPUT : a+b+c : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define SCA_sw12_M_sw12Add3(a, b, c) MTH_M_xAdd3(a, b, c)
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* _SCA_sw12_H_ */
|
||||
|
78
Rayman_X/cpa/public/MTH/Specif/SCA/converse.h
Normal file
78
Rayman_X/cpa/public/MTH/Specif/SCA/converse.h
Normal file
@@ -0,0 +1,78 @@
|
||||
/*--------------------------------*/
|
||||
/* Conversion of numericals types */
|
||||
/*--------------------------------*/
|
||||
/* Version 1.0 */
|
||||
/* Author : S Leroy */
|
||||
/* Date : 4/03/98 */
|
||||
/* Modification : 4/03/98 */
|
||||
/*--------------------------------*/
|
||||
/* PC Version by M Trabucato */
|
||||
/*--------------------------------*/
|
||||
/* Conversion : OK (avec version 27.04.98 12:03 (11041)) */
|
||||
/*--------------------------------*/
|
||||
|
||||
#ifndef _CONVERSE_H_
|
||||
#define _CONVERSE_H_
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#include "MTH\Specif\SCA\SCA_sl12.h"
|
||||
#include "MTH\Specif\SCA\SCA_sl.h"
|
||||
#include "MTH\Specif\SCA\SCA_sw12.h"
|
||||
#include "MTH\Specif\SCA\SCA_sw.h"
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#define SCA_M_sw12_Div_SwBySw(a,b) MTH_M_xDiv(a,b)
|
||||
#define SCA_M_sw_Div_SwBySl12(a,b) MTH_M_xDiv(a,b)
|
||||
#define SCA_M_sl12_Div_SlBySl(a,b) MTH_M_xDiv(a,b)
|
||||
#define SCA_M_sl12_Div_SwBySw(a,b) MTH_M_xDiv(a,b)
|
||||
|
||||
|
||||
/* sl <- sl12 * sl */
|
||||
#define SCA_M_sl_Mul_Sl12BySl(a,b) MTH_M_xMul(a,b)
|
||||
#define SCA_M_sl_Mul_Sw12BySw(a,b) MTH_M_xMul(a,b)
|
||||
#define SCA_M_sl_Mul_Sl12BySl(a,b) MTH_M_xMul(a,b)
|
||||
#define SCA_M_sl_Mul_Sl12BySw(a,b) MTH_M_xMul(a,b)
|
||||
#define SCA_M_sw_Mul_Sw12BySw(a,b) MTH_M_xMul(a,b)
|
||||
|
||||
/*------------*/
|
||||
/* sl <- sw^2 */
|
||||
/*------------*/
|
||||
#define SCA_M_sl_Sqr_sw(_xOp) MTH_M_xSqr(_xOp)
|
||||
|
||||
|
||||
/* Macro definitions */
|
||||
#define SCA_M_converse_scTosl12(_sc) (_sc)
|
||||
|
||||
#define SCA_M_converse_swTosl(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_swTosw12(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_swTosl12(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_slTosw(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_slTosw12(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_slTosl12(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_sl12Tosl(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_sl12Tosw(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_sl12Tosw12(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_sw12Tosl12(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_sw12Tosw(_sl12Value) (_sl12Value)
|
||||
#define SCA_M_converse_sw12Tosl(_sl12Value) (_sl12Value)
|
||||
|
||||
/* ShortCuts */
|
||||
#define scTosl12(_sc) SCA_M_converse_scTosl12(_sc)
|
||||
#define swTosl(_sl12Value) SCA_M_converse_swTosl(_sl12Value)
|
||||
#define swTosw12(_sl12Value) SCA_M_converse_swTosw12(_sl12Value)
|
||||
#define swTosl12(_sl12Value) SCA_M_converse_swTosl12(_sl12Value)
|
||||
#define slTosw(_sl12Value) SCA_M_converse_slTosw(_sl12Value)
|
||||
#define slTosw12(_sl12Value) SCA_M_converse_slTosw12(_sl12Value)
|
||||
#define slTosl12(_sl12Value) SCA_M_converse_slTosl12(_sl12Value)
|
||||
#define sl12Tosl(_sl12Value) SCA_M_converse_sl12Tosl(_sl12Value)
|
||||
#define sl12Tosw(_sl12Value) SCA_M_converse_sl12Tosw(_sl12Value)
|
||||
#define sl12Tosw12(_sl12Value) SCA_M_converse_sl12Tosw12(_sl12Value)
|
||||
#define sw12Tosl12(_sl12Value) SCA_M_converse_sw12Tosl12(_sl12Value)
|
||||
#define sw12Tosw(_sl12Value) SCA_M_converse_sw12Tosw(_sl12Value)
|
||||
#define sw12Tosl(_sl12Value) SCA_M_converse_sw12Tosl(_sl12Value)
|
||||
#define EntDecTosl12(_xEnt,_xDec) (MTH_M_xAdd(_xEnt,(MTH_M_xDiv(_Dec,MTH_M_xLongtoReal(10000)))))
|
||||
|
||||
|
||||
#endif /* _CONVERSE_H_ */
|
72
Rayman_X/cpa/public/MTH/Specif/SCA/sl.h
Normal file
72
Rayman_X/cpa/public/MTH/Specif/SCA/sl.h
Normal file
@@ -0,0 +1,72 @@
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* Filename : sl.h */
|
||||
/* Author : Frederic Philippe */
|
||||
/* : Marc Trabucato */
|
||||
/* Target : PC */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------15/04/98 17:45-------------------
|
||||
* Conversion : useless (avec version 24.04.98 11:32 (2513))
|
||||
* --------------------------------------------------*/
|
||||
#ifndef _sl_H_
|
||||
#define _sl_H_
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#include "MTH\Specif\SCA\SCA_sl.h"
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* Define the type DNM_tdxReal */
|
||||
#define td_sl SCA_td_sl
|
||||
|
||||
/* Constants */
|
||||
#define sl_ZERO SCA_sl_C_ZERO
|
||||
#define sl_ONE SCA_sl_C_ONE
|
||||
|
||||
/* Comparisons */
|
||||
#define sl_bGreater(_slOp1,_slOp2) SCA_sl_M_bGreater(_slOp1,_slOp2)
|
||||
#define sl_bGreaterEqual(_slOp1,_slOp2) SCA_sl_M_bGreaterEqual(_slOp1,_slOp2)
|
||||
#define sl_bLess(_slOp1,_slOp2) SCA_sl_M_bLess(_slOp1,_slOp2)
|
||||
#define sl_bLessEqual(_slOp1,_slOp2) SCA_sl_M_bLessEqual(_slOp1,_slOp2)
|
||||
#define sl_bEqual(_slOp1,_slOp2) SCA_sl_M_bEqual(_slOp1,_slOp2)
|
||||
#define sl_bDiferent(_slOp1,_slOp2) SCA_sl_M_bDifferent(_slOp1,_slOp2)
|
||||
#define sl_bIsNull(_slOp) SCA_sl_M_bIsNull(_slOp)
|
||||
#define sl_bEqualZero(_slOp) SCA_sl_M_bIsNull(_slOp)
|
||||
#define sl_bGreaterZero( A ) sl_bGreater( (A), sl_ZERO )
|
||||
#define sl_bLessZero( A ) sl_bLess( (A), sl_ZERO )
|
||||
#define sl_bDifferentZero( A ) sl_bDiferent( (A), sl_ZERO )
|
||||
|
||||
/* Conversions : Macros definitions */
|
||||
#define DoubleTosl(_dfValue) SCA_sl_M_slDoubleToReal(_dfValue)
|
||||
#define FloatTosl(_fValue) SCA_sl_M_slFloatToReal(_fValue)
|
||||
#define IntTosl(_iValue) SCA_sl_M_slIntToReal(_iValue)
|
||||
|
||||
#define sl12ToDouble(_sl12Value) SCA_sl12_M_RealToDouble(_sl12Value)
|
||||
#define sl12ToFloat(_sl12Value) SCA_sl12_M_RealToFloat(_sl12Value)
|
||||
#define sl12ToInt(_sl12Value) SCA_sl12_M_RealToInt(_sl12Value)
|
||||
|
||||
/* Operations */
|
||||
#define sl_Add(_slOp1,_slOp2) SCA_sl_M_slAdd(_slOp1,_slOp2)
|
||||
#define sl_Sub(_slOp1,_slOp2) SCA_sl_M_slSub(_slOp1,_slOp2)
|
||||
#define sl_Mul(_slOp1,_slOp2) SCA_sl_M_slMul(_slOp1,_slOp2)
|
||||
#define sl_Div(_slOp1,_slOp2) SCA_sl_M_slDiv(_slOp1,_slOp2)
|
||||
|
||||
#define sl_Inv(_slOp) SCA_sl_M_slInv(_slOp)
|
||||
#define sl_Neg(_slOp) SCA_sl_M_slNeg(_slOp)
|
||||
#define sl_Sqr(_slOp) sl_Mul(_slOp,_slOp)
|
||||
#define sl_Cub(_slOp) sl_Mul(_slOp,sl_Sqr(_slOp))
|
||||
#define sl_Sqrt(_slOp) SCA_sl_M_slSqrt(_slOp)
|
||||
#define sl_Abs(_slOp) SCA_sl_M_slAbs(_slOp)
|
||||
#define sl_Add3(a,b,c) SCA_sl_M_slAdd3(a,b,c)
|
||||
|
||||
#define sl_Sin(_slOp) SCA_sl_M_slSin(_slOp)
|
||||
#define sl_Cos(_slOp) SCA_sl_M_slCos(_slOp)
|
||||
#define sl_Tan(_slOp) SCA_sl_M_slTan(_slOp)
|
||||
|
||||
#define sl_ASin(_slOp) SCA_sl_M_slASin(_slOp)
|
||||
#define sl_ACos(_slOp) SCA_sl_M_slACos(_slOp)
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
70
Rayman_X/cpa/public/MTH/Specif/SCA/sl12.h
Normal file
70
Rayman_X/cpa/public/MTH/Specif/SCA/sl12.h
Normal file
@@ -0,0 +1,70 @@
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* Filename : sl12.h */
|
||||
/* Author : Frederic Philippe */
|
||||
/* : Marc Trabucato */
|
||||
/* Target : PC */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------15/04/98 15:58----------------------------
|
||||
* Conversion : useless (avec version 23.04.98 19:58 (2667))
|
||||
* -----------------------------------------------------------*/
|
||||
|
||||
#ifndef _SL12_H_
|
||||
#define _SL12_H_
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#include "MTH\Specif\SCA\SCA_sl12.h"
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* Define the type DNM_tdxReal */
|
||||
#define td_sl12 SCA_td_sl12
|
||||
|
||||
/* Constants */
|
||||
#define sl12_ZERO SCA_sl12_C_ZERO
|
||||
#define sl12_ONE SCA_sl12_C_ONE
|
||||
|
||||
/* Conversions : Macros definitions */
|
||||
#define DoubleTosl12(_dfValue) SCA_sl12_M_sl12DoubleToReal(_dfValue)
|
||||
#define FloatTosl12(_fValue) SCA_sl12_M_sl12FloatToReal(_fValue)
|
||||
#define IntTosl12(_iValue) SCA_sl12_M_sl12IntToReal(_iValue)
|
||||
|
||||
#define sl12ToDouble(_sl12Value) SCA_sl12_M_RealToDouble(_sl12Value)
|
||||
#define sl12ToFloat(_sl12Value) SCA_sl12_M_RealToFloat(_sl12Value)
|
||||
#define sl12ToInt(_sl12Value) SCA_sl12_M_RealToInt(_sl12Value)
|
||||
|
||||
/* Comparisons */
|
||||
#define sl12_bGreater(_sl12Op1,_sl12Op2) SCA_sl12_M_bGreater(_sl12Op1,_sl12Op2)
|
||||
#define sl12_bGreaterEqual(_sl12Op1,_sl12Op2) SCA_sl12_M_bGreaterEqual(_sl12Op1,_sl12Op2)
|
||||
#define sl12_bLess(_sl12Op1,_sl12Op2) SCA_sl12_M_bLess(_sl12Op1,_sl12Op2)
|
||||
#define sl12_bLessEqual(_sl12Op1,_sl12Op2) SCA_sl12_M_bLessEqual(_sl12Op1,_sl12Op2)
|
||||
#define sl12_bEqual(_sl12Op1,_sl12Op2) SCA_sl12_M_bEqual(_sl12Op1,_sl12Op2)
|
||||
#define sl12_bDiferent(_sl12Op1,_sl12Op2) SCA_sl12_M_bDifferent(_sl12Op1,_sl12Op2)
|
||||
#define sl12_bEqualZero(_sl12Op1) SCA_sl12_M_bIsNull(_sl12Op1)
|
||||
#define sl12_bIsNull(_sl12Op1) SCA_sl12_M_bIsNull(_sl12Op1)
|
||||
#define sl12_bInUnitEqual( x ) MTH_M_bInUnitEqual(x)
|
||||
|
||||
/* Operations */
|
||||
#define sl12_Add(_sl12Op1,_sl12Op2) SCA_sl12_M_sl12Add(_sl12Op1,_sl12Op2)
|
||||
#define sl12_Sub(_sl12Op1,_sl12Op2) SCA_sl12_M_sl12Sub(_sl12Op1,_sl12Op2)
|
||||
#define sl12_Mul(_sl12Op1,_sl12Op2) SCA_sl12_M_sl12Mul(_sl12Op1,_sl12Op2)
|
||||
#define sl12_Div(_sl12Op1,_sl12Op2) SCA_sl12_M_sl12Div(_sl12Op1,_sl12Op2)
|
||||
|
||||
#define sl12_Inv(_sl12Op) SCA_sl12_M_sl12Inv(_sl12Op)
|
||||
#define sl12_Neg(_sl12Op) SCA_sl12_M_sl12Neg(_sl12Op)
|
||||
#define sl12_Sqr(_sl12Op) SCA_sl12_M_sl12Sqr(_sl12Op)
|
||||
#define sl12_Cub(_sl12Op) sl12_Mul(_sl12Op,sl12_Sqr(_sl12Op))
|
||||
#define sl12_Sqrt(_sl12Op) SCA_sl12_M_sl12Sqrt(_sl12Op)
|
||||
#define sl12_Abs(_sl12Op) SCA_sl12_M_sl12Abs(_sl12Op)
|
||||
|
||||
#define sl12_Sin(_sl12Op) SCA_sl12_M_sl12Sin(_sl12Op)
|
||||
#define sl12_Cos(_sl12Op) SCA_sl12_M_sl12Cos(_sl12Op)
|
||||
#define sl12_Tan(_sl12Op) SCA_sl12_M_sl12Tan(_sl12Op)
|
||||
|
||||
#define sl12_ASin(_sl12Op) SCA_sl12_M_sl12ASin(_sl12Op)
|
||||
#define sl12_ACos(_sl12Op) SCA_sl12_M_sl12ACos(_sl12Op)
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* _SL12_H_ */
|
64
Rayman_X/cpa/public/MTH/Specif/SCA/sw.h
Normal file
64
Rayman_X/cpa/public/MTH/Specif/SCA/sw.h
Normal file
@@ -0,0 +1,64 @@
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* Filename : sw.h */
|
||||
/* Author : Frederic Philippe */
|
||||
/* : Marc Trabucato */
|
||||
/* Target : PC */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------15/04/98 15:58-------------------
|
||||
* Conversion : useless (avec version 23.04.98 19:58 (2066))
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#ifndef _SW_H_
|
||||
#define _SW_H_
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#include "MTH\Specif\SCA\SCA_sw.h"
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* Define the type DNM_tdxReal */
|
||||
#define td_sw SCA_td_sw
|
||||
|
||||
/* Constants */
|
||||
#define sw_ZERO SCA_sw_C_ZERO
|
||||
#define sw_ONE SCA_sw_C_ONE
|
||||
#define sw_TWO 8192
|
||||
|
||||
/* Comparisons */
|
||||
#define sw_bGreater(_swOp1,_swOp2) SCA_sw_M_bGreater(_swOp1,_swOp2)
|
||||
#define sw_bGreaterEqual(_swOp1,_swOp2) SCA_sw_M_bGreaterEqual(_swOp1,_swOp2)
|
||||
#define sw_bLess(_swOp1,_swOp2) SCA_sw_M_bLess(_swOp1,_swOp2)
|
||||
#define sw_bLessEqual(_swOp1,_swOp2) SCA_sw_M_bLessEqual(_swOp1,_swOp2)
|
||||
#define sw_bEqual(_swOp1,_swOp2) SCA_sw_M_bEqual(_swOp1,_swOp2)
|
||||
#define sw_bDiferent(_swOp1,_swOp2) SCA_sw_M_bDifferent(_swOp1,_swOp2)
|
||||
#define sw_bIsNull(_swOp) SCA_sw_M_bIsNull(_swOp)
|
||||
#define sw_bGreaterZero( A ) sw_bGreater( (A), sw_ZERO )
|
||||
#define sw_bGreaterEqualZero( A ) sw_bGreaterEqual( (A), sw_ZERO )
|
||||
#define sw_bLessZero( A ) sw_bLess( (A), sw_ZERO )
|
||||
#define sw_bLessEqualZero( A ) sw_bLessEqual( (A), sw_ZERO )
|
||||
|
||||
/* Operations */
|
||||
#define sw_Add(_swOp1,_swOp2) SCA_sw_M_swAdd(_swOp1,_swOp2)
|
||||
#define sw_Sub(_swOp1,_swOp2) SCA_sw_M_swSub(_swOp1,_swOp2)
|
||||
#define sw_Mul(_swOp1,_swOp2) SCA_sw_M_swMul(_swOp1,_swOp2)
|
||||
#define sw_Div(_swOp1,_swOp2) SCA_sw_M_swDiv(_swOp1,_swOp2)
|
||||
|
||||
#define sw_Inv(_swOp) SCA_sw_M_swInv(_swOp)
|
||||
#define sw_Neg(_swOp) SCA_sw_M_swNeg(_swOp)
|
||||
#define sw_Sqr(_swOp) SCA_sw_M_swSqr(_swOp)
|
||||
#define sw_Cub(_swOp) sw_Mul(_swOp,sw_Sqr(_swOp))
|
||||
#define sw_Sqrt(_swOp) SCA_sw_M_swSqrt(_swOp)
|
||||
#define sw_Abs(_swOp) SCA_sw_M_swAbs(_swOp)
|
||||
|
||||
#define sw_Sin(_swOp) SCA_sw_M_swSin(_swOp)
|
||||
#define sw_Cos(_swOp) SCA_sw_M_swCos(_swOp)
|
||||
#define sw_Tan(_swOp) SCA_sw_M_swTan(_swOp)
|
||||
|
||||
#define sw_ASin(_swOp) SCA_sw_M_swASin(_swOp)
|
||||
#define sw_ACos(_swOp) SCA_sw_M_swACos(_swOp)
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* _SW_H_ */
|
62
Rayman_X/cpa/public/MTH/Specif/SCA/sw12.h
Normal file
62
Rayman_X/cpa/public/MTH/Specif/SCA/sw12.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* Filename : sw12.h */
|
||||
/* Author : Frederic Philippe */
|
||||
/* : Marc Trabucato */
|
||||
/* Target : PC */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* -----------------15/04/98 15:58-------------------
|
||||
* Conversion : OK (avec version 24.08.98 16:46 (2231))
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#ifndef _SW12_H_
|
||||
#define _SW12_H_
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#include "MTH\Specif\SCA\SCA_sw12.h"
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
/* Define the type DNM_tdxReal */
|
||||
#define td_sw12 SCA_td_sw12
|
||||
|
||||
/* Constants */
|
||||
#define sw12_ZERO SCA_sw12_C_ZERO
|
||||
#define sw12_ONE SCA_sw12_C_ONE
|
||||
|
||||
/* Comparisons */
|
||||
#define sw12_bGreater(_sw12Op1,_sw12Op2) SCA_sw12_M_bGreater(_sw12Op1,_sw12Op2)
|
||||
#define sw12_bGreaterEqual(_sw12Op1,_sw12Op2) SCA_sw12_M_bGreaterEqual(_sw12Op1,_sw12Op2)
|
||||
#define sw12_bLess(_sw12Op1,_sw12Op2) SCA_sw12_M_bLess(_sw12Op1,_sw12Op2)
|
||||
#define sw12_bLessEqual(_sw12Op1,_sw12Op2) SCA_sw12_M_bLessEqual(_sw12Op1,_sw12Op2)
|
||||
#define sw12_bEqual(_sw12Op1,_sw12Op2) SCA_sw12_M_bEqual(_sw12Op1,_sw12Op2)
|
||||
#define sw12_bDiferent(_sw12Op1,_sw12Op2) SCA_sw12_M_bDifferent(_sw12Op1,_sw12Op2)
|
||||
#define sw12_bIsNull(_sw12Op1,_sw12Op2) SCA_sw12_M_bIsNull(_sw12Op1,_sw12Op2)
|
||||
|
||||
/* Operations */
|
||||
#define sw12_Add(_sw12Op1,_sw12Op2) SCA_sw12_M_sw12Add(_sw12Op1,_sw12Op2)
|
||||
#define sw12_Sub(_sw12Op1,_sw12Op2) SCA_sw12_M_sw12Sub(_sw12Op1,_sw12Op2)
|
||||
#define sw12_Mul(_sw12Op1,_sw12Op2) SCA_sw12_M_sw12Mul(_sw12Op1,_sw12Op2)
|
||||
#define sw12_Div(_sw12Op1,_sw12Op2) SCA_sw12_M_sw12Div(_sw12Op1,_sw12Op2)
|
||||
|
||||
#define sw12_Add3(_sw12Op1,_sw12Op2,_sw12Op3) sw12_Add(_sw12Op1,sw12_Add(_sw12Op2,_sw12Op3))
|
||||
#define sw12_Mul3(_sw12Op1,_sw12Op2,_sw12Op3) sw12_Mul(_sw12Op1,sw12_Mul(_sw12Op2,_sw12Op3))
|
||||
|
||||
#define sw12_Inv(_sw12Op) SCA_sw12_M_sw12Inv(_sw12Op)
|
||||
#define sw12_Neg(_sw12Op) SCA_sw12_M_sw12Neg(_sw12Op)
|
||||
#define sw12_Sqr(_sw12Op) SCA_sw12_M_sw12Sqr(_sw12Op)
|
||||
#define sw12_Cub(_sw12Op) sw12_Mul(_sw12Op,sw12_Sqr(_sw12Op))
|
||||
#define sw12_Sqrt(_sw12Op) SCA_sw12_M_sw12Sqrt(_sw12Op)
|
||||
#define sw12_Abs(_sw12Op) SCA_sw12_M_sw12Abs(_sw12Op)
|
||||
|
||||
#define sw12_Sin(_sw12Op) SCA_sw12_M_sw12Sin(_sw12Op)
|
||||
#define sw12_Cos(_sw12Op) SCA_sw12_M_sw12Cos(_sw12Op)
|
||||
#define sw12_Tan(_sw12Op) SCA_sw12_M_sw12Tan(_sw12Op)
|
||||
|
||||
#define sw12_ASin(_sw12Op) SCA_sw12_M_sw12ASin(_sw12Op)
|
||||
#define sw12_ACos(_sw12Op) SCA_sw12_M_sw12ACos(_sw12Op)
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
|
||||
#endif /* _SW12_H_ */
|
323
Rayman_X/cpa/public/MTH/Specif/VEC/3D_conv.h
Normal file
323
Rayman_X/cpa/public/MTH/Specif/VEC/3D_conv.h
Normal file
@@ -0,0 +1,323 @@
|
||||
/*--------------------------------*/
|
||||
/* Conversion of numericals types */
|
||||
/*--------------------------------*/
|
||||
/* Version 1.0 */
|
||||
/* Author : S Leroy */
|
||||
/* Date : 5/03/98 */
|
||||
/* Modification : 9/03/98 */
|
||||
/*--------------------------------*/
|
||||
/* PC Version by M Trabucato */
|
||||
/*--------------------------------*/
|
||||
/* Conversion : OK (avec version 27.04.98 11:35 (22582) */
|
||||
/*--------------------------------*/
|
||||
|
||||
#ifndef _3DCONV_H_
|
||||
#define _3DCONV_H_
|
||||
|
||||
#include "MTH\Specif\VEC\sl12_3D.h"
|
||||
#include "MTH\Specif\VEC\sl_3D.h"
|
||||
#include "MTH\Specif\VEC\sw12_3D.h"
|
||||
#include "MTH\Specif\VEC\sw_3D.h"
|
||||
#include "MTH\Specif\SCA\converse.h"
|
||||
|
||||
/*--------------------------------------*/
|
||||
/* 2D Vector Outer Product */
|
||||
/*--------------------------------------*/
|
||||
__inline SCA_td_sl sl_fn_2DOuterProduct(
|
||||
SCA_td_sl x0,
|
||||
SCA_td_sl y0,
|
||||
SCA_td_sl x1,
|
||||
SCA_td_sl y1,
|
||||
SCA_td_sl x2,
|
||||
SCA_td_sl y2
|
||||
)
|
||||
{
|
||||
return MTH_M_xAdd3( MTH_M_xMul( x0 , MTH_M_xSub( y1 , y2 ) ) ,
|
||||
MTH_M_xMul( x1 , MTH_M_xSub( y2 , y0 ) ) ,
|
||||
MTH_M_xMul( x2 , MTH_M_xSub( y0 , y1 ) ) );
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
/* Vector Conversion */
|
||||
/*--------------------------------------------*/
|
||||
/* Vector Normalisation */
|
||||
__inline sw12_3D_tdstVector * VEC_p_sw12_3DNormalise_sl3D(
|
||||
sw12_3D_tdstVector * _p_stsw12_3D_Dest,
|
||||
sw12_3D_tdstVector * _p_stsl3_DSrc
|
||||
)
|
||||
{
|
||||
MTH3D_M_vNormalizeVector(_p_stsw12_3D_Dest,_p_stsl3_DSrc);
|
||||
return _p_stsw12_3D_Dest;
|
||||
}
|
||||
|
||||
/*------------------------------*/
|
||||
/* sw12_3D <- Normalise (sl_3D) */
|
||||
/*------------------------------*/
|
||||
__inline sw12_3D_tdstVector * VEC_p_sw12_3DNormalize_sw3D(
|
||||
sw12_3D_tdstVector * _p_stsw12_3D_Dest,
|
||||
sw_3D_tdstVector * _p_stsw_3DSrc
|
||||
)
|
||||
{
|
||||
MTH3D_M_vNormalizeVector(_p_stsw12_3D_Dest,_p_stsw_3DSrc);
|
||||
return _p_stsw12_3D_Dest;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------*/
|
||||
/* sw12_3D <- Normalise (sl12_3D) */
|
||||
/*--------------------------------*/
|
||||
__inline sw12_3D_tdstVector * VEC_p_sw12_3DNormalize_sl123D(
|
||||
sw12_3D_tdstVector * _p_stsw12_3D_Dest,
|
||||
sl12_3D_tdstVector * _p_stsl12_3DSrc
|
||||
)
|
||||
{
|
||||
MTH3D_M_vNormalizeVector(_p_stsw12_3D_Dest,_p_stsl12_3DSrc);
|
||||
return _p_stsw12_3D_Dest;
|
||||
}
|
||||
|
||||
|
||||
/*--------------------------------*/
|
||||
/* Vector Normalisation functions */
|
||||
/*--------------------------------*/
|
||||
#define sw12_3D_vNormalizeVector_Dsw12_Ssl(VectDest, VectA) VEC_p_sw12_3DNormalize_sl3D(VectDest, VectA)
|
||||
#define sw12_3D_vNormalizeVector_Dsw12_Ssl12(VectDest, VectA) VEC_p_sw12_3DNormalize_sl123D(VectDest, VectA)
|
||||
#define sw12_3D_vNormalizeVector_Dsw12_Ssw(VectDest, VectA) VEC_p_sw12_3DNormalize_sw3D(VectDest, VectA)
|
||||
#define sw12_3D_vNormalizeVector_Dsw12_Ssw12(VectDest, VectA) VEC_p_sw12_3DNormalize_sw3D(VectDest, VectA)
|
||||
|
||||
|
||||
/*--------------------------------------------*/
|
||||
/* Vector Conversion */
|
||||
/*--------------------------------------------*/
|
||||
/* Conversion sw3D in sl3D */
|
||||
__inline sl_3D_tdstVector * VEC_p_sw3DConverse_sw3DTosl3D(
|
||||
sl_3D_tdstVector * _p_stsl3DDest,
|
||||
sw_3D_tdstVector * _p_stsw3DSrc
|
||||
)
|
||||
{
|
||||
MTH3D_M_vCopyVector(_p_stsl3DDest,_p_stsw3DSrc);
|
||||
return _p_stsl3DDest;
|
||||
}
|
||||
|
||||
/* Conversion sl3D in sw3D */
|
||||
__inline sw_3D_tdstVector * VEC_p_sw3DConverse_sl3DTosw3D(
|
||||
sw_3D_tdstVector * _p_stsw3DDest,
|
||||
sl_3D_tdstVector * _p_stsl3DSrc
|
||||
)
|
||||
{
|
||||
MTH3D_M_vCopyVector(_p_stsw3DDest,_p_stsl3DSrc);
|
||||
return _p_stsw3DDest;
|
||||
}
|
||||
|
||||
/*--------------------------------------------*/
|
||||
/* Vector/Matrix Multiplication */
|
||||
/*--------------------------------------------*/
|
||||
/* Specific functions */
|
||||
/* PC OK */
|
||||
__inline void sw12_3D_fn_vMulMatrixVector_Dsl_SswWithoutBuffer(
|
||||
sl_3D_tdstVector * p_VectDest,
|
||||
sw12_3D_tdstMatrix * p_MatA,
|
||||
sw_3D_tdstVector * p_VectA)
|
||||
{
|
||||
MTH3D_M_vMulMatrixVectorWithoutBuffer(p_VectDest,p_MatA,p_VectA);
|
||||
}
|
||||
|
||||
/* Explicit name */
|
||||
/* To be optimzed of course */
|
||||
/* PC OK */
|
||||
__inline void sw12_3D_fn_vMulMatrixSw12Vector_Dsl_Ssl(
|
||||
sl_3D_tdstVector * p_VectDest,
|
||||
sw12_3D_tdstMatrix * p_MatA,
|
||||
sl_3D_tdstVector * p_VectA)
|
||||
|
||||
{
|
||||
MTH3D_M_vMulMatrixVectorWithoutBuffer(p_VectDest,p_MatA,p_VectA);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------------------------------------------------*/
|
||||
/* Mul Add Vector */
|
||||
/*-------------------------------------------------------------------------------------------*/
|
||||
/*--------------------------------------------------------------------------------*/
|
||||
/* sw_3D_M_vMulAddVector( sw_3D, sl12, sw_3D, sw_3D) sw_3D = sl12*sw_3D + sw_3D */
|
||||
/*--------------------------------------------------------------------------------*/
|
||||
/* PC OK */
|
||||
__inline void sw_3D_fn_vMulAddVector_sw3D_sl12_sw3D_sw_3D(
|
||||
sw_3D_tdstVector * _p_stswVectorResult,
|
||||
td_sl12 _sl12_scalar,
|
||||
sw_3D_tdstVector * _p_stswVectorA,
|
||||
sw_3D_tdstVector * _p_stswVectorB
|
||||
)
|
||||
{
|
||||
MTH3D_M_vMulScalarVector( _p_stswVectorResult, _sl12_scalar, _p_stswVectorA);
|
||||
MTH3D_M_vAddVector( _p_stswVectorResult, _p_stswVectorResult, _p_stswVectorB);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* sl_3D_M_vMulAddVector : sl_3D <- sw * sw12_3D + sl_3D */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
__inline void sl_3D_fn_vMulAddVector_sl3D_sw_sw123D_sl3D(
|
||||
sl_3D_tdstVector * _p_stslVectorResult,
|
||||
td_sw _sw_scalar,
|
||||
sw12_3D_tdstVector * _p_stsw12VectorA,
|
||||
sl_3D_tdstVector * _p_stslVectorB
|
||||
)
|
||||
{
|
||||
MTH3D_M_vMulScalarVector( _p_stslVectorResult, _sw_scalar, _p_stsw12VectorA);
|
||||
MTH3D_M_vAddVector( _p_stslVectorResult, _p_stslVectorResult, _p_stslVectorB);
|
||||
}
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* sl_3D_M_vMulAddVector : sl_3D <- sw12 * sw_3D + sl_3D */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
#define sl_3D_M_vMulAddVector_sl3D_sw12_sw3D_sl3D( _p_sl_3DResult, _sw12, _p_sw_3D, _p_sl_3D) \
|
||||
{ \
|
||||
MTH3D_M_vMulScalarVector( _p_sl_3DResult, _sw12, _p_sw_3D); \
|
||||
MTH3D_M_vAddVector( _p_sl_3DResult, _p_sl_3DResult, _p_sl_3D); \
|
||||
}
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
/* sl_3D_M_vMulAddVector : sw_3D <- sw * sw12_3D + sw_3D */
|
||||
/*----------------------------------------------------------------------------------*/
|
||||
#define sw_3D_M_vMulAddVector_sw3D_sw_sw123D_sw3D( _p_sw_3DResult, _sw, _p_sw12_3D, _p_sw_3D) \
|
||||
{ \
|
||||
MTH3D_M_vMulScalarVector( _p_sw_3DResult, _sw, _p_sw12_3D); \
|
||||
MTH3D_M_vAddVector( _p_sw_3DResult, _p_sw_3DResult, _p_sw_3D); \
|
||||
}
|
||||
|
||||
#define sl_3D_M_vMulAddVector_sl3D_sw_sw123D_sl3D( sl_3DResult, sw, sw12_3D, sl_3D) sl_3D_fn_vMulAddVector_sl3D_sw_sw123D_sl3D( sl_3DResult, sw, sw12_3D, sl_3D)
|
||||
#define sw_3D_M_vMulAddVector_sw3D_sl12_sw3D_sw3D( sw_3DResult, sl12, sw_3D_1, sw_3D_2) sw_3D_fn_vMulAddVector_sw3D_sl12_sw3D_sw3D( sw_3DResult, sl12, sw_3D_1, sw_3D_2)
|
||||
/*-------------------------------------------------------------------------------------------*/
|
||||
/* Dot Products */
|
||||
/*-------------------------------------------------------------------------------------------*/
|
||||
/*----------------------------------------------*/
|
||||
/* sw_3D_M_xDotProductVector ( sw_3D, sw12_3D ) */
|
||||
/*----------------------------------------------*/
|
||||
/* PC OK */
|
||||
__inline td_sl VEC_3D_fn_sl_DotProductVector_sw_sw(
|
||||
sw_3D_tdstVector * _p_stswVectorA,
|
||||
sw_3D_tdstVector * _p_stswVectorB
|
||||
)
|
||||
{
|
||||
return MTH3D_M_xDotProductVector(_p_stswVectorA,_p_stswVectorB);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* sw_3D_M_sw_DotProductVector_sw_sw12 ( sw_3D, sw12_3D ) */
|
||||
/*--------------------------------------------------------*/
|
||||
__inline td_sw VEC_3D_fn_sw_DotProductVector_sw_sw12(
|
||||
sw_3D_tdstVector * _p_stswVector,
|
||||
sw12_3D_tdstVector * _p_stsw12Vector
|
||||
)
|
||||
{
|
||||
return MTH3D_M_xDotProductVector(_p_stswVector,_p_stsw12Vector);
|
||||
}
|
||||
|
||||
/*--------------------------------------------------------*/
|
||||
/* sw_3D_M_sl_DotProductVector_sl_sw12 ( sl_3D, sw12_3D ) */
|
||||
/*--------------------------------------------------------*/
|
||||
__inline td_sl VEC_3D_fn_sl_DotProductVector_sl_sw12(
|
||||
sl_3D_tdstVector * _p_stslVector,
|
||||
sw12_3D_tdstVector * _p_stsw12Vector
|
||||
)
|
||||
{
|
||||
return MTH3D_M_xDotProductVector(_p_stslVector,_p_stsw12Vector);
|
||||
}
|
||||
|
||||
#define VEC_3D_M_sl_DotProductVector_sw_sw( sw_3D_1, sw_3D_2 ) VEC_3D_fn_sl_DotProductVector_sw_sw( sw_3D_1, sw_3D_2 )
|
||||
#define VEC_3D_M_sw_DotProductVector_sw_sw12( sw_3D, sw12_3D ) VEC_3D_fn_sw_DotProductVector_sw_sw12( sw_3D, sw12_3D )
|
||||
#define VEC_3D_M_sl_DotProductVector_sl_sw12( sl_3D, sw12_3D ) VEC_3D_fn_sl_DotProductVector_sl_sw12( sl_3D, sw12_3D )
|
||||
|
||||
/*------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* Mul Scalar Vector */
|
||||
/*------------------------------------------------------------------------------------------------------------------------*/
|
||||
|
||||
/*----------------------------------------------*/
|
||||
/* MulScalar sw_3D <- sl12 * sw_3D */
|
||||
/*----------------------------------------------*/
|
||||
/* PC OK */
|
||||
__inline sw_3D_tdstVector * sw_3D_fn_MulScalarVector_sl12_Sw3D
|
||||
(
|
||||
sw_3D_tdstVector * _p_stswVectorResult,
|
||||
td_sl12 _p_s12Scalar,
|
||||
sw_3D_tdstVector * _p_stswVector
|
||||
)
|
||||
{
|
||||
MTH3D_M_vMulScalarVector( _p_stswVectorResult, _p_s12Scalar, _p_stswVector);
|
||||
|
||||
return _p_stswVectorResult;
|
||||
}
|
||||
|
||||
/*----------------------------------------------*/
|
||||
/* MulScalar sw_3D <- sw * sw12_3D */
|
||||
/*----------------------------------------------*/
|
||||
__inline sw_3D_tdstVector * sw_3D_fn_MulScalarVector_sw_sw123D
|
||||
(
|
||||
sw_3D_tdstVector * _p_stswVectorResult,
|
||||
td_sw swScalar,
|
||||
sw12_3D_tdstVector * _p_stsw12Vector
|
||||
)
|
||||
{
|
||||
MTH3D_M_vMulScalarVector( _p_stswVectorResult, swScalar, _p_stsw12Vector);
|
||||
|
||||
return _p_stswVectorResult;
|
||||
}
|
||||
|
||||
#define sw_3D_M_MulScalarVector_sw_sw123D(Vectd,a,VectA) sw_3D_fn_MulScalarVector_sw_sw123D(Vectd,a,VectA)
|
||||
#define sw_3D_M_MulScalarVector_sl12_sw3D(Vectd,a,VectA) sw_3D_fn_MulScalarVector_sl12_sw3D(Vectd,a,VectA)
|
||||
/*------------------------------------------------------------------------------------------------------------------------*/
|
||||
/* Div Vector Scalar */
|
||||
/*------------------------------------------------------------------------------------------------------------------------*/
|
||||
/*-----------------------*/
|
||||
/* sw12_3D <- sw_3D / sw */
|
||||
/*-----------------------*/
|
||||
__inline sw12_3D_tdstVector * sw12_3D_fn_VectorDivScalar_sw3D_sw
|
||||
(
|
||||
sw12_3D_tdstVector * _p_stsw12VectorResult,
|
||||
sw_3D_tdstVector * _p_stswVector,
|
||||
td_sw swScalar
|
||||
)
|
||||
{
|
||||
MTH3D_M_vDivScalarVector( _p_stsw12VectorResult, _p_stswVector, swScalar);
|
||||
|
||||
return _p_stsw12VectorResult;
|
||||
}
|
||||
#define sw12_3D_M_VectorDivScalar_sw3D_sw(Vectd,Vecta,a) sw12_3D_fn_VectorDivScalar_sw3D_sw(Vectd,Vecta,a)
|
||||
/*------------------------------------------------------------*/
|
||||
/* Square norm of a vector */
|
||||
/*------------------------------------------------------------*/
|
||||
__inline td_sl sw_3D_fn_sl_SqrVector(
|
||||
sw_3D_tdstVector * _p_stswVectorA
|
||||
)
|
||||
{
|
||||
return MTH3D_M_xSqrVector(_p_stswVectorA);
|
||||
}
|
||||
#define sw_3D_M_sl_SqrVector_sw(VectA) sw_3D_fn_sl_SqrVector(VectA)
|
||||
/*--------------------------------*/
|
||||
/* Vector Normalisation functions */
|
||||
/*--------------------------------*/
|
||||
#define sw12_3D_vNormalizeVector_Dsw12_Ssl(VectDest, VectA) VEC_p_sw12_3DNormalize_sl3D(VectDest, VectA)
|
||||
#define sw12_3D_vNormalizeVector_Dsw12_Ssl12(VectDest, VectA) VEC_p_sw12_3DNormalize_sl123D(VectDest, VectA)
|
||||
#define sw12_3D_vNormalizeVector_Dsw12_Ssw(VectDest, VectA) VEC_p_sw12_3DNormalize_sw3D(VectDest, VectA)
|
||||
#define sw12_3D_vNormalizeVector_Dsw12_Ssw12(VectDest, VectA) VEC_p_sw12_3DNormalize_sw3D(VectDest, VectA)
|
||||
/*---------------------------------------------*/
|
||||
/* sl <- sl_3D_M_slVectorGapSqr (sw_3D, sw_3D) */
|
||||
/*---------------------------------------------*/
|
||||
#define sl_3D_M_slVectorGapSqr_sw3D_sw3D(VectA, VectB) MTH3D_M_xVectorGapSqr(VectA, VectB)
|
||||
|
||||
/*-----------------------------------------------------*/
|
||||
/* ul <- VEC_M_ulVectorGapSqr_sl3D_sl3D (sl_3D, sl_3D) */
|
||||
/*-----------------------------------------------------*/
|
||||
__inline unsigned long VEC_fn_ulVectorGapSqr_sl3D_sl3D(
|
||||
sl_3D_tdstVector *_p_stsl3D_A,
|
||||
sl_3D_tdstVector *_p_stsl3D_B
|
||||
)
|
||||
{
|
||||
return MTH_M_xRealToLong(MTH3D_M_xVectorGapSqr(_p_stsl3D_A, _p_stsl3D_B));
|
||||
}
|
||||
|
||||
#define VEC_M_ulVectorGapSqr_sl3D_sl3D(sl_3D_1, sl_3D_2) VEC_fn_ulVectorGapSqr_sl3D_sl3D(sl_3D_1, sl_3D_2)
|
||||
|
||||
/* Macro definitions */
|
||||
#define sw12_3D_M_vMulMatrixSw12Vector_Dsw_Ssl( VectDest, MatA, VectA) sw12_3D_fn_vMulMatrixSw12Vector_Dsl_Ssl( VectDest, MatA, VectA)
|
||||
#define sw12_3D_M_vMulMatrixVector_Dsl_SswWithoutBuffer( VectDest, MatA, VectA) sw12_3D_fn_vMulMatrixVector_Dsl_SswWithoutBuffer( VectDest, MatA, VectA)
|
||||
#define Conv_sl3DTosw3D(_p_stsl3D,_p_stsw3D) VEC_p_sw3DConverse_sl3DTosw3D(_p_stsl3D,_p_stsw3D)
|
||||
#define Conv_sw3DTosl3D(_p_stsw3D,_p_stsl3D) VEC_p_sw3DConverse_sw3DTosl3D(_p_stsw3D,_p_stsl3D)
|
||||
|
||||
#endif
|
439
Rayman_X/cpa/public/MTH/Specif/VEC/sl12_3D.h
Normal file
439
Rayman_X/cpa/public/MTH/Specif/VEC/sl12_3D.h
Normal file
@@ -0,0 +1,439 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : sl12_3D.h
|
||||
MODULE : sl12 (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Vectorial implementation
|
||||
|
||||
VERSION : sl12 V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
/* -----------------15/04/98 18:36-------------------
|
||||
* Conversion : OK avec version 23.04.98 19:58 31153
|
||||
* --------------------------------------------------*/
|
||||
|
||||
#ifndef _SCA_sl12_3D_H_
|
||||
#define _SCA_sl12_3D_H_
|
||||
|
||||
#include "MTH\Specif\SCA\SCA_sl12.h"
|
||||
|
||||
/* ##TYPEDEF#----------------------------------------------------------------------------
|
||||
Types definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* 3D Vector : */
|
||||
/*
|
||||
#if 0
|
||||
|
||||
typedef VECTOR sl12_3D_tdstVector;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct sl12_3D_tdstVector_
|
||||
{
|
||||
SCA_td_sl12 xX;
|
||||
SCA_td_sl12 xY;
|
||||
SCA_td_sl12 xZ;
|
||||
SCA_td_sl12 pad;
|
||||
} sl12_3D_tdstVector;
|
||||
|
||||
#endif
|
||||
*/
|
||||
|
||||
#define sl12_3D_tdstVector MTH3D_tdstVector
|
||||
|
||||
|
||||
|
||||
/* 3D Matrix */
|
||||
/*
|
||||
typedef struct sl12_3D_tdstMatrix_
|
||||
{
|
||||
sl12_3D_tdstVector stCol_0;
|
||||
sl12_3D_tdstVector stCol_1;
|
||||
sl12_3D_tdstVector stCol_2;
|
||||
|
||||
} sl12_3D_tdstMatrix;
|
||||
*/
|
||||
|
||||
#define sl12_3D_tdstMatrix MTH3D_tdstMatrix
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/*+ ##-######################################
|
||||
## MACRO AND FUNCTION FOR 3D MATHEMATICS
|
||||
######################################### */
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## Vector Operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vAddVector
|
||||
DESCRIPTION : Add two vectors : VectDest= VectA + VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vAddVector( VectDest, VectA, VectB) MTH3D_M_vAddVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSubVector
|
||||
DESCRIPTION : Sub two vectors : VectDest= VectA - VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSubVector( VectDest, VectA, VectB) MTH3D_M_vSubVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vNegVector
|
||||
DESCRIPTION : Negation of a vector : VectDest= - VectA
|
||||
INPUT : VectDest, VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vNegVector( VectDest, VectA) MTH3D_M_vNegVector( VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_bEqualVector
|
||||
DESCRIPTION : Test if two vectors are equal
|
||||
INPUT : VectA, VectB : address of sl12_3D_tdstVector
|
||||
OUTPUT : VectA==VectB : Boolean
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_bEqualVector( VectA, VectB) MTH3D_M_bEqualVector( VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vAddScalarVector
|
||||
DESCRIPTION : Add a scalare with a vector : VectDest= a.Id + VectA
|
||||
INPUT : VectDest: address of sl12_3D_tdstVector,
|
||||
a: SCA_td_sl12, VectA: address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vAddScalarVector( VectDest, a, VectA) MTH3D_M_vAddScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSubScalarVector
|
||||
DESCRIPTION : Add a scalare with a vector : VectDest= VectA - a.Id
|
||||
INPUT : VectDest: address of sl12_3D_tdstVector,
|
||||
a: SCA_td_sl12, VectA: address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSubScalarVector( VectDest, a, VectA) MTH3D_M_vSubScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMulScalarVector
|
||||
DESCRIPTION : Multiplicate a scalare with a vector : VectDest= a*VectA
|
||||
INPUT : VectDest: address of sl12_3D_tdstVector,
|
||||
a: SCA_td_sl12, VectA: address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMulScalarVector( VectDest, a, VectA) MTH3D_M_vMulScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vDivScalarVector
|
||||
DESCRIPTION : Divide a vector by a scalare : VectDest= VectA/a
|
||||
INPUT : VectDest, VectA: address of sl12_3D_tdstVector, a: SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vDivScalarVector( VectDest, VectA, a) MTH3D_M_vDivScalarVector( VectDest, VectA, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xDotProductVector
|
||||
DESCRIPTION : Return the Dot Product of two vectors
|
||||
INPUT : VectA, VectB : address of sl12_3D_tdstVector
|
||||
OUTPUT : VectA.VectB : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xDotProductVector( VectA, VectB) MTH3D_M_xDotProductVector( VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vCrossProductVectorWithoutBuffer
|
||||
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB,
|
||||
VectDest must be a other vector
|
||||
INPUT : VectDest, VectA, VectA: address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_fn_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB) \
|
||||
MTH3D_M_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB)
|
||||
|
||||
#define sl12_3D_M_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB) \
|
||||
sl12_3D_fn_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB)
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vCrossProductVector
|
||||
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB
|
||||
INPUT : VectDest, VectA, VectA: address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vCrossProductVector(VectDest,VectA,VectB) MTH3D_M_vCrossProductVector(VectDest,VectA,VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xSqrVector
|
||||
DESCRIPTION : Return the square of a vector
|
||||
INPUT : VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : VectA.VectA : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xSqrVector( VectA) MTH3D_M_xSqrVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xNormVector
|
||||
DESCRIPTION : Return the norm of a vector
|
||||
INPUT : VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : ||VectA|| : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xNormVector( VectA ) MTH3D_M_xNormVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xInvNormVector
|
||||
DESCRIPTION : Return the inverse of the norm of a vector
|
||||
INPUT : VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : 1/||VectA|| : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xInvNormVector( VectA ) MTH3D_M_xInvNormVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xVectorGapSqr
|
||||
DESCRIPTION : Return the square Gap between two vectors
|
||||
INPUT : VectA, VectB : address of sl12_3D_tdstVector
|
||||
OUTPUT : Sqr(||VectA-VectB||) : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xVectorGapSqr(VectA, VectB) MTH3D_M_xVectorGapSqr(VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xVectorGap
|
||||
DESCRIPTION : Return the Gap between two vectors
|
||||
INPUT : VectA, VectB : address of sl12_3D_tdstVector
|
||||
OUTPUT : ||VectA-VectB|| : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xVectorGap(VectA, VectB) MTH3D_M_xVectorGap(VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vFillVector
|
||||
DESCRIPTION : Fill each vector element with a value
|
||||
INPUT : VectA: address of sl12_3D_tdstVector, a: SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vFillVector( VectDest, a) MTH3D_M_vFillVector( VectDest, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vNormalizeVector
|
||||
DESCRIPTION : Normalize a vector : VectDest= VectA/||VectA||
|
||||
INPUT : VectDest, VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
/* Cf 3D_Conv.h */
|
||||
/*#define sl12_3D_M_vNormalizeVector(VectDest, VectA) MTH3D_M_vNormalizeVector(VectDest, VectA)*/
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vGetVectorElements
|
||||
DESCRIPTION : Get x, y, z values of a vector
|
||||
INPUT : x, y, z : address of SCA_td_sl12, VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vGetVectorElements( Vx, Vy, Vz, VectA) MTH3D_M_vGetVectorElements( Vx, Vy, Vz, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetVectorElements
|
||||
DESCRIPTION : Set a vector with x, y, z values
|
||||
INPUT : VectDest : address of sl12_3D_tdstVector, x, y, z : address of SCA_td_sl12,
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz) MTH3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xGetXofVector
|
||||
DESCRIPTION : Return x element of a vector
|
||||
INPUT : VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : x : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xGetXofVector( VectA ) MTH3D_M_xGetXofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetXofVector
|
||||
DESCRIPTION : Set x element of a vector
|
||||
INPUT : VectDest : address of sl12_3D_tdstVector, Vx : SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetXofVector( VectDest, Vx) MTH3D_M_vSetXofVector( VectDest, Vx)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xGetYofVector
|
||||
DESCRIPTION : Return y element of a vector
|
||||
INPUT : VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : y : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xGetYofVector( VectA ) MTH3D_M_xGetYofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetYofVector
|
||||
DESCRIPTION : Set y element of a vector
|
||||
INPUT : VectDest : address of sl12_3D_tdstVector, Vy : SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetYofVector( VectDest, Vy) MTH3D_M_vSetYofVector( VectDest, Vy)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xGetZofVector
|
||||
DESCRIPTION : Return z element of a vector
|
||||
INPUT : VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : z : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xGetZofVector( VectA ) MTH3D_M_xGetZofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetZofVector
|
||||
DESCRIPTION : Set z element of a vector
|
||||
INPUT : VectDest : address of sl12_3D_tdstVector, Vz : SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetZofVector( VectDest, Vz) MTH3D_M_vSetZofVector( VectDest, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vCopyVector
|
||||
DESCRIPTION : Copy a vector : VectDest=VectA
|
||||
INPUT : VectDest, VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vCopyVector( VectDest, VectA) MTH3D_M_vCopyVector( VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vNullVector
|
||||
DESCRIPTION : Set all elements of a vector to zero
|
||||
INPUT : VectDest : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vNullVector( VectDest) MTH3D_M_vNullVector( VectDest)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vScaleVector
|
||||
DESCRIPTION : Set each element of VectDest with the multiplication of element of VectA by element of VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vScaleVector( VectDest, VectA, VectB ) MTH3D_M_vScaleVector( VectDest, VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMiddleVector
|
||||
DESCRIPTION : Calculate the middle of two vectors : VectDest= (VectA+VectB)/2
|
||||
INPUT : VectDest, VectA, VectB : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMiddleVector( VectDest, VectA, VectB ) MTH3D_M_vMiddleVector( VectDest, VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vLinearInterpolVector
|
||||
DESCRIPTION : Calculate the lineat interpolation of two vectors : VectDest= VectA + t.(VectB-VectA)
|
||||
INPUT : VectDest, VectA, VectB: address of sl12_3D_tdstVector, t: SCA_td_sl12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t) MTH3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMaxVector
|
||||
DESCRIPTION : Make a vector with max elements of two other vectors
|
||||
INPUT : VectDest, VectA, VectB: address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMaxVector( VectDest, VectA, VectB) MTH3D_M_vMaxVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMinVector
|
||||
DESCRIPTION : Make a vector with min elements of two other vectors
|
||||
INPUT : VectDest, VectA, VectB: address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMinVector( VectDest, VectA, VectB) MTH3D_M_vMinVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xDetxYVector
|
||||
DESCRIPTION : Return the 2D determinant between X and Y elements
|
||||
INPUT : VectA, VectB: address of sl12_3D_tdstVector
|
||||
OUTPUT : DetxY |VectA, VectB| : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xDetxYVector( VectA, VectB ) MTH3D_M_xDetxYVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xDetYZVector
|
||||
DESCRIPTION : Return the 2D determinant between Y and Z elements
|
||||
INPUT : VectA, VectB: address of sl12_3D_tdstVector
|
||||
OUTPUT : DetYZ |VectA, VectB| : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xDetYZVector( VectA, VectB ) MTH3D_M_xDetYZVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_xDetZXVector
|
||||
DESCRIPTION : Return the 2D determinant between Z and X elements
|
||||
INPUT : VectA, VectB: address of sl12_3D_tdstVector
|
||||
OUTPUT : DetZX |VectA, VectB| : SCA_td_sl12
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_xDetZXVector( VectA, VectB ) MTH3D_M_xDetZXVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_bIsNullVector
|
||||
DESCRIPTION : Test if a vector is null
|
||||
INPUT : VectA : address of sl12_3D_tdstVector
|
||||
OUTPUT : VectA==Null vector : Boolean
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_bIsNullVector( VectA ) MTH3D_M_bIsNullVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vMulAddVector
|
||||
DESCRIPTION : Multiply a scalar to a vector, and add it to a other vector: VectDest = x.VectA + VectB
|
||||
INPUT : VectDest: address of sl12_3D_tdstVector,
|
||||
x: SCA_td_sl12, VectA, VectB : address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vMulAddVector( VectDest, x, VectA, VectB) MTH3D_M_vMulAddVector( VectDest, x, VectA, VectB)
|
||||
|
||||
/* sl12_3D_M_vMullAddVector( VectDest, x, VectA, VectB) : VectDest = x.VectA + VectB */
|
||||
#define sl12_3D_M_vMullAddVector sl12_3D_M_vMulAddVector
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetBaseIVector
|
||||
DESCRIPTION : Set a vector to Ox base vector : VectDest = ( 1, 0, 0 )
|
||||
INPUT : VectDest: address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetBaseIVector( VectDest ) MTH3D_M_vSetBaseIVector( VectDest )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetBaseJVector
|
||||
DESCRIPTION : Set a vector to Oy base vector : VectDest = ( 0, 1, 0 )
|
||||
INPUT : VectDest: address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetBaseJVector( VectDest ) MTH3D_M_vSetBaseJVector( VectDest )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl12_3D_M_vSetBaseKVector
|
||||
DESCRIPTION : Set a vector to Oz base vector : VectDest = ( 0, 0, 1 )
|
||||
INPUT : VectDest: address of sl12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl12_3D_M_vSetBaseKVector( VectDest ) MTH3D_M_vSetBaseKVector( VectDest )
|
||||
|
||||
/* ##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 Pf_sl12(td_sl12 _xValue)
|
||||
{
|
||||
printf( " %e",_xValue );
|
||||
}
|
||||
|
||||
|
||||
__inline void sl12_3D_fn_vPrintfVector( char * Name, sl12_3D_tdstVector * VectA)
|
||||
{
|
||||
MTH3D_M_vPrintfVector( Name, VectA );
|
||||
}
|
||||
|
||||
#define sl12_3D_M_vPrintfVector( Name, VectA) sl12_3D_fn_vPrintfVector( Name, VectA)
|
||||
|
||||
|
||||
|
||||
#endif /* sl12_3D_H */
|
909
Rayman_X/cpa/public/MTH/Specif/VEC/sl_3D.h
Normal file
909
Rayman_X/cpa/public/MTH/Specif/VEC/sl_3D.h
Normal file
@@ -0,0 +1,909 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : sl_3D.h
|
||||
MODULE : sl (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Vectorial implementation
|
||||
|
||||
VERSION : sl V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
/* -----------------15/04/98 18:36-------------------
|
||||
* Conversion : OK
|
||||
* --------------------------------------------------*/
|
||||
#ifndef _SCA_sl_3D_H_
|
||||
#define _SCA_sl_3D_H_
|
||||
|
||||
#include "MTH\Specif\SCA\SCA_sl.h"
|
||||
|
||||
/* ##TYPEDEF#----------------------------------------------------------------------------
|
||||
Types definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* 3D Vector : */
|
||||
/*
|
||||
#if 0
|
||||
|
||||
typedef VECTOR sl_3D_tdstVector;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct sl_3D_tdstVector_
|
||||
{
|
||||
SCA_td_sl xX;
|
||||
SCA_td_sl xY;
|
||||
SCA_td_sl xZ;
|
||||
SCA_td_sl pad;
|
||||
} sl_3D_tdstVector;
|
||||
|
||||
#endif
|
||||
*/
|
||||
|
||||
#define sl_3D_tdstVector MTH3D_tdstVector
|
||||
|
||||
|
||||
|
||||
/* 3D Matrix */
|
||||
/*
|
||||
typedef struct sl_3D_tdstMatrix_
|
||||
{
|
||||
sl_3D_tdstVector stCol_0;
|
||||
sl_3D_tdstVector stCol_1;
|
||||
sl_3D_tdstVector stCol_2;
|
||||
|
||||
} sl_3D_tdstMatrix;
|
||||
*/
|
||||
|
||||
#define sl_3D_tdstMatrix MTH3D_tdstMatrix
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/*+ ##-######################################
|
||||
## MACRO AND FUNCTION FOR 3D MATHEMATICS
|
||||
######################################### */
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## Vector Operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vAddVector
|
||||
DESCRIPTION : Add two vectors : VectDest= VectA + VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vAddVector( VectDest, VectA, VectB) MTH3D_M_vAddVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSubVector
|
||||
DESCRIPTION : Sub two vectors : VectDest= VectA - VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSubVector( VectDest, VectA, VectB) MTH3D_M_vSubVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vNegVector
|
||||
DESCRIPTION : Negation of a vector : VectDest= - VectA
|
||||
INPUT : VectDest, VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vNegVector( VectDest, VectA) MTH3D_M_vNegVector( VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_bEqualVector
|
||||
DESCRIPTION : Test if two vectors are equal
|
||||
INPUT : VectA, VectB : address of sl_3D_tdstVector
|
||||
OUTPUT : VectA==VectB : Boolean
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_bEqualVector( VectA, VectB) MTH3D_M_bEqualVector( VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vAddScalarVector
|
||||
DESCRIPTION : Add a scalare with a vector : VectDest= a.Id + VectA
|
||||
INPUT : VectDest: address of sl_3D_tdstVector,
|
||||
a: SCA_td_sl, VectA: address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vAddScalarVector( VectDest, a, VectA) MTH3D_M_vAddScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSubScalarVector
|
||||
DESCRIPTION : Add a scalare with a vector : VectDest= VectA - a.Id
|
||||
INPUT : VectDest: address of sl_3D_tdstVector,
|
||||
a: SCA_td_sl, VectA: address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSubScalarVector( VectDest, a, VectA) MTH3D_M_vSubScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMulScalarVector
|
||||
DESCRIPTION : Multiplicate a scalare with a vector : VectDest= a*VectA
|
||||
INPUT : VectDest: address of sl_3D_tdstVector,
|
||||
a: SCA_td_sl, VectA: address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMulScalarVector( VectDest, a, VectA) MTH3D_M_vMulScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vDivScalarVector
|
||||
DESCRIPTION : Divide a vector by a scalare : VectDest= VectA/a
|
||||
INPUT : VectDest, VectA: address of sl_3D_tdstVector, a: SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vDivScalarVector( VectDest, VectA, a) MTH3D_M_vDivScalarVector( VectDest, VectA, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xDotProductVector
|
||||
DESCRIPTION : Return the Dot Product of two vectors
|
||||
INPUT : VectA, VectB : address of sl_3D_tdstVector
|
||||
OUTPUT : VectA.VectB : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xDotProductVector( VectA, VectB) MTH3D_M_xDotProductVector( VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vCrossProductVectorWithoutBuffer
|
||||
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB,
|
||||
VectDest must be a other vector
|
||||
INPUT : VectDest, VectA, VectA: address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_fn_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB) \
|
||||
MTH3D_M_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB)
|
||||
|
||||
#define sl_3D_M_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB) \
|
||||
sl_3D_fn_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB)
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vCrossProductVector
|
||||
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB
|
||||
INPUT : VectDest, VectA, VectA: address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vCrossProductVector(VectDest,VectA,VectB) MTH3D_M_vCrossProductVector(VectDest,VectA,VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xSqrVector
|
||||
DESCRIPTION : Return the square of a vector
|
||||
INPUT : VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : VectA.VectA : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xSqrVector( VectA) MTH3D_M_xSqrVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xNormVector
|
||||
DESCRIPTION : Return the norm of a vector
|
||||
INPUT : VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : ||VectA|| : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xNormVector( VectA ) MTH3D_M_xNormVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xInvNormVector
|
||||
DESCRIPTION : Return the inverse of the norm of a vector
|
||||
INPUT : VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : 1/||VectA|| : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xInvNormVector( VectA ) MTH3D_M_xInvNormVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xVectorGapSqr
|
||||
DESCRIPTION : Return the square Gap between two vectors
|
||||
INPUT : VectA, VectB : address of sl_3D_tdstVector
|
||||
OUTPUT : Sqr(||VectA-VectB||) : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xVectorGapSqr(VectA, VectB) MTH3D_M_xVectorGapSqr(VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xVectorGap
|
||||
DESCRIPTION : Return the Gap between two vectors
|
||||
INPUT : VectA, VectB : address of sl_3D_tdstVector
|
||||
OUTPUT : ||VectA-VectB|| : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xVectorGap(VectA, VectB) MTH3D_M_xVectorGap(VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vFillVector
|
||||
DESCRIPTION : Fill each vector element with a value
|
||||
INPUT : VectA: address of sl_3D_tdstVector, a: SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vFillVector( VectDest, a) MTH3D_M_vFillVector( VectDest, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vNormalizeVector
|
||||
DESCRIPTION : Normalize a vector : VectDest= VectA/||VectA||
|
||||
INPUT : VectDest, VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vNormalizeVector(VectDest, VectA) MTH3D_M_vNormalizeVector(VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vGetVectorElements
|
||||
DESCRIPTION : Get x, y, z values of a vector
|
||||
INPUT : x, y, z : address of SCA_td_sl, VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vGetVectorElements( Vx, Vy, Vz, VectA) MTH3D_M_vGetVectorElements( Vx, Vy, Vz, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetVectorElements
|
||||
DESCRIPTION : Set a vector with x, y, z values
|
||||
INPUT : VectDest : address of sl_3D_tdstVector, x, y, z : address of SCA_td_sl,
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz) MTH3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xGetXofVector
|
||||
DESCRIPTION : Return x element of a vector
|
||||
INPUT : VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : x : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xGetXofVector( VectA ) MTH3D_M_xGetXofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetXofVector
|
||||
DESCRIPTION : Set x element of a vector
|
||||
INPUT : VectDest : address of sl_3D_tdstVector, Vx : SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetXofVector( VectDest, Vx) MTH3D_M_vSetXofVector( VectDest, Vx)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xGetYofVector
|
||||
DESCRIPTION : Return y element of a vector
|
||||
INPUT : VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : y : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xGetYofVector( VectA ) MTH3D_M_xGetYofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetYofVector
|
||||
DESCRIPTION : Set y element of a vector
|
||||
INPUT : VectDest : address of sl_3D_tdstVector, Vy : SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetYofVector( VectDest, Vy) MTH3D_M_vSetYofVector( VectDest, Vy)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xGetZofVector
|
||||
DESCRIPTION : Return z element of a vector
|
||||
INPUT : VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : z : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xGetZofVector( VectA ) MTH3D_M_xGetZofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetZofVector
|
||||
DESCRIPTION : Set z element of a vector
|
||||
INPUT : VectDest : address of sl_3D_tdstVector, Vz : SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetZofVector( VectDest, Vz) MTH3D_M_vSetZofVector( VectDest, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vCopyVector
|
||||
DESCRIPTION : Copy a vector : VectDest=VectA
|
||||
INPUT : VectDest, VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vCopyVector( VectDest, VectA) MTH3D_M_vCopyVector( VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vNullVector
|
||||
DESCRIPTION : Set all elements of a vector to zero
|
||||
INPUT : VectDest : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vNullVector( VectDest) MTH3D_M_vNullVector( VectDest)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vScaleVector
|
||||
DESCRIPTION : Set each element of VectDest with the multiplication of element of VectA by element of VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vScaleVector( VectDest, VectA, VectB ) MTH3D_M_vScaleVector( VectDest, VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMiddleVector
|
||||
DESCRIPTION : Calculate the middle of two vectors : VectDest= (VectA+VectB)/2
|
||||
INPUT : VectDest, VectA, VectB : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMiddleVector( VectDest, VectA, VectB ) MTH3D_M_vMiddleVector( VectDest, VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vLinearInterpolVector
|
||||
DESCRIPTION : Calculate the lineat interpolation of two vectors : VectDest= VectA + t.(VectB-VectA)
|
||||
INPUT : VectDest, VectA, VectB: address of sl_3D_tdstVector, t: SCA_td_sl
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t) MTH3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMaxVector
|
||||
DESCRIPTION : Make a vector with max elements of two other vectors
|
||||
INPUT : VectDest, VectA, VectB: address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMaxVector( VectDest, VectA, VectB) MTH3D_M_vMaxVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMinVector
|
||||
DESCRIPTION : Make a vector with min elements of two other vectors
|
||||
INPUT : VectDest, VectA, VectB: address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMinVector( VectDest, VectA, VectB) MTH3D_M_vMinVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xDetxYVector
|
||||
DESCRIPTION : Return the 2D determinant between X and Y elements
|
||||
INPUT : VectA, VectB: address of sl_3D_tdstVector
|
||||
OUTPUT : DetxY |VectA, VectB| : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xDetxYVector( VectA, VectB ) MTH3D_M_xDetxYVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xDetYZVector
|
||||
DESCRIPTION : Return the 2D determinant between Y and Z elements
|
||||
INPUT : VectA, VectB: address of sl_3D_tdstVector
|
||||
OUTPUT : DetYZ |VectA, VectB| : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xDetYZVector( VectA, VectB ) MTH3D_M_xDetYZVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_xDetZXVector
|
||||
DESCRIPTION : Return the 2D determinant between Z and X elements
|
||||
INPUT : VectA, VectB: address of sl_3D_tdstVector
|
||||
OUTPUT : DetZX |VectA, VectB| : SCA_td_sl
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_xDetZXVector( VectA, VectB ) MTH3D_M_xDetZXVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_bIsNullVector
|
||||
DESCRIPTION : Test if a vector is null
|
||||
INPUT : VectA : address of sl_3D_tdstVector
|
||||
OUTPUT : VectA==Null vector : Boolean
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_bIsNullVector( VectA ) MTH3D_M_bIsNullVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vMulAddVector
|
||||
DESCRIPTION : Multiply a scalar to a vector, and add it to a other vector: VectDest = x.VectA + VectB
|
||||
INPUT : VectDest: address of sl_3D_tdstVector,
|
||||
x: SCA_td_sl, VectA, VectB : address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vMulAddVector( VectDest, x, VectA, VectB) MTH3D_M_vMulAddVector( VectDest, x, VectA, VectB)
|
||||
|
||||
/* sl_3D_M_vMullAddVector( VectDest, x, VectA, VectB) : VectDest = x.VectA + VectB */
|
||||
#define sl_3D_M_vMullAddVector sl_3D_M_vMulAddVector
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetBaseIVector
|
||||
DESCRIPTION : Set a vector to Ox base vector : VectDest = ( 1, 0, 0 )
|
||||
INPUT : VectDest: address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetBaseIVector( VectDest ) MTH3D_M_vSetBaseIVector( VectDest )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetBaseJVector
|
||||
DESCRIPTION : Set a vector to Oy base vector : VectDest = ( 0, 1, 0 )
|
||||
INPUT : VectDest: address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetBaseJVector( VectDest ) MTH3D_M_vSetBaseJVector( VectDest )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sl_3D_M_vSetBaseKVector
|
||||
DESCRIPTION : Set a vector to Oz base vector : VectDest = ( 0, 0, 1 )
|
||||
INPUT : VectDest: address of sl_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sl_3D_M_vSetBaseKVector( VectDest ) MTH3D_M_vSetBaseKVector( VectDest )
|
||||
|
||||
/* ##-###########################
|
||||
## 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)
|
||||
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## 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)
|
||||
|
||||
|
||||
/* ##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 Pf_sl(td_sl _xValue)
|
||||
{
|
||||
printf( " %e",_xValue );
|
||||
}
|
||||
|
||||
|
||||
__inline void sl_3D_fn_vPrintfVector( char * Name, sl_3D_tdstVector * VectA)
|
||||
{
|
||||
MTH3D_M_vPrintfVector( Name, VectA );
|
||||
}
|
||||
|
||||
#define sl_3D_M_vPrintfVector( Name, VectA) sl_3D_fn_vPrintfVector( Name, VectA)
|
||||
|
||||
|
||||
#endif /* sl_3D_H */
|
909
Rayman_X/cpa/public/MTH/Specif/VEC/sw12_3D.h
Normal file
909
Rayman_X/cpa/public/MTH/Specif/VEC/sw12_3D.h
Normal file
@@ -0,0 +1,909 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : sw12_3D.h
|
||||
MODULE : sw12 (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Vectorial implementation
|
||||
|
||||
VERSION : sw12 V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
/* -----------------15/04/98 18:36-------------------
|
||||
* Conversion : OK
|
||||
* --------------------------------------------------*/
|
||||
#ifndef _SCA_sw12_3D_H_
|
||||
#define _SCA_sw12_3D_H_
|
||||
|
||||
#include "MTH\Specif\SCA\SCA_sw12.h"
|
||||
|
||||
/* ##TYPEDEF#----------------------------------------------------------------------------
|
||||
Types definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* 3D Vector : */
|
||||
/*
|
||||
#if 0
|
||||
|
||||
typedef VECTOR sw12_3D_tdstVector;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct sw12_3D_tdstVector_
|
||||
{
|
||||
SCA_td_sw12 xX;
|
||||
SCA_td_sw12 xY;
|
||||
SCA_td_sw12 xZ;
|
||||
SCA_td_sw12 pad;
|
||||
} sw12_3D_tdstVector;
|
||||
|
||||
#endif
|
||||
*/
|
||||
|
||||
#define sw12_3D_tdstVector MTH3D_tdstVector
|
||||
|
||||
|
||||
|
||||
/* 3D Matrix */
|
||||
/*
|
||||
typedef struct sw12_3D_tdstMatrix_
|
||||
{
|
||||
sw12_3D_tdstVector stCol_0;
|
||||
sw12_3D_tdstVector stCol_1;
|
||||
sw12_3D_tdstVector stCol_2;
|
||||
|
||||
} sw12_3D_tdstMatrix;
|
||||
*/
|
||||
|
||||
#define sw12_3D_tdstMatrix MTH3D_tdstMatrix
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/*+ ##-######################################
|
||||
## MACRO AND FUNCTION FOR 3D MATHEMATICS
|
||||
######################################### */
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## Vector Operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vAddVector
|
||||
DESCRIPTION : Add two vectors : VectDest= VectA + VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vAddVector( VectDest, VectA, VectB) MTH3D_M_vAddVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSubVector
|
||||
DESCRIPTION : Sub two vectors : VectDest= VectA - VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSubVector( VectDest, VectA, VectB) MTH3D_M_vSubVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vNegVector
|
||||
DESCRIPTION : Negation of a vector : VectDest= - VectA
|
||||
INPUT : VectDest, VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vNegVector( VectDest, VectA) MTH3D_M_vNegVector( VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_bEqualVector
|
||||
DESCRIPTION : Test if two vectors are equal
|
||||
INPUT : VectA, VectB : address of sw12_3D_tdstVector
|
||||
OUTPUT : VectA==VectB : Boolean
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_bEqualVector( VectA, VectB) MTH3D_M_bEqualVector( VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vAddScalarVector
|
||||
DESCRIPTION : Add a scalare with a vector : VectDest= a.Id + VectA
|
||||
INPUT : VectDest: address of sw12_3D_tdstVector,
|
||||
a: SCA_td_sw12, VectA: address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vAddScalarVector( VectDest, a, VectA) MTH3D_M_vAddScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSubScalarVector
|
||||
DESCRIPTION : Add a scalare with a vector : VectDest= VectA - a.Id
|
||||
INPUT : VectDest: address of sw12_3D_tdstVector,
|
||||
a: SCA_td_sw12, VectA: address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSubScalarVector( VectDest, a, VectA) MTH3D_M_vSubScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMulScalarVector
|
||||
DESCRIPTION : Multiplicate a scalare with a vector : VectDest= a*VectA
|
||||
INPUT : VectDest: address of sw12_3D_tdstVector,
|
||||
a: SCA_td_sw12, VectA: address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMulScalarVector( VectDest, a, VectA) MTH3D_M_vMulScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vDivScalarVector
|
||||
DESCRIPTION : Divide a vector by a scalare : VectDest= VectA/a
|
||||
INPUT : VectDest, VectA: address of sw12_3D_tdstVector, a: SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vDivScalarVector( VectDest, VectA, a) MTH3D_M_vDivScalarVector( VectDest, VectA, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xDotProductVector
|
||||
DESCRIPTION : Return the Dot Product of two vectors
|
||||
INPUT : VectA, VectB : address of sw12_3D_tdstVector
|
||||
OUTPUT : VectA.VectB : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xDotProductVector( VectA, VectB) MTH3D_M_xDotProductVector( VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vCrossProductVectorWithoutBuffer
|
||||
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB,
|
||||
VectDest must be a other vector
|
||||
INPUT : VectDest, VectA, VectA: address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_fn_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB) \
|
||||
MTH3D_M_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB)
|
||||
|
||||
#define sw12_3D_M_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB) \
|
||||
sw12_3D_fn_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB)
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vCrossProductVector
|
||||
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB
|
||||
INPUT : VectDest, VectA, VectA: address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vCrossProductVector(VectDest,VectA,VectB) MTH3D_M_vCrossProductVector(VectDest,VectA,VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xSqrVector
|
||||
DESCRIPTION : Return the square of a vector
|
||||
INPUT : VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : VectA.VectA : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xSqrVector( VectA) MTH3D_M_xSqrVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xNormVector
|
||||
DESCRIPTION : Return the norm of a vector
|
||||
INPUT : VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : ||VectA|| : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xNormVector( VectA ) MTH3D_M_xNormVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xInvNormVector
|
||||
DESCRIPTION : Return the inverse of the norm of a vector
|
||||
INPUT : VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : 1/||VectA|| : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xInvNormVector( VectA ) MTH3D_M_xInvNormVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xVectorGapSqr
|
||||
DESCRIPTION : Return the square Gap between two vectors
|
||||
INPUT : VectA, VectB : address of sw12_3D_tdstVector
|
||||
OUTPUT : Sqr(||VectA-VectB||) : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xVectorGapSqr(VectA, VectB) MTH3D_M_xVectorGapSqr(VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xVectorGap
|
||||
DESCRIPTION : Return the Gap between two vectors
|
||||
INPUT : VectA, VectB : address of sw12_3D_tdstVector
|
||||
OUTPUT : ||VectA-VectB|| : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xVectorGap(VectA, VectB) MTH3D_M_xVectorGap(VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vFillVector
|
||||
DESCRIPTION : Fill each vector element with a value
|
||||
INPUT : VectA: address of sw12_3D_tdstVector, a: SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vFillVector( VectDest, a) MTH3D_M_vFillVector( VectDest, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vNormalizeVector
|
||||
DESCRIPTION : Normalize a vector : VectDest= VectA/||VectA||
|
||||
INPUT : VectDest, VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vNormalizeVector(VectDest, VectA) MTH3D_M_vNormalizeVector(VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vGetVectorElements
|
||||
DESCRIPTION : Get x, y, z values of a vector
|
||||
INPUT : x, y, z : address of SCA_td_sw12, VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vGetVectorElements( Vx, Vy, Vz, VectA) MTH3D_M_vGetVectorElements( Vx, Vy, Vz, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetVectorElements
|
||||
DESCRIPTION : Set a vector with x, y, z values
|
||||
INPUT : VectDest : address of sw12_3D_tdstVector, x, y, z : address of SCA_td_sw12,
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz) MTH3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xGetXofVector
|
||||
DESCRIPTION : Return x element of a vector
|
||||
INPUT : VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : x : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xGetXofVector( VectA ) MTH3D_M_xGetXofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetXofVector
|
||||
DESCRIPTION : Set x element of a vector
|
||||
INPUT : VectDest : address of sw12_3D_tdstVector, Vx : SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetXofVector( VectDest, Vx) MTH3D_M_vSetXofVector( VectDest, Vx)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xGetYofVector
|
||||
DESCRIPTION : Return y element of a vector
|
||||
INPUT : VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : y : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xGetYofVector( VectA ) MTH3D_M_xGetYofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetYofVector
|
||||
DESCRIPTION : Set y element of a vector
|
||||
INPUT : VectDest : address of sw12_3D_tdstVector, Vy : SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetYofVector( VectDest, Vy) MTH3D_M_vSetYofVector( VectDest, Vy)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xGetZofVector
|
||||
DESCRIPTION : Return z element of a vector
|
||||
INPUT : VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : z : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xGetZofVector( VectA ) MTH3D_M_xGetZofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetZofVector
|
||||
DESCRIPTION : Set z element of a vector
|
||||
INPUT : VectDest : address of sw12_3D_tdstVector, Vz : SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetZofVector( VectDest, Vz) MTH3D_M_vSetZofVector( VectDest, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vCopyVector
|
||||
DESCRIPTION : Copy a vector : VectDest=VectA
|
||||
INPUT : VectDest, VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vCopyVector( VectDest, VectA) MTH3D_M_vCopyVector( VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vNullVector
|
||||
DESCRIPTION : Set all elements of a vector to zero
|
||||
INPUT : VectDest : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vNullVector( VectDest) MTH3D_M_vNullVector( VectDest)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vScaleVector
|
||||
DESCRIPTION : Set each element of VectDest with the multiplication of element of VectA by element of VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vScaleVector( VectDest, VectA, VectB ) MTH3D_M_vScaleVector( VectDest, VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMiddleVector
|
||||
DESCRIPTION : Calculate the middle of two vectors : VectDest= (VectA+VectB)/2
|
||||
INPUT : VectDest, VectA, VectB : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMiddleVector( VectDest, VectA, VectB ) MTH3D_M_vMiddleVector( VectDest, VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vLinearInterpolVector
|
||||
DESCRIPTION : Calculate the lineat interpolation of two vectors : VectDest= VectA + t.(VectB-VectA)
|
||||
INPUT : VectDest, VectA, VectB: address of sw12_3D_tdstVector, t: SCA_td_sw12
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t) MTH3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMaxVector
|
||||
DESCRIPTION : Make a vector with max elements of two other vectors
|
||||
INPUT : VectDest, VectA, VectB: address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMaxVector( VectDest, VectA, VectB) MTH3D_M_vMaxVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMinVector
|
||||
DESCRIPTION : Make a vector with min elements of two other vectors
|
||||
INPUT : VectDest, VectA, VectB: address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMinVector( VectDest, VectA, VectB) MTH3D_M_vMinVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xDetxYVector
|
||||
DESCRIPTION : Return the 2D determinant between X and Y elements
|
||||
INPUT : VectA, VectB: address of sw12_3D_tdstVector
|
||||
OUTPUT : DetxY |VectA, VectB| : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xDetxYVector( VectA, VectB ) MTH3D_M_xDetxYVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xDetYZVector
|
||||
DESCRIPTION : Return the 2D determinant between Y and Z elements
|
||||
INPUT : VectA, VectB: address of sw12_3D_tdstVector
|
||||
OUTPUT : DetYZ |VectA, VectB| : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xDetYZVector( VectA, VectB ) MTH3D_M_xDetYZVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_xDetZXVector
|
||||
DESCRIPTION : Return the 2D determinant between Z and X elements
|
||||
INPUT : VectA, VectB: address of sw12_3D_tdstVector
|
||||
OUTPUT : DetZX |VectA, VectB| : SCA_td_sw12
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_xDetZXVector( VectA, VectB ) MTH3D_M_xDetZXVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_bIsNullVector
|
||||
DESCRIPTION : Test if a vector is null
|
||||
INPUT : VectA : address of sw12_3D_tdstVector
|
||||
OUTPUT : VectA==Null vector : Boolean
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_bIsNullVector( VectA ) MTH3D_M_bIsNullVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vMulAddVector
|
||||
DESCRIPTION : Multiply a scalar to a vector, and add it to a other vector: VectDest = x.VectA + VectB
|
||||
INPUT : VectDest: address of sw12_3D_tdstVector,
|
||||
x: SCA_td_sw12, VectA, VectB : address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vMulAddVector( VectDest, x, VectA, VectB) MTH3D_M_vMulAddVector( VectDest, x, VectA, VectB)
|
||||
|
||||
/* sw12_3D_M_vMullAddVector( VectDest, x, VectA, VectB) : VectDest = x.VectA + VectB */
|
||||
#define sw12_3D_M_vMullAddVector sw12_3D_M_vMulAddVector
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetBaseIVector
|
||||
DESCRIPTION : Set a vector to Ox base vector : VectDest = ( 1, 0, 0 )
|
||||
INPUT : VectDest: address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetBaseIVector( VectDest ) MTH3D_M_vSetBaseIVector( VectDest )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetBaseJVector
|
||||
DESCRIPTION : Set a vector to Oy base vector : VectDest = ( 0, 1, 0 )
|
||||
INPUT : VectDest: address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetBaseJVector( VectDest ) MTH3D_M_vSetBaseJVector( VectDest )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw12_3D_M_vSetBaseKVector
|
||||
DESCRIPTION : Set a vector to Oz base vector : VectDest = ( 0, 0, 1 )
|
||||
INPUT : VectDest: address of sw12_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw12_3D_M_vSetBaseKVector( VectDest ) MTH3D_M_vSetBaseKVector( VectDest )
|
||||
|
||||
/* ##-###########################
|
||||
## 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)
|
||||
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## 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)
|
||||
|
||||
|
||||
/* ##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 Pf_sw12(td_sw12 _xValue)
|
||||
{
|
||||
printf( " %e",_xValue );
|
||||
}
|
||||
|
||||
|
||||
__inline void sw12_3D_fn_vPrintfVector( char * Name, sw12_3D_tdstVector * VectA)
|
||||
{
|
||||
MTH3D_M_vPrintfVector( Name, VectA );
|
||||
}
|
||||
|
||||
#define sw12_3D_M_vPrintfVector( Name, VectA) sw12_3D_fn_vPrintfVector( Name, VectA)
|
||||
|
||||
|
||||
#endif /* sw12_3D_H */
|
910
Rayman_X/cpa/public/MTH/Specif/VEC/sw_3D.h
Normal file
910
Rayman_X/cpa/public/MTH/Specif/VEC/sw_3D.h
Normal file
@@ -0,0 +1,910 @@
|
||||
/* ##H_FILE#
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
FILE : sw_3D.h
|
||||
MODULE : sw (Common Mathematic Library)
|
||||
|
||||
DESCRIPTION : 3D Vectorial implementation
|
||||
|
||||
VERSION : sw V5.0.13 / Alexandre LANGER [ALX] Ubi R&D / Add Comments
|
||||
|
||||
VERSION PC
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
*/
|
||||
|
||||
/* -----------------15/04/98 18:36-------------------
|
||||
* Conversion : OK
|
||||
* --------------------------------------------------*/
|
||||
#ifndef _SCA_sw_3D_H_
|
||||
#define _SCA_sw_3D_H_
|
||||
|
||||
#include "MTH\Specif\SCA\SCA_sw.h"
|
||||
|
||||
/* ##TYPEDEF#----------------------------------------------------------------------------
|
||||
Types definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/* 3D Vector : */
|
||||
/*
|
||||
#if 0
|
||||
|
||||
typedef VECTOR sw_3D_tdstVector;
|
||||
|
||||
#else
|
||||
|
||||
typedef struct sw_3D_tdstVector_
|
||||
{
|
||||
SCA_td_sw xX;
|
||||
SCA_td_sw xY;
|
||||
SCA_td_sw xZ;
|
||||
SCA_td_sw pad;
|
||||
} sw_3D_tdstVector;
|
||||
|
||||
#endif
|
||||
*/
|
||||
|
||||
#define sw_3D_tdstVector MTH3D_tdstVector
|
||||
|
||||
|
||||
|
||||
/* 3D Matrix */
|
||||
/*
|
||||
typedef struct sw_3D_tdstMatrix_
|
||||
{
|
||||
sw_3D_tdstVector stCol_0;
|
||||
sw_3D_tdstVector stCol_1;
|
||||
sw_3D_tdstVector stCol_2;
|
||||
|
||||
} sw_3D_tdstMatrix;
|
||||
*/
|
||||
|
||||
#define sw_3D_tdstMatrix MTH3D_tdstMatrix
|
||||
|
||||
/* ##MACRO#----------------------------------------------------------------------------
|
||||
MACRO definition
|
||||
---------------------------------------------------------------------------------------*/
|
||||
|
||||
/*+ ##-######################################
|
||||
## MACRO AND FUNCTION FOR 3D MATHEMATICS
|
||||
######################################### */
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## Vector Operations
|
||||
############################## */
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vAddVector
|
||||
DESCRIPTION : Add two vectors : VectDest= VectA + VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vAddVector( VectDest, VectA, VectB) MTH3D_M_vAddVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSubVector
|
||||
DESCRIPTION : Sub two vectors : VectDest= VectA - VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSubVector( VectDest, VectA, VectB) MTH3D_M_vSubVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vNegVector
|
||||
DESCRIPTION : Negation of a vector : VectDest= - VectA
|
||||
INPUT : VectDest, VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vNegVector( VectDest, VectA) MTH3D_M_vNegVector( VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_bEqualVector
|
||||
DESCRIPTION : Test if two vectors are equal
|
||||
INPUT : VectA, VectB : address of sw_3D_tdstVector
|
||||
OUTPUT : VectA==VectB : Boolean
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_bEqualVector( VectA, VectB) MTH3D_M_bEqualVector( VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vAddScalarVector
|
||||
DESCRIPTION : Add a scalare with a vector : VectDest= a.Id + VectA
|
||||
INPUT : VectDest: address of sw_3D_tdstVector,
|
||||
a: SCA_td_sw, VectA: address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vAddScalarVector( VectDest, a, VectA) MTH3D_M_vAddScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSubScalarVector
|
||||
DESCRIPTION : Add a scalare with a vector : VectDest= VectA - a.Id
|
||||
INPUT : VectDest: address of sw_3D_tdstVector,
|
||||
a: SCA_td_sw, VectA: address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSubScalarVector( VectDest, a, VectA) MTH3D_M_vSubScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMulScalarVector
|
||||
DESCRIPTION : Multiplicate a scalare with a vector : VectDest= a*VectA
|
||||
INPUT : VectDest: address of sw_3D_tdstVector,
|
||||
a: SCA_td_sw, VectA: address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMulScalarVector( VectDest, a, VectA) MTH3D_M_vMulScalarVector( VectDest, a, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vDivScalarVector
|
||||
DESCRIPTION : Divide a vector by a scalare : VectDest= VectA/a
|
||||
INPUT : VectDest, VectA: address of sw_3D_tdstVector, a: SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vDivScalarVector( VectDest, VectA, a) MTH3D_M_vDivScalarVector( VectDest, VectA, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xDotProductVector
|
||||
DESCRIPTION : Return the Dot Product of two vectors
|
||||
INPUT : VectA, VectB : address of sw_3D_tdstVector
|
||||
OUTPUT : VectA.VectB : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xDotProductVector( VectA, VectB) MTH3D_M_xDotProductVector( VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vCrossProductVectorWithoutBuffer
|
||||
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB,
|
||||
VectDest must be a other vector
|
||||
INPUT : VectDest, VectA, VectA: address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_fn_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB) \
|
||||
MTH3D_M_vCrossProductVectorWithoutBuffer(_p_stVectDest, _p_stVectA, _p_stVectB)
|
||||
|
||||
#define sw_3D_M_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB) \
|
||||
sw_3D_fn_vCrossProductVectorWithoutBuffer(VectDest, VectA, VectB)
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vCrossProductVector
|
||||
DESCRIPTION : Calculate the cross product of two vectors : VectDest= VectA^VectB
|
||||
INPUT : VectDest, VectA, VectA: address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vCrossProductVector(VectDest,VectA,VectB) MTH3D_M_vCrossProductVector(VectDest,VectA,VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xSqrVector
|
||||
DESCRIPTION : Return the square of a vector
|
||||
INPUT : VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : VectA.VectA : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xSqrVector( VectA) MTH3D_M_xSqrVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xNormVector
|
||||
DESCRIPTION : Return the norm of a vector
|
||||
INPUT : VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : ||VectA|| : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xNormVector( VectA ) MTH3D_M_xNormVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xInvNormVector
|
||||
DESCRIPTION : Return the inverse of the norm of a vector
|
||||
INPUT : VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : 1/||VectA|| : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xInvNormVector( VectA ) MTH3D_M_xInvNormVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xVectorGapSqr
|
||||
DESCRIPTION : Return the square Gap between two vectors
|
||||
INPUT : VectA, VectB : address of sw_3D_tdstVector
|
||||
OUTPUT : Sqr(||VectA-VectB||) : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xVectorGapSqr(VectA, VectB) MTH3D_M_xVectorGapSqr(VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xVectorGap
|
||||
DESCRIPTION : Return the Gap between two vectors
|
||||
INPUT : VectA, VectB : address of sw_3D_tdstVector
|
||||
OUTPUT : ||VectA-VectB|| : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xVectorGap(VectA, VectB) MTH3D_M_xVectorGap(VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vFillVector
|
||||
DESCRIPTION : Fill each vector element with a value
|
||||
INPUT : VectA: address of sw_3D_tdstVector, a: SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vFillVector( VectDest, a) MTH3D_M_vFillVector( VectDest, a)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vNormalizeVector
|
||||
DESCRIPTION : Normalize a vector : VectDest= VectA/||VectA||
|
||||
INPUT : VectDest, VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vNormalizeVector(VectDest, VectA) MTH3D_M_vNormalizeVector(VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vGetVectorElements
|
||||
DESCRIPTION : Get x, y, z values of a vector
|
||||
INPUT : x, y, z : address of SCA_td_sw, VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vGetVectorElements( Vx, Vy, Vz, VectA) MTH3D_M_vGetVectorElements( Vx, Vy, Vz, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetVectorElements
|
||||
DESCRIPTION : Set a vector with x, y, z values
|
||||
INPUT : VectDest : address of sw_3D_tdstVector, x, y, z : address of SCA_td_sw,
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz) MTH3D_M_vSetVectorElements( VectDest, Vx, Vy, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xGetXofVector
|
||||
DESCRIPTION : Return x element of a vector
|
||||
INPUT : VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : x : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xGetXofVector( VectA ) MTH3D_M_xGetXofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetXofVector
|
||||
DESCRIPTION : Set x element of a vector
|
||||
INPUT : VectDest : address of sw_3D_tdstVector, Vx : SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetXofVector( VectDest, Vx) MTH3D_M_vSetXofVector( VectDest, Vx)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xGetYofVector
|
||||
DESCRIPTION : Return y element of a vector
|
||||
INPUT : VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : y : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xGetYofVector( VectA ) MTH3D_M_xGetYofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetYofVector
|
||||
DESCRIPTION : Set y element of a vector
|
||||
INPUT : VectDest : address of sw_3D_tdstVector, Vy : SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetYofVector( VectDest, Vy) MTH3D_M_vSetYofVector( VectDest, Vy)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xGetZofVector
|
||||
DESCRIPTION : Return z element of a vector
|
||||
INPUT : VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : z : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xGetZofVector( VectA ) MTH3D_M_xGetZofVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetZofVector
|
||||
DESCRIPTION : Set z element of a vector
|
||||
INPUT : VectDest : address of sw_3D_tdstVector, Vz : SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetZofVector( VectDest, Vz) MTH3D_M_vSetZofVector( VectDest, Vz)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vCopyVector
|
||||
DESCRIPTION : Copy a vector : VectDest=VectA
|
||||
INPUT : VectDest, VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vCopyVector( VectDest, VectA) MTH3D_M_vCopyVector( VectDest, VectA)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vNullVector
|
||||
DESCRIPTION : Set all elements of a vector to zero
|
||||
INPUT : VectDest : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vNullVector( VectDest) MTH3D_M_vNullVector( VectDest)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vScaleVector
|
||||
DESCRIPTION : Set each element of VectDest with the multiplication of element of VectA by element of VectB
|
||||
INPUT : VectDest, VectA, VectB : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vScaleVector( VectDest, VectA, VectB ) MTH3D_M_vScaleVector( VectDest, VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMiddleVector
|
||||
DESCRIPTION : Calculate the middle of two vectors : VectDest= (VectA+VectB)/2
|
||||
INPUT : VectDest, VectA, VectB : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMiddleVector( VectDest, VectA, VectB ) MTH3D_M_vMiddleVector( VectDest, VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vLinearInterpolVector
|
||||
DESCRIPTION : Calculate the lineat interpolation of two vectors : VectDest= VectA + t.(VectB-VectA)
|
||||
INPUT : VectDest, VectA, VectB: address of sw_3D_tdstVector, t: SCA_td_sw
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t) MTH3D_M_vLinearInterpolVector( VectDest, VectA, VectB, t)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMaxVector
|
||||
DESCRIPTION : Make a vector with max elements of two other vectors
|
||||
INPUT : VectDest, VectA, VectB: address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMaxVector( VectDest, VectA, VectB) MTH3D_M_vMaxVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMinVector
|
||||
DESCRIPTION : Make a vector with min elements of two other vectors
|
||||
INPUT : VectDest, VectA, VectB: address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMinVector( VectDest, VectA, VectB) MTH3D_M_vMinVector( VectDest, VectA, VectB)
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xDetxYVector
|
||||
DESCRIPTION : Return the 2D determinant between X and Y elements
|
||||
INPUT : VectA, VectB: address of sw_3D_tdstVector
|
||||
OUTPUT : DetxY |VectA, VectB| : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xDetxYVector( VectA, VectB ) MTH3D_M_xDetxYVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xDetYZVector
|
||||
DESCRIPTION : Return the 2D determinant between Y and Z elements
|
||||
INPUT : VectA, VectB: address of sw_3D_tdstVector
|
||||
OUTPUT : DetYZ |VectA, VectB| : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xDetYZVector( VectA, VectB ) MTH3D_M_xDetYZVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_xDetZXVector
|
||||
DESCRIPTION : Return the 2D determinant between Z and X elements
|
||||
INPUT : VectA, VectB: address of sw_3D_tdstVector
|
||||
OUTPUT : DetZX |VectA, VectB| : SCA_td_sw
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_xDetZXVector( VectA, VectB ) MTH3D_M_xDetZXVector( VectA, VectB )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_bIsNullVector
|
||||
DESCRIPTION : Test if a vector is null
|
||||
INPUT : VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : VectA==Null vector : Boolean
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_bIsNullVector( VectA ) MTH3D_M_bIsNullVector( VectA )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vMulAddVector
|
||||
DESCRIPTION : Multiply a scalar to a vector, and add it to a other vector: VectDest = x.VectA + VectB
|
||||
INPUT : VectDest: address of sw_3D_tdstVector,
|
||||
x: SCA_td_sw, VectA, VectB : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vMulAddVector( VectDest, x, VectA, VectB) MTH3D_M_vMulAddVector( VectDest, x, VectA, VectB)
|
||||
|
||||
/* sw_3D_M_vMullAddVector( VectDest, x, VectA, VectB) : VectDest = x.VectA + VectB */
|
||||
#define sw_3D_M_vMullAddVector sw_3D_M_vMulAddVector
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetBaseIVector
|
||||
DESCRIPTION : Set a vector to Ox base vector : VectDest = ( 1, 0, 0 )
|
||||
INPUT : VectDest: address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetBaseIVector( VectDest ) MTH3D_M_vSetBaseIVector( VectDest )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetBaseJVector
|
||||
DESCRIPTION : Set a vector to Oy base vector : VectDest = ( 0, 1, 0 )
|
||||
INPUT : VectDest: address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetBaseJVector( VectDest ) MTH3D_M_vSetBaseJVector( VectDest )
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vSetBaseKVector
|
||||
DESCRIPTION : Set a vector to Oz base vector : VectDest = ( 0, 0, 1 )
|
||||
INPUT : VectDest: address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
#define sw_3D_M_vSetBaseKVector( VectDest ) MTH3D_M_vSetBaseKVector( VectDest )
|
||||
|
||||
/* ##-###########################
|
||||
## 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)
|
||||
|
||||
|
||||
|
||||
/* ##-###########################
|
||||
## 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)
|
||||
|
||||
|
||||
/* ##M==================================================================================
|
||||
NAME : sw_3D_M_vPrintfVector
|
||||
DESCRIPTION : Print a Vector : Name + its values
|
||||
INPUT : Name : string
|
||||
VectA : address of sw_3D_tdstVector
|
||||
OUTPUT : void
|
||||
=======================================================================================*/
|
||||
__inline void Pf_sw(td_sw _xValue)
|
||||
{
|
||||
printf( " %e",_xValue );
|
||||
}
|
||||
|
||||
|
||||
__inline void sw_3D_fn_vPrintfVector( char * Name, sw_3D_tdstVector * VectA)
|
||||
{
|
||||
MTH3D_M_vPrintfVector( Name, VectA );
|
||||
}
|
||||
|
||||
#define sw_3D_M_vPrintfVector( Name, VectA) sw_3D_fn_vPrintfVector( Name, VectA)
|
||||
|
||||
|
||||
|
||||
#endif /* sw_3D_H */
|
Reference in New Issue
Block a user