Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
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
21typedef struct {float x, y, z, w;} Quat; /* Quaternion */
22enum QuatPart {X, Y, Z, W};
23typedef Quat HVect; /* Homogeneous 3D vector */
24typedef float HMatrix[4][4]; /* Right-handed, for column vectors */
25typedef 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 */
32float polar_decomp(HMatrix M, HMatrix Q, HMatrix S);
34Quat snuggle(Quat q, HVect *k);
35void decomp_affine(HMatrix A, AffineParts *parts);
36void invert_affine(AffineParts *parts, AffineParts *inverse);
37#endif
float HMatrix[4][4]
Definition: Decompose.h:24
QuatPart
Definition: Decompose.h:22
@ Y
Definition: Decompose.h:22
@ X
Definition: Decompose.h:22
@ Z
Definition: Decompose.h:22
@ W
Definition: Decompose.h:22
float polar_decomp(HMatrix M, HMatrix Q, HMatrix S)
Definition: Decompose.cpp:274
HVect spect_decomp(HMatrix S, HMatrix U)
Definition: Decompose.cpp:325
Quat snuggle(Quat q, HVect *k)
Definition: Decompose.cpp:400
Quat HVect
Definition: Decompose.h:23
void decomp_affine(HMatrix A, AffineParts *parts)
Definition: Decompose.cpp:505
void invert_affine(AffineParts *parts, AffineParts *inverse)
Definition: Decompose.cpp:527
Definition: Decompose.h:25
float f
Definition: Decompose.h:30
HVect t
Definition: Decompose.h:26
Quat u
Definition: Decompose.h:28
Quat q
Definition: Decompose.h:27
HVect k
Definition: Decompose.h:29
Definition: Decompose.h:21
float w
Definition: Decompose.h:21