tge/lib/dtsSDKPlus/decomp/Decompose.h
2017-04-17 06:17:10 -06:00

35 lines
1.1 KiB
C++
Executable File

//-----------------------------------------------------------------------------
// Torque Game Engine
// Copyright (C) GarageGames.com, Inc.
//-----------------------------------------------------------------------------
/**** Decompose.h - Basic declarations ****/
#ifndef _H_Decompose
#define _H_Decompose
#include "../DTSPlusTypes.h"
namespace GraphicGems
{
typedef struct {F64 x, y, z, w;} Quat; /* Quaternion */
enum QuatPart {X, Y, Z, W};
typedef Quat HVect; /* Homogeneous 3D vector */
typedef F64 HMatrix[4][4]; /* Right-handed, for column vectors */
typedef struct {
HVect t; /* Translation components */
Quat q; /* Essential rotation */
Quat u; /* Stretch rotation */
HVect k; /* Stretch factors */
F64 f; /* Sign of determinant */
} AffineParts;
F64 polar_decomp(HMatrix M, HMatrix Q, HMatrix S);
HVect spect_decomp(HMatrix S, HMatrix U);
Quat snuggle(Quat q, HVect *k);
void decomp_affine(HMatrix A, AffineParts *parts);
void invert_affine(AffineParts *parts, AffineParts *inverse);
}; // namespace GraphicGems
#endif