mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
Eliminate hsScalar and hsFixed
Modern CPUs support floats just fine... hsFixed was crazy.
This commit is contained in:
@ -244,7 +244,7 @@ void hsAffineParts::ComposeMatrix(hsMatrix44 *out) const
|
||||
hsVector3 R[3];
|
||||
QuatTo3Vectors(fQ, R);
|
||||
|
||||
hsScalar f = fF < 0 ? -1.f : 1.f;
|
||||
float f = fF < 0 ? -1.f : 1.f;
|
||||
for( i = 0; i < 3; i++ )
|
||||
{
|
||||
for( j = 0; j < 3; j++ )
|
||||
@ -274,7 +274,7 @@ void hsAffineParts::ComposeInverseMatrix(hsMatrix44 *out) const
|
||||
// Build scale factor matrix
|
||||
hsMatrix44 K;
|
||||
hsVector3 invK;
|
||||
invK.Set(hsScalarInvert(fK.fX),hsScalarInvert(fK.fY),hsScalarInvert(fK.fZ));
|
||||
invK.Set(hsInvert(fK.fX),hsInvert(fK.fY),hsInvert(fK.fZ));
|
||||
K.MakeScaleMat(&invK);
|
||||
|
||||
// Build Utranspose matrix
|
||||
@ -357,7 +357,7 @@ void hsAffineParts::ComposeInverseMatrix(hsMatrix44 *out) const
|
||||
int i, j;
|
||||
|
||||
hsVector3 invK;
|
||||
invK.Set(hsScalarInvert(fK.fX),hsScalarInvert(fK.fY),hsScalarInvert(fK.fZ));
|
||||
invK.Set(hsInvert(fK.fX),hsInvert(fK.fY),hsInvert(fK.fZ));
|
||||
hsVector3 UK[3];
|
||||
for( i = 0; i < 3; i++ )
|
||||
{
|
||||
@ -378,7 +378,7 @@ void hsAffineParts::ComposeInverseMatrix(hsMatrix44 *out) const
|
||||
hsVector3 Rt[3];
|
||||
QuatTo3VectorsTranspose(fQ.Conjugate(), Rt);
|
||||
|
||||
hsScalar f = fF < 0 ? -1.f : 1.f;
|
||||
float f = fF < 0 ? -1.f : 1.f;
|
||||
for( i = 0; i < 3; i++ )
|
||||
{
|
||||
for( j = 0; j < 3; j++ )
|
||||
|
@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
#include <float.h> // for FLT_EPSILON
|
||||
#include <math.h>
|
||||
#include "hsEuler.h"
|
||||
#include "hsQuat.h"
|
||||
#include "hsMatrix44.h"
|
||||
@ -67,7 +68,7 @@ void hsEuler::GetQuat(hsQuat* qu)
|
||||
EulGetOrd(ea.fOrder,i,j,k,h,n,s,f);
|
||||
if (f==EulFrmR)
|
||||
{
|
||||
hsScalar t = ea.fX; ea.fX = ea.fZ; ea.fZ = t;
|
||||
float t = ea.fX; ea.fX = ea.fZ; ea.fZ = t;
|
||||
}
|
||||
if (n==EulParOdd)
|
||||
ea.fY = -ea.fY;
|
||||
@ -108,7 +109,7 @@ void hsEuler::GetMatrix44(hsMatrix44* mat)
|
||||
EulGetOrd(ea.fOrder,i,j,k,h,n,s,f);
|
||||
if (f==EulFrmR)
|
||||
{
|
||||
hsScalar t = ea.fX; ea.fX = ea.fZ; ea.fZ = t;
|
||||
float t = ea.fX; ea.fX = ea.fZ; ea.fZ = t;
|
||||
}
|
||||
if (n==EulParOdd)
|
||||
{
|
||||
@ -195,7 +196,7 @@ void hsEuler::SetFromMatrix44(const hsMatrix44* mat, uint32_t order)
|
||||
}
|
||||
if (f==EulFrmR)
|
||||
{
|
||||
hsScalar t = fX; fX = fZ; fZ = t;
|
||||
float t = fX; fX = fZ; fZ = t;
|
||||
}
|
||||
fOrder = order;
|
||||
}
|
||||
|
@ -115,10 +115,10 @@ class hsQuat;
|
||||
class hsEuler
|
||||
{
|
||||
public:
|
||||
hsScalar fX,fY,fZ;
|
||||
float fX,fY,fZ;
|
||||
uint32_t fOrder;
|
||||
|
||||
hsEuler(hsScalar ai, hsScalar aj, hsScalar ah, uint32_t order) : fX(ai),fY(aj),fZ(ah),fOrder(order) {}
|
||||
hsEuler(float ai, float aj, float ah, uint32_t order) : fX(ai),fY(aj),fZ(ah),fOrder(order) {}
|
||||
|
||||
// getters, converters
|
||||
void GetQuat(hsQuat* res );
|
||||
|
Reference in New Issue
Block a user