Pyrogenesis  trunk
Decompose.h
Go to the documentation of this file.
1 /* Copyright (C) 2009 Wildfire Games.
2  * This file is part of 0 A.D.
3  *
4  * 0 A.D. is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * 0 A.D. is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 /**** Decompose.h - Basic declarations ****/
19 #ifndef INCLUDED_DECOMPOSE
20 #define INCLUDED_DECOMPOSE
21 typedef struct {float x, y, z, w;} Quat; /* Quaternion */
22 enum QuatPart {X, Y, Z, W};
23 typedef Quat HVect; /* Homogeneous 3D vector */
24 typedef float HMatrix[4][4]; /* Right-handed, for column vectors */
25 typedef struct {
26  HVect t; /* Translation components */
27  Quat q; /* Essential rotation */
28  Quat u; /* Stretch rotation */
29  HVect k; /* Stretch factors */
30  float f; /* Sign of determinant */
31 } AffineParts;
32 float polar_decomp(HMatrix M, HMatrix Q, HMatrix S);
34 Quat snuggle(Quat q, HVect *k);
35 void decomp_affine(HMatrix A, AffineParts *parts);
36 void invert_affine(AffineParts *parts, AffineParts *inverse);
37 #endif
Quat u
Definition: Decompose.h:28
Definition: Decompose.h:22
Quat HVect
Definition: Decompose.h:23
HVect k
Definition: Decompose.h:29
float z
Definition: Decompose.h:21
Definition: Decompose.h:22
HVect t
Definition: Decompose.h:26
float HMatrix[4][4]
Definition: Decompose.h:24
HVect spect_decomp(HMatrix S, HMatrix U)
Definition: Decompose.cpp:326
float f
Definition: Decompose.h:30
Definition: Decompose.h:22
Quat q
Definition: Decompose.h:27
QuatPart
Definition: Decompose.h:22
float polar_decomp(HMatrix M, HMatrix Q, HMatrix S)
Definition: Decompose.cpp:274
Quat snuggle(Quat q, HVect *k)
Definition: Decompose.cpp:381
Definition: Decompose.h:22
Definition: Decompose.h:21
void invert_affine(AffineParts *parts, AffineParts *inverse)
Definition: Decompose.cpp:508
Definition: cache.cpp:318
void decomp_affine(HMatrix A, AffineParts *parts)
Definition: Decompose.cpp:486
Definition: Decompose.h:25