FreeWRL / FreeX3D 4.3.0
Decompose.h
1/**** Decompose.h - Basic declarations ****/
2#ifndef _H_Decompose
3#define _H_Decompose
4typedef struct {float x, y, z, w;} Quat; /* Quaternion */
5enum QuatPart {X, Y, Z, W};
6typedef Quat HVect; /* Homogeneous 3D vector */
7typedef float HMatrix[4][4]; /* Right-handed, for column vectors */
8typedef struct {
9 HVect t; /* Translation components */
10 Quat q; /* Essential rotation */
11 Quat u; /* Stretch rotation */
12 HVect k; /* Stretch factors */
13 float f; /* Sign of determinant */
15float polar_decomp(HMatrix M, HMatrix Q, HMatrix S);
16HVect spect_decomp(HMatrix S, HMatrix U);
17Quat snuggle(Quat q, HVect *k);
18void decomp_affine(HMatrix A, AffineParts *parts);
19void invert_affine(AffineParts *parts, AffineParts *inverse);
20#endif