1/*---------------------------------------------------------------------------*
2  Project:  Horizon
3  File:     math_Matrix43.ipp
4
5  Copyright (C)2009-2010 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  $Revision: 17112 $
14 *---------------------------------------------------------------------------*/
15#include <nn/math/math_Matrix43.h>
16
17namespace nn { namespace math {
18
19/* Please see man pages for details
20
21
22*/
23
24/*
25
26
27
28
29
30 */
31NN_MATH_INLINE bool
32MTX43IsIdentity(const MTX43* p)
33{
34    return p->f._00 == 1.f && p->f._01 == 0.f && p->f._02 == 0.f &&
35           p->f._10 == 0.f && p->f._11 == 1.f && p->f._12 == 0.f &&
36           p->f._20 == 0.f && p->f._21 == 0.f && p->f._22 == 1.f &&
37           p->f._30 == 0.f && p->f._31 == 0.f && p->f._32 == 0.f;
38}
39
40/*
41
42
43
44
45
46 */
47NN_MATH_INLINE MTX43*
48MTX43Zero(MTX43* pOut)
49{
50    NN_NULL_ASSERT( pOut );
51
52    pOut->f._00 = pOut->f._01 = pOut->f._02 =
53    pOut->f._10 = pOut->f._11 = pOut->f._12 =
54    pOut->f._20 = pOut->f._21 = pOut->f._22 =
55    pOut->f._30 = pOut->f._31 = pOut->f._32 = 0.f;
56
57    return pOut;
58}
59
60/*
61
62
63
64
65
66 */
67NN_MATH_INLINE MTX43*
68MTX43Identity(MTX43* pOut)
69{
70    NN_NULL_ASSERT( pOut );
71
72    MTX43Copy(pOut, MTX43::Identity());
73
74    return pOut;
75}
76
77/*
78
79
80
81
82
83
84
85 */
86NN_MATH_INLINE MTX43*
87MTX43Sub(MTX43* pOut, const MTX43* p1, const MTX43* p2)
88{
89    NN_NULL_ASSERT( pOut );
90    NN_NULL_ASSERT( p1 );
91    NN_NULL_ASSERT( p2 );
92
93    pOut->f._00 = p1->f._00 - p2->f._00;
94    pOut->f._01 = p1->f._01 - p2->f._01;
95    pOut->f._02 = p1->f._02 - p2->f._02;
96
97    pOut->f._10 = p1->f._10 - p2->f._10;
98    pOut->f._11 = p1->f._11 - p2->f._11;
99    pOut->f._12 = p1->f._12 - p2->f._12;
100
101    pOut->f._20 = p1->f._20 - p2->f._20;
102    pOut->f._21 = p1->f._21 - p2->f._21;
103    pOut->f._22 = p1->f._22 - p2->f._22;
104
105    pOut->f._30 = p1->f._30 - p2->f._30;
106    pOut->f._31 = p1->f._31 - p2->f._31;
107    pOut->f._32 = p1->f._32 - p2->f._32;
108
109    return pOut;
110}
111
112
113/*
114
115*/
116
117}  // namespace math
118}  // namespace nn
119