1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     math_Matrix34.h
4 
5   Copyright (C)2009-2012 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 47498 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef NN_MATH_ARMV6_MATH_MATRIX34_H_
17 #define NN_MATH_ARMV6_MATH_MATRIX34_H_
18 
19 #include <cstring>
20 #include <nn/math/math_Config.h>
21 
22 #pragma push
23 #pragma Otime
24 
25 namespace nn {
26 namespace math {
27 namespace ARMv6 {
28 
29 MTX34* MTX34CopyAsm(MTX34* pOut, const MTX34* p);
30 MTX34* MTX34MultAsm(MTX34* pOut, const MTX34* p1, const MTX34* p2);
31 MTX34* MTX34MultAsm_ORG(MTX34* pOut, const MTX34* p1, const MTX34* p2);
32 MTX34* MTX34MultAsm(MTX34* pOut, const MTX34* p, f32 f);
33 MTX34* MTX34AddAsm(MTX34* pOut, const MTX34* p1, const MTX34* p2);
34 u32    MTX34InverseAsm(MTX34* pOut, const MTX34* p);
35 u32    MTX34InvTransposeAsm(MTX34* pOut, const MTX34* __restrict p);
36 MTX34* MTX34MAddAsm(MTX34* pOut, f32 t, const MTX34* p1, const MTX34* p2);
37 MTX34* MTX34MultScaleAsm(MTX34* pOut, const MTX34* pM, const VEC3* pS);
38 MTX34* MTX34MultScaleAsm(MTX34* pOut, const VEC3* __restrict pS, const MTX34* pM);
39 MTX34* MTX34MultTranslateAsm(MTX34* pOut, const VEC3* pT, const MTX34* pM);
40 MTX34* MTX34MultTranslateAsm(MTX34* pOut, const MTX34* pM, const VEC3* pT);
41 MTX34* MTX34ScaleAsm(MTX34* pOut, const VEC3* pS);
42 MTX34* MTX34TransposeAsm(MTX34* pOut, const MTX34* p);
43 VEC3*  VEC3TransformAsm(VEC3* pOut, const MTX34* __restrict pM, const VEC3* __restrict pV);
44 
45 NN_MATH_INLINE MTX34* MTX34ScaleC_FAST(MTX34* pOut, const VEC3* pS);
46 NN_MATH_INLINE MTX34* MTX34TranslateC_FAST(MTX34* pOut, const VEC3* pT);
47 NN_MATH_INLINE MTX34* MTX34RotAxisRad_C_FAST( MTX34* pOut, const VEC3 *pAxis, f32 fRad, bool isChangeTrans = true);
48 NN_MATH_INLINE MTX34* MTX34RotXYZFIdxC_FAST(MTX34* pOut, f32 fIdxX, f32 fIdxY, f32 fIdxZ, bool isChangeTrans = true);
49 NN_MATH_INLINE MTX34* MTX34LookAtC_FAST(MTX34* pOut, const VEC3* pCamPos, const VEC3* pCamUp, const VEC3* pTarget);
50 NN_MATH_INLINE MTX34* MTX34LookAtC_FAST(MTX34* pOut, const VEC3* pCamPos, f32 twist, const VEC3* pTarget);
51 NN_MATH_INLINE MTX34* MTX34CameraRotateC_FAST(MTX34* pOut, const VEC3* pCamPos, const VEC3* pCamRotate);
52 NN_MATH_INLINE MTX34* QUATToMTX34C_FAST(MTX34* pOut, const QUAT* pQ, bool isChangeTrans = true);
53 
54 
55 NN_MATH_INLINE VEC3*  VEC3TransformC(VEC3* pOut, const MTX34* __restrict pM, const VEC3* __restrict pV);
56 NN_MATH_INLINE MTX34* MTX34CopyC(MTX34* pOut, const MTX34* p);
57 NN_MATH_INLINE MTX34* MTX34MultC(MTX34* pOut, const MTX34* __restrict p1, const MTX34* __restrict p2);
58 NN_MATH_INLINE MTX34* MTX34MultC(MTX34* pOut, const MTX34* p, f32 f);
59 NN_MATH_INLINE MTX34* MTX34AddC(MTX34* pOut, const MTX34* p1, const MTX34* p2);
60 NN_MATH_INLINE MTX34* MTX34ScaleC(MTX34* pOut, const VEC3* pS);
61 NN_MATH_INLINE MTX34* MTX34MultScaleC(MTX34* pOut, const MTX34* pM, const VEC3* pS);
62 NN_MATH_INLINE MTX34* MTX34MultScaleC(MTX34* pOut, const VEC3* __restrict pS, const MTX34* pM);
63 NN_MATH_INLINE MTX34* MTX34TranslateC(MTX34* pOut, const VEC3* pT);
64 NN_MATH_INLINE MTX34* MTX34MultTranslateC(MTX34* pOut, const VEC3* pT, const MTX34* pM);
65 NN_MATH_INLINE MTX34* MTX34MultTranslateC(MTX34* pOut, const MTX34* pM, const VEC3* pT);
66 NN_MATH_INLINE MTX34* MTX34MAddC(MTX34* pOut, f32 t, const MTX34* p1, const MTX34* p2);
67 NN_MATH_INLINE MTX34* MTX34RotAxisRad_C( MTX34* pOut, const VEC3 *pAxis, f32 fRad, bool isChangeTrans = true );
68 NN_MATH_INLINE MTX34* MTX34RotXYZFIdxC(MTX34* pOut, f32 fIdxX, f32 fIdxY, f32 fIdxZ, bool isChangeTrans = true );
69 NN_MATH_INLINE u32    MTX34InverseC(MTX34* pOut, const MTX34* p);
70 NN_MATH_INLINE MTX34* MTX34TransposeC(MTX34* pOut, const MTX34* p);
71 NN_MATH_INLINE u32    MTX34InvTransposeC(MTX34* pOut, const MTX34* __restrict p);
72 NN_MATH_INLINE MTX34* MTX34LookAtC(MTX34* pOut, const VEC3* pCamPos, const VEC3* pCamUp, const VEC3* pTarget);
73 NN_MATH_INLINE MTX34* MTX34LookAtC(MTX34* pOut, const VEC3* pCamPos, f32 twist, const VEC3* pTarget);
74 NN_MATH_INLINE MTX34* MTX34CameraRotateC(MTX34* pOut, const VEC3* pCamPos, const VEC3* pCamRotate);
75 NN_MATH_INLINE MTX34* QUATToMTX34C(MTX34* pOut, const QUAT* pQ, bool isChangeTrans = true);
76 
77 }  // namespcae ARMv6
78 }  // namespace math
79 }  // namespace nn
80 
81 
82 #pragma pop
83 
84 /* NN_MATH_ARMV6_MATH_MATRIX34_H_ */
85 #endif
86