ReactOS  0.4.14-dev-604-gcfdd483
d3dx9math.h File Reference
#include <d3dx9.h>
#include <math.h>
#include <d3dx9math.inl>
Include dependency graph for d3dx9math.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  D3DXVECTOR2
 
struct  D3DXVECTOR4
 
struct  D3DXQUATERNION
 
struct  D3DXPLANE
 
struct  D3DXCOLOR
 
struct  D3DXFLOAT16
 

Macros

#define D3DX_PI   ((FLOAT)3.141592654)
 
#define D3DX_1BYPI   ((FLOAT)0.318309886)
 
#define D3DXSH_MINORDER   2
 
#define D3DXSH_MAXORDER   6
 
#define D3DXToRadian(degree)   ((degree) * (D3DX_PI / 180.0f))
 
#define D3DXToDegree(radian)   ((radian) * (180.0f / D3DX_PI))
 
#define INTERFACE   ID3DXMatrixStack
 
#define ID3DXMatrixStack_QueryInterface(p, a, b)   (p)->lpVtbl->QueryInterface(p,a,b)
 
#define ID3DXMatrixStack_AddRef(p)   (p)->lpVtbl->AddRef(p)
 
#define ID3DXMatrixStack_Release(p)   (p)->lpVtbl->Release(p)
 
#define ID3DXMatrixStack_Pop(p)   (p)->lpVtbl->Pop(p)
 
#define ID3DXMatrixStack_Push(p)   (p)->lpVtbl->Push(p)
 
#define ID3DXMatrixStack_LoadIdentity(p)   (p)->lpVtbl->LoadIdentity(p)
 
#define ID3DXMatrixStack_LoadMatrix(p, a)   (p)->lpVtbl->LoadMatrix(p,a)
 
#define ID3DXMatrixStack_MultMatrix(p, a)   (p)->lpVtbl->MultMatrix(p,a)
 
#define ID3DXMatrixStack_MultMatrixLocal(p, a)   (p)->lpVtbl->MultMatrixLocal(p,a)
 
#define ID3DXMatrixStack_RotateAxis(p, a, b)   (p)->lpVtbl->RotateAxis(p,a,b)
 
#define ID3DXMatrixStack_RotateAxisLocal(p, a, b)   (p)->lpVtbl->RotateAxisLocal(p,a,b)
 
#define ID3DXMatrixStack_RotateYawPitchRoll(p, a, b, c)   (p)->lpVtbl->RotateYawPitchRoll(p,a,b,c)
 
#define ID3DXMatrixStack_RotateYawPitchRollLocal(p, a, b, c)   (p)->lpVtbl->RotateYawPitchRollLocal(p,a,b,c)
 
#define ID3DXMatrixStack_Scale(p, a, b, c)   (p)->lpVtbl->Scale(p,a,b,c)
 
#define ID3DXMatrixStack_ScaleLocal(p, a, b, c)   (p)->lpVtbl->ScaleLocal(p,a,b,c)
 
#define ID3DXMatrixStack_Translate(p, a, b, c)   (p)->lpVtbl->Translate(p,a,b,c)
 
#define ID3DXMatrixStack_TranslateLocal(p, a, b, c)   (p)->lpVtbl->TranslateLocal(p,a,b,c)
 
#define ID3DXMatrixStack_GetTop(p)   (p)->lpVtbl->GetTop(p)
 

Typedefs

typedef struct D3DXVECTOR2 D3DXVECTOR2
 
typedef struct D3DXVECTOR2LPD3DXVECTOR2
 
typedef struct _D3DVECTOR D3DXVECTOR3
 
typedef struct _D3DVECTORLPD3DXVECTOR3
 
typedef struct D3DXVECTOR4 D3DXVECTOR4
 
typedef struct D3DXVECTOR4LPD3DXVECTOR4
 
typedef struct _D3DMATRIX D3DXMATRIX
 
typedef struct _D3DMATRIXLPD3DXMATRIX
 
typedef struct D3DXQUATERNION D3DXQUATERNION
 
typedef struct D3DXQUATERNIONLPD3DXQUATERNION
 
typedef struct D3DXPLANE D3DXPLANE
 
typedef struct D3DXPLANELPD3DXPLANE
 
typedef struct D3DXCOLOR D3DXCOLOR
 
typedef struct D3DXCOLORLPD3DXCOLOR
 
typedef struct D3DXFLOAT16 D3DXFLOAT16
 
typedef struct D3DXFLOAT16LPD3DXFLOAT16
 
typedef interface ID3DXMatrixStack * LPD3DXMATRIXSTACK
 

Functions

D3DXCOLOR *WINAPI D3DXColorAdjustContrast (D3DXCOLOR *pout, const D3DXCOLOR *pc, FLOAT s)
 
D3DXCOLOR *WINAPI D3DXColorAdjustSaturation (D3DXCOLOR *pout, const D3DXCOLOR *pc, FLOAT s)
 
FLOAT WINAPI D3DXFresnelTerm (FLOAT costheta, FLOAT refractionindex)
 
D3DXMATRIX *WINAPI D3DXMatrixAffineTransformation (D3DXMATRIX *pout, FLOAT scaling, const D3DXVECTOR3 *rotationcenter, const D3DXQUATERNION *rotation, const D3DXVECTOR3 *translation)
 
D3DXMATRIX *WINAPI D3DXMatrixAffineTransformation2D (D3DXMATRIX *pout, FLOAT scaling, const D3DXVECTOR2 *protationcenter, FLOAT rotation, const D3DXVECTOR2 *ptranslation)
 
HRESULT WINAPI D3DXMatrixDecompose (D3DXVECTOR3 *poutscale, D3DXQUATERNION *poutrotation, D3DXVECTOR3 *pouttranslation, const D3DXMATRIX *pm)
 
FLOAT WINAPI D3DXMatrixDeterminant (const D3DXMATRIX *pm)
 
D3DXMATRIX *WINAPI D3DXMatrixInverse (D3DXMATRIX *pout, FLOAT *pdeterminant, const D3DXMATRIX *pm)
 
D3DXMATRIX *WINAPI D3DXMatrixLookAtLH (D3DXMATRIX *pout, const D3DXVECTOR3 *peye, const D3DXVECTOR3 *pat, const D3DXVECTOR3 *pup)
 
D3DXMATRIX *WINAPI D3DXMatrixLookAtRH (D3DXMATRIX *pout, const D3DXVECTOR3 *peye, const D3DXVECTOR3 *pat, const D3DXVECTOR3 *pup)
 
D3DXMATRIX *WINAPI D3DXMatrixMultiply (D3DXMATRIX *pout, const D3DXMATRIX *pm1, const D3DXMATRIX *pm2)
 
D3DXMATRIX *WINAPI D3DXMatrixMultiplyTranspose (D3DXMATRIX *pout, const D3DXMATRIX *pm1, const D3DXMATRIX *pm2)
 
D3DXMATRIX *WINAPI D3DXMatrixOrthoLH (D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
 
D3DXMATRIX *WINAPI D3DXMatrixOrthoOffCenterLH (D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
 
D3DXMATRIX *WINAPI D3DXMatrixOrthoOffCenterRH (D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
 
D3DXMATRIX *WINAPI D3DXMatrixOrthoRH (D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
 
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveFovLH (D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf)
 
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveFovRH (D3DXMATRIX *pout, FLOAT fovy, FLOAT aspect, FLOAT zn, FLOAT zf)
 
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveLH (D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
 
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveOffCenterLH (D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
 
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveOffCenterRH (D3DXMATRIX *pout, FLOAT l, FLOAT r, FLOAT b, FLOAT t, FLOAT zn, FLOAT zf)
 
D3DXMATRIX *WINAPI D3DXMatrixPerspectiveRH (D3DXMATRIX *pout, FLOAT w, FLOAT h, FLOAT zn, FLOAT zf)
 
D3DXMATRIX *WINAPI D3DXMatrixReflect (D3DXMATRIX *pout, const D3DXPLANE *pplane)
 
D3DXMATRIX *WINAPI D3DXMatrixRotationAxis (D3DXMATRIX *pout, const D3DXVECTOR3 *pv, FLOAT angle)
 
D3DXMATRIX *WINAPI D3DXMatrixRotationQuaternion (D3DXMATRIX *pout, const D3DXQUATERNION *pq)
 
D3DXMATRIX *WINAPI D3DXMatrixRotationX (D3DXMATRIX *pout, FLOAT angle)
 
D3DXMATRIX *WINAPI D3DXMatrixRotationY (D3DXMATRIX *pout, FLOAT angle)
 
D3DXMATRIX *WINAPI D3DXMatrixRotationYawPitchRoll (D3DXMATRIX *pout, FLOAT yaw, FLOAT pitch, FLOAT roll)
 
D3DXMATRIX *WINAPI D3DXMatrixRotationZ (D3DXMATRIX *pout, FLOAT angle)
 
D3DXMATRIX *WINAPI D3DXMatrixScaling (D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz)
 
D3DXMATRIX *WINAPI D3DXMatrixShadow (D3DXMATRIX *pout, const D3DXVECTOR4 *plight, const D3DXPLANE *pPlane)
 
D3DXMATRIX *WINAPI D3DXMatrixTransformation (D3DXMATRIX *pout, const D3DXVECTOR3 *pscalingcenter, const D3DXQUATERNION *pscalingrotation, const D3DXVECTOR3 *pscaling, const D3DXVECTOR3 *protationcenter, const D3DXQUATERNION *protation, const D3DXVECTOR3 *ptranslation)
 
D3DXMATRIX *WINAPI D3DXMatrixTransformation2D (D3DXMATRIX *pout, const D3DXVECTOR2 *pscalingcenter, FLOAT scalingrotation, const D3DXVECTOR2 *pscaling, const D3DXVECTOR2 *protationcenter, FLOAT rotation, const D3DXVECTOR2 *ptranslation)
 
D3DXMATRIX *WINAPI D3DXMatrixTranslation (D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z)
 
D3DXMATRIX *WINAPI D3DXMatrixTranspose (D3DXMATRIX *pout, const D3DXMATRIX *pm)
 
D3DXPLANE *WINAPI D3DXPlaneFromPointNormal (D3DXPLANE *pout, const D3DXVECTOR3 *pvpoint, const D3DXVECTOR3 *pvnormal)
 
D3DXPLANE *WINAPI D3DXPlaneFromPoints (D3DXPLANE *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2, const D3DXVECTOR3 *pv3)
 
D3DXVECTOR3 *WINAPI D3DXPlaneIntersectLine (D3DXVECTOR3 *pout, const D3DXPLANE *pp, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2)
 
D3DXPLANE *WINAPI D3DXPlaneNormalize (D3DXPLANE *pout, const D3DXPLANE *pp)
 
D3DXPLANE *WINAPI D3DXPlaneTransform (D3DXPLANE *pout, const D3DXPLANE *pplane, const D3DXMATRIX *pm)
 
D3DXPLANE *WINAPI D3DXPlaneTransformArray (D3DXPLANE *pout, UINT outstride, const D3DXPLANE *pplane, UINT pstride, const D3DXMATRIX *pm, UINT n)
 
D3DXQUATERNION *WINAPI D3DXQuaternionBaryCentric (D3DXQUATERNION *pout, const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2, const D3DXQUATERNION *pq3, FLOAT f, FLOAT g)
 
D3DXQUATERNION *WINAPI D3DXQuaternionExp (D3DXQUATERNION *pout, const D3DXQUATERNION *pq)
 
D3DXQUATERNION *WINAPI D3DXQuaternionInverse (D3DXQUATERNION *pout, const D3DXQUATERNION *pq)
 
D3DXQUATERNION *WINAPI D3DXQuaternionLn (D3DXQUATERNION *pout, const D3DXQUATERNION *pq)
 
D3DXQUATERNION *WINAPI D3DXQuaternionMultiply (D3DXQUATERNION *pout, const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2)
 
D3DXQUATERNION *WINAPI D3DXQuaternionNormalize (D3DXQUATERNION *pout, const D3DXQUATERNION *pq)
 
D3DXQUATERNION *WINAPI D3DXQuaternionRotationAxis (D3DXQUATERNION *pout, const D3DXVECTOR3 *pv, FLOAT angle)
 
D3DXQUATERNION *WINAPI D3DXQuaternionRotationMatrix (D3DXQUATERNION *pout, const D3DXMATRIX *pm)
 
D3DXQUATERNION *WINAPI D3DXQuaternionRotationYawPitchRoll (D3DXQUATERNION *pout, FLOAT yaw, FLOAT pitch, FLOAT roll)
 
D3DXQUATERNION *WINAPI D3DXQuaternionSlerp (D3DXQUATERNION *pout, const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2, FLOAT t)
 
D3DXQUATERNION *WINAPI D3DXQuaternionSquad (D3DXQUATERNION *pout, const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2, const D3DXQUATERNION *pq3, const D3DXQUATERNION *pq4, FLOAT t)
 
void WINAPI D3DXQuaternionSquadSetup (D3DXQUATERNION *paout, D3DXQUATERNION *pbout, D3DXQUATERNION *pcout, const D3DXQUATERNION *pq0, const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2, const D3DXQUATERNION *pq3)
 
void WINAPI D3DXQuaternionToAxisAngle (const D3DXQUATERNION *pq, D3DXVECTOR3 *paxis, FLOAT *pangle)
 
D3DXVECTOR2 *WINAPI D3DXVec2BaryCentric (D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2, const D3DXVECTOR2 *pv3, FLOAT f, FLOAT g)
 
D3DXVECTOR2 *WINAPI D3DXVec2CatmullRom (D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv0, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pv2, const D3DXVECTOR2 *pv3, FLOAT s)
 
D3DXVECTOR2 *WINAPI D3DXVec2Hermite (D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv1, const D3DXVECTOR2 *pt1, const D3DXVECTOR2 *pv2, const D3DXVECTOR2 *pt2, FLOAT s)
 
D3DXVECTOR2 *WINAPI D3DXVec2Normalize (D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv)
 
D3DXVECTOR4 *WINAPI D3DXVec2Transform (D3DXVECTOR4 *pout, const D3DXVECTOR2 *pv, const D3DXMATRIX *pm)
 
D3DXVECTOR4 *WINAPI D3DXVec2TransformArray (D3DXVECTOR4 *pout, UINT outstride, const D3DXVECTOR2 *pv, UINT vstride, const D3DXMATRIX *pm, UINT n)
 
D3DXVECTOR2 *WINAPI D3DXVec2TransformCoord (D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv, const D3DXMATRIX *pm)
 
D3DXVECTOR2 *WINAPI D3DXVec2TransformCoordArray (D3DXVECTOR2 *pout, UINT outstride, const D3DXVECTOR2 *pv, UINT vstride, const D3DXMATRIX *pm, UINT n)
 
D3DXVECTOR2 *WINAPI D3DXVec2TransformNormal (D3DXVECTOR2 *pout, const D3DXVECTOR2 *pv, const D3DXMATRIX *pm)
 
D3DXVECTOR2 *WINAPI D3DXVec2TransformNormalArray (D3DXVECTOR2 *pout, UINT outstride, const D3DXVECTOR2 *pv, UINT vstride, const D3DXMATRIX *pm, UINT n)
 
D3DXVECTOR3 *WINAPI D3DXVec3BaryCentric (D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2, const D3DXVECTOR3 *pv3, FLOAT f, FLOAT g)
 
D3DXVECTOR3 *WINAPI D3DXVec3CatmullRom (D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv0, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pv2, const D3DXVECTOR3 *pv3, FLOAT s)
 
D3DXVECTOR3 *WINAPI D3DXVec3Hermite (D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv1, const D3DXVECTOR3 *pt1, const D3DXVECTOR3 *pv2, const D3DXVECTOR3 *pt2, FLOAT s)
 
D3DXVECTOR3 *WINAPI D3DXVec3Normalize (D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
 
D3DXVECTOR3 *WINAPI D3DXVec3Project (D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DVIEWPORT9 *pviewport, const D3DXMATRIX *pprojection, const D3DXMATRIX *pview, const D3DXMATRIX *pworld)
 
D3DXVECTOR3 *WINAPI D3DXVec3ProjectArray (D3DXVECTOR3 *pout, UINT outstride, const D3DXVECTOR3 *pv, UINT vstride, const D3DVIEWPORT9 *pviewport, const D3DXMATRIX *pprojection, const D3DXMATRIX *pview, const D3DXMATRIX *pworld, UINT n)
 
D3DXVECTOR4 *WINAPI D3DXVec3Transform (D3DXVECTOR4 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
 
D3DXVECTOR4 *WINAPI D3DXVec3TransformArray (D3DXVECTOR4 *pout, UINT outstride, const D3DXVECTOR3 *pv, UINT vstride, const D3DXMATRIX *pm, UINT n)
 
D3DXVECTOR3 *WINAPI D3DXVec3TransformCoord (D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
 
D3DXVECTOR3 *WINAPI D3DXVec3TransformCoordArray (D3DXVECTOR3 *pout, UINT outstride, const D3DXVECTOR3 *pv, UINT vstride, const D3DXMATRIX *pm, UINT n)
 
D3DXVECTOR3 *WINAPI D3DXVec3TransformNormal (D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DXMATRIX *pm)
 
D3DXVECTOR3 *WINAPI D3DXVec3TransformNormalArray (D3DXVECTOR3 *pout, UINT outstride, const D3DXVECTOR3 *pv, UINT vstride, const D3DXMATRIX *pm, UINT n)
 
D3DXVECTOR3 *WINAPI D3DXVec3Unproject (D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv, const D3DVIEWPORT9 *pviewport, const D3DXMATRIX *pprojection, const D3DXMATRIX *pview, const D3DXMATRIX *pworld)
 
D3DXVECTOR3 *WINAPI D3DXVec3UnprojectArray (D3DXVECTOR3 *pout, UINT outstride, const D3DXVECTOR3 *pv, UINT vstride, const D3DVIEWPORT9 *pviewport, const D3DXMATRIX *pprojection, const D3DXMATRIX *pview, const D3DXMATRIX *pworld, UINT n)
 
D3DXVECTOR4 *WINAPI D3DXVec4BaryCentric (D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv1, const D3DXVECTOR4 *pv2, const D3DXVECTOR4 *pv3, FLOAT f, FLOAT g)
 
D3DXVECTOR4 *WINAPI D3DXVec4CatmullRom (D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv0, const D3DXVECTOR4 *pv1, const D3DXVECTOR4 *pv2, const D3DXVECTOR4 *pv3, FLOAT s)
 
D3DXVECTOR4 *WINAPI D3DXVec4Cross (D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv1, const D3DXVECTOR4 *pv2, const D3DXVECTOR4 *pv3)
 
D3DXVECTOR4 *WINAPI D3DXVec4Hermite (D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv1, const D3DXVECTOR4 *pt1, const D3DXVECTOR4 *pv2, const D3DXVECTOR4 *pt2, FLOAT s)
 
D3DXVECTOR4 *WINAPI D3DXVec4Normalize (D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv)
 
D3DXVECTOR4 *WINAPI D3DXVec4Transform (D3DXVECTOR4 *pout, const D3DXVECTOR4 *pv, const D3DXMATRIX *pm)
 
D3DXVECTOR4 *WINAPI D3DXVec4TransformArray (D3DXVECTOR4 *pout, UINT outstride, const D3DXVECTOR4 *pv, UINT vstride, const D3DXMATRIX *pm, UINT n)
 
D3DXFLOAT16 *WINAPI D3DXFloat32To16Array (D3DXFLOAT16 *pout, const FLOAT *pin, UINT n)
 
FLOAT *WINAPI D3DXFloat16To32Array (FLOAT *pout, const D3DXFLOAT16 *pin, UINT n)
 
FLOAT *WINAPI D3DXSHAdd (FLOAT *out, UINT order, const FLOAT *a, const FLOAT *b)
 
FLOAT WINAPI D3DXSHDot (UINT order, const FLOAT *a, const FLOAT *b)
 
HRESULT WINAPI D3DXSHEvalConeLight (UINT order, const D3DXVECTOR3 *dir, FLOAT radius, FLOAT Rintensity, FLOAT Gintensity, FLOAT Bintensity, FLOAT *rout, FLOAT *gout, FLOAT *bout)
 
FLOAT *WINAPI D3DXSHEvalDirection (FLOAT *out, UINT order, const D3DXVECTOR3 *dir)
 
HRESULT WINAPI D3DXSHEvalDirectionalLight (UINT order, const D3DXVECTOR3 *dir, FLOAT Rintensity, FLOAT Gintensity, FLOAT Bintensity, FLOAT *rout, FLOAT *gout, FLOAT *bout)
 
HRESULT WINAPI D3DXSHEvalHemisphereLight (UINT order, const D3DXVECTOR3 *dir, D3DXCOLOR top, D3DXCOLOR bottom, FLOAT *rout, FLOAT *gout, FLOAT *bout)
 
HRESULT WINAPI D3DXSHEvalSphericalLight (UINT order, const D3DXVECTOR3 *dir, FLOAT radius, FLOAT Rintensity, FLOAT Gintensity, FLOAT Bintensity, FLOAT *rout, FLOAT *gout, FLOAT *bout)
 
FLOAT *WINAPI D3DXSHMultiply2 (FLOAT *out, const FLOAT *a, const FLOAT *b)
 
FLOAT *WINAPI D3DXSHMultiply3 (FLOAT *out, const FLOAT *a, const FLOAT *b)
 
FLOAT *WINAPI D3DXSHMultiply4 (FLOAT *out, const FLOAT *a, const FLOAT *b)
 
FLOAT *WINAPI D3DXSHRotate (FLOAT *out, UINT order, const D3DXMATRIX *matrix, const FLOAT *in)
 
FLOAT *WINAPI D3DXSHRotateZ (FLOAT *out, UINT order, FLOAT angle, const FLOAT *in)
 
FLOAT *WINAPI D3DXSHScale (FLOAT *out, UINT order, const FLOAT *a, const FLOAT scale)
 
 DEFINE_GUID (IID_ID3DXMatrixStack, 0xc7885ba7, 0xf990, 0x4fe7, 0x92, 0x2d, 0x85, 0x15, 0xe4, 0x77, 0xdd, 0x85)
 
 DECLARE_INTERFACE_ (ID3DXMatrixStack, IUnknown)
 
HRESULT WINAPI D3DXCreateMatrixStack (DWORD flags, ID3DXMatrixStack **stack)
 

Macro Definition Documentation

◆ D3DX_1BYPI

#define D3DX_1BYPI   ((FLOAT)0.318309886)

Definition at line 28 of file d3dx9math.h.

◆ D3DX_PI

#define D3DX_PI   ((FLOAT)3.141592654)

Definition at line 27 of file d3dx9math.h.

◆ D3DXSH_MAXORDER

#define D3DXSH_MAXORDER   6

Definition at line 31 of file d3dx9math.h.

◆ D3DXSH_MINORDER

#define D3DXSH_MINORDER   2

Definition at line 30 of file d3dx9math.h.

◆ D3DXToDegree

#define D3DXToDegree (   radian)    ((radian) * (180.0f / D3DX_PI))

Definition at line 34 of file d3dx9math.h.

◆ D3DXToRadian

#define D3DXToRadian (   degree)    ((degree) * (D3DX_PI / 180.0f))

Definition at line 33 of file d3dx9math.h.

◆ ID3DXMatrixStack_AddRef

#define ID3DXMatrixStack_AddRef (   p)    (p)->lpVtbl->AddRef(p)

Definition at line 442 of file d3dx9math.h.

◆ ID3DXMatrixStack_GetTop

#define ID3DXMatrixStack_GetTop (   p)    (p)->lpVtbl->GetTop(p)

Definition at line 458 of file d3dx9math.h.

◆ ID3DXMatrixStack_LoadIdentity

#define ID3DXMatrixStack_LoadIdentity (   p)    (p)->lpVtbl->LoadIdentity(p)

Definition at line 446 of file d3dx9math.h.

◆ ID3DXMatrixStack_LoadMatrix

#define ID3DXMatrixStack_LoadMatrix (   p,
  a 
)    (p)->lpVtbl->LoadMatrix(p,a)

Definition at line 447 of file d3dx9math.h.

◆ ID3DXMatrixStack_MultMatrix

#define ID3DXMatrixStack_MultMatrix (   p,
  a 
)    (p)->lpVtbl->MultMatrix(p,a)

Definition at line 448 of file d3dx9math.h.

◆ ID3DXMatrixStack_MultMatrixLocal

#define ID3DXMatrixStack_MultMatrixLocal (   p,
  a 
)    (p)->lpVtbl->MultMatrixLocal(p,a)

Definition at line 449 of file d3dx9math.h.

◆ ID3DXMatrixStack_Pop

#define ID3DXMatrixStack_Pop (   p)    (p)->lpVtbl->Pop(p)

Definition at line 444 of file d3dx9math.h.

◆ ID3DXMatrixStack_Push

#define ID3DXMatrixStack_Push (   p)    (p)->lpVtbl->Push(p)

Definition at line 445 of file d3dx9math.h.

◆ ID3DXMatrixStack_QueryInterface

#define ID3DXMatrixStack_QueryInterface (   p,
  a,
  b 
)    (p)->lpVtbl->QueryInterface(p,a,b)

Definition at line 441 of file d3dx9math.h.

◆ ID3DXMatrixStack_Release

#define ID3DXMatrixStack_Release (   p)    (p)->lpVtbl->Release(p)

Definition at line 443 of file d3dx9math.h.

◆ ID3DXMatrixStack_RotateAxis

#define ID3DXMatrixStack_RotateAxis (   p,
  a,
  b 
)    (p)->lpVtbl->RotateAxis(p,a,b)

Definition at line 450 of file d3dx9math.h.

◆ ID3DXMatrixStack_RotateAxisLocal

#define ID3DXMatrixStack_RotateAxisLocal (   p,
  a,
  b 
)    (p)->lpVtbl->RotateAxisLocal(p,a,b)

Definition at line 451 of file d3dx9math.h.

◆ ID3DXMatrixStack_RotateYawPitchRoll

#define ID3DXMatrixStack_RotateYawPitchRoll (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->RotateYawPitchRoll(p,a,b,c)

Definition at line 452 of file d3dx9math.h.

◆ ID3DXMatrixStack_RotateYawPitchRollLocal

#define ID3DXMatrixStack_RotateYawPitchRollLocal (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->RotateYawPitchRollLocal(p,a,b,c)

Definition at line 453 of file d3dx9math.h.

◆ ID3DXMatrixStack_Scale

#define ID3DXMatrixStack_Scale (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->Scale(p,a,b,c)

Definition at line 454 of file d3dx9math.h.

◆ ID3DXMatrixStack_ScaleLocal

#define ID3DXMatrixStack_ScaleLocal (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->ScaleLocal(p,a,b,c)

Definition at line 455 of file d3dx9math.h.

◆ ID3DXMatrixStack_Translate

#define ID3DXMatrixStack_Translate (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->Translate(p,a,b,c)

Definition at line 456 of file d3dx9math.h.

◆ ID3DXMatrixStack_TranslateLocal

#define ID3DXMatrixStack_TranslateLocal (   p,
  a,
  b,
  c 
)    (p)->lpVtbl->TranslateLocal(p,a,b,c)

Definition at line 457 of file d3dx9math.h.

◆ INTERFACE

#define INTERFACE   ID3DXMatrixStack

Definition at line 413 of file d3dx9math.h.

Typedef Documentation

◆ D3DXCOLOR

◆ D3DXFLOAT16

◆ D3DXMATRIX

Definition at line 169 of file d3dx9math.h.

◆ D3DXPLANE

◆ D3DXQUATERNION

◆ D3DXVECTOR2

◆ D3DXVECTOR3

Definition at line 97 of file d3dx9math.h.

◆ D3DXVECTOR4

◆ LPD3DXCOLOR

◆ LPD3DXFLOAT16

◆ LPD3DXMATRIX

Definition at line 169 of file d3dx9math.h.

◆ LPD3DXMATRIXSTACK

typedef interface ID3DXMatrixStack* LPD3DXMATRIXSTACK

Definition at line 407 of file d3dx9math.h.

◆ LPD3DXPLANE

◆ LPD3DXQUATERNION

◆ LPD3DXVECTOR2

◆ LPD3DXVECTOR3

Definition at line 97 of file d3dx9math.h.

◆ LPD3DXVECTOR4

Function Documentation

◆ D3DXColorAdjustContrast()

D3DXCOLOR* WINAPI D3DXColorAdjustContrast ( D3DXCOLOR pout,
const D3DXCOLOR pc,
FLOAT  s 
)

Definition at line 46 of file math.c.

47 {
48  TRACE("pout %p, pc %p, s %f\n", pout, pc, s);
49 
50  pout->r = 0.5f + s * (pc->r - 0.5f);
51  pout->g = 0.5f + s * (pc->g - 0.5f);
52  pout->b = 0.5f + s * (pc->b - 0.5f);
53  pout->a = pc->a;
54  return pout;
55 }
FLOAT g
Definition: d3dx9math.h:262
FLOAT a
Definition: d3dx9math.h:262
FLOAT r
Definition: d3dx9math.h:262
#define TRACE(s)
Definition: solgame.cpp:4
GLdouble s
Definition: gl.h:2039
FLOAT b
Definition: d3dx9math.h:262

◆ D3DXColorAdjustSaturation()

D3DXCOLOR* WINAPI D3DXColorAdjustSaturation ( D3DXCOLOR pout,
const D3DXCOLOR pc,
FLOAT  s 
)

Definition at line 57 of file math.c.

58 {
59  FLOAT grey;
60 
61  TRACE("pout %p, pc %p, s %f\n", pout, pc, s);
62 
63  grey = pc->r * 0.2125f + pc->g * 0.7154f + pc->b * 0.0721f;
64  pout->r = grey + s * (pc->r - grey);
65  pout->g = grey + s * (pc->g - grey);
66  pout->b = grey + s * (pc->b - grey);
67  pout->a = pc->a;
68  return pout;
69 }
FLOAT g
Definition: d3dx9math.h:262
FLOAT a
Definition: d3dx9math.h:262
FLOAT r
Definition: d3dx9math.h:262
#define TRACE(s)
Definition: solgame.cpp:4
GLdouble s
Definition: gl.h:2039
FLOAT b
Definition: d3dx9math.h:262
float FLOAT
Definition: typedefs.h:67

◆ D3DXCreateMatrixStack()

HRESULT WINAPI D3DXCreateMatrixStack ( DWORD  flags,
ID3DXMatrixStack **  stack 
)

Definition at line 1215 of file math.c.

1216 {
1217  struct ID3DXMatrixStackImpl *object;
1218 
1219  TRACE("flags %#x, stack %p.\n", flags, stack);
1220 
1221  if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
1222  {
1223  *stack = NULL;
1224  return E_OUTOFMEMORY;
1225  }
1226  object->ID3DXMatrixStack_iface.lpVtbl = &ID3DXMatrixStack_Vtbl;
1227  object->ref = 1;
1228 
1229  if (!(object->stack = HeapAlloc(GetProcessHeap(), 0, INITIAL_STACK_SIZE * sizeof(*object->stack))))
1230  {
1231  HeapFree(GetProcessHeap(), 0, object);
1232  *stack = NULL;
1233  return E_OUTOFMEMORY;
1234  }
1235 
1236  object->current = 0;
1237  object->stack_size = INITIAL_STACK_SIZE;
1238  D3DXMatrixIdentity(&object->stack[0]);
1239 
1240  TRACE("Created matrix stack %p.\n", object);
1241 
1242  *stack = &object->ID3DXMatrixStack_iface;
1243  return D3D_OK;
1244 }
static const unsigned int INITIAL_STACK_SIZE
Definition: math.c:42
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
smooth NULL
Definition: ftsmooth.c:416
Definition: _stack.h:47
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
GLbitfield flags
Definition: glext.h:7161
#define D3D_OK
Definition: d3d.h:106
static const ID3DXMatrixStackVtbl ID3DXMatrixStack_Vtbl
Definition: math.c:1193
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define HeapFree(x, y, z)
Definition: compat.h:402
void * object
Definition: jmemsys.h:48

◆ D3DXFloat16To32Array()

FLOAT* WINAPI D3DXFloat16To32Array ( FLOAT pout,
const D3DXFLOAT16 pin,
UINT  n 
)

Definition at line 2265 of file math.c.

2266 {
2267  unsigned int i;
2268 
2269  TRACE("pout %p, pin %p, n %u\n", pout, pin, n);
2270 
2271  for (i = 0; i < n; ++i)
2272  {
2273  pout[i] = float_16_to_32(pin[i].value);
2274  }
2275 
2276  return pout;
2277 }
GLdouble n
Definition: glext.h:7729
float float_16_to_32(const unsigned short in)
Definition: math.c:2247
Definition: regsvr.c:103
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by convert_component(), weld_float16_2(), and weld_float16_4().

◆ D3DXFloat32To16Array()

D3DXFLOAT16* WINAPI D3DXFloat32To16Array ( D3DXFLOAT16 pout,
const FLOAT pin,
UINT  n 
)

Definition at line 2231 of file math.c.

2232 {
2233  unsigned int i;
2234 
2235  TRACE("pout %p, pin %p, n %u\n", pout, pin, n);
2236 
2237  for (i = 0; i < n; ++i)
2238  {
2239  pout[i].value = float_32_to_16(pin[i]);
2240  }
2241 
2242  return pout;
2243 }
WORD value
Definition: d3dx9math.h:277
unsigned short float_32_to_16(const float in)
Definition: math.c:2146
GLdouble n
Definition: glext.h:7729
Definition: regsvr.c:103
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by convert_float4().

◆ D3DXFresnelTerm()

FLOAT WINAPI D3DXFresnelTerm ( FLOAT  costheta,
FLOAT  refractionindex 
)

Definition at line 73 of file math.c.

74 {
75  FLOAT a, d, g, result;
76 
77  TRACE("costheta %f, refractionindex %f\n", costheta, refractionindex);
78 
79  g = sqrtf(refractionindex * refractionindex + costheta * costheta - 1.0f);
80  a = g + costheta;
81  d = g - costheta;
82  result = (costheta * a - 1.0f) * (costheta * a - 1.0f) / ((costheta * d + 1.0f) * (costheta * d + 1.0f)) + 1.0f;
83  result *= 0.5f * d * d / (a * a);
84 
85  return result;
86 }
#define a
Definition: ke_i.h:78
GLboolean GLboolean g
Definition: glext.h:6204
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
#define d
Definition: ke_i.h:81
#define sqrtf(x)
Definition: mymath.h:59
float FLOAT
Definition: typedefs.h:67
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
GLuint64EXT * result
Definition: glext.h:11304

◆ D3DXMatrixAffineTransformation()

D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation ( D3DXMATRIX pout,
FLOAT  scaling,
const D3DXVECTOR3 rotationcenter,
const D3DXQUATERNION rotation,
const D3DXVECTOR3 translation 
)

Definition at line 90 of file math.c.

92 {
93  TRACE("out %p, scaling %f, rotationcenter %p, rotation %p, translation %p\n",
94  out, scaling, rotationcenter, rotation, translation);
95 
96  D3DXMatrixIdentity(out);
97 
98  if (rotation)
99  {
100  FLOAT temp00, temp01, temp02, temp10, temp11, temp12, temp20, temp21, temp22;
101 
102  temp00 = 1.0f - 2.0f * (rotation->y * rotation->y + rotation->z * rotation->z);
103  temp01 = 2.0f * (rotation->x * rotation->y + rotation->z * rotation->w);
104  temp02 = 2.0f * (rotation->x * rotation->z - rotation->y * rotation->w);
105  temp10 = 2.0f * (rotation->x * rotation->y - rotation->z * rotation->w);
106  temp11 = 1.0f - 2.0f * (rotation->x * rotation->x + rotation->z * rotation->z);
107  temp12 = 2.0f * (rotation->y * rotation->z + rotation->x * rotation->w);
108  temp20 = 2.0f * (rotation->x * rotation->z + rotation->y * rotation->w);
109  temp21 = 2.0f * (rotation->y * rotation->z - rotation->x * rotation->w);
110  temp22 = 1.0f - 2.0f * (rotation->x * rotation->x + rotation->y * rotation->y);
111 
112  out->u.m[0][0] = scaling * temp00;
113  out->u.m[0][1] = scaling * temp01;
114  out->u.m[0][2] = scaling * temp02;
115  out->u.m[1][0] = scaling * temp10;
116  out->u.m[1][1] = scaling * temp11;
117  out->u.m[1][2] = scaling * temp12;
118  out->u.m[2][0] = scaling * temp20;
119  out->u.m[2][1] = scaling * temp21;
120  out->u.m[2][2] = scaling * temp22;
121 
122  if (rotationcenter)
123  {
124  out->u.m[3][0] = rotationcenter->x * (1.0f - temp00) - rotationcenter->y * temp10
125  - rotationcenter->z * temp20;
126  out->u.m[3][1] = rotationcenter->y * (1.0f - temp11) - rotationcenter->x * temp01
127  - rotationcenter->z * temp21;
128  out->u.m[3][2] = rotationcenter->z * (1.0f - temp22) - rotationcenter->x * temp02
129  - rotationcenter->y * temp12;
130  }
131  }
132  else
133  {
134  out->u.m[0][0] = scaling;
135  out->u.m[1][1] = scaling;
136  out->u.m[2][2] = scaling;
137  }
138 
139  if (translation)
140  {
141  out->u.m[3][0] += translation->x;
142  out->u.m[3][1] += translation->y;
143  out->u.m[3][2] += translation->z;
144  }
145 
146  return out;
147 }
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
float FLOAT
Definition: typedefs.h:67

◆ D3DXMatrixAffineTransformation2D()

D3DXMATRIX* WINAPI D3DXMatrixAffineTransformation2D ( D3DXMATRIX pout,
FLOAT  scaling,
const D3DXVECTOR2 protationcenter,
FLOAT  rotation,
const D3DXVECTOR2 ptranslation 
)

Definition at line 149 of file math.c.

151 {
152  FLOAT tmp1, tmp2, s;
153 
154  TRACE("out %p, scaling %f, rotationcenter %p, rotation %f, translation %p\n",
155  out, scaling, rotationcenter, rotation, translation);
156 
157  s = sinf(rotation / 2.0f);
158  tmp1 = 1.0f - 2.0f * s * s;
159  tmp2 = 2.0f * s * cosf(rotation / 2.0f);
160 
161  D3DXMatrixIdentity(out);
162  out->u.m[0][0] = scaling * tmp1;
163  out->u.m[0][1] = scaling * tmp2;
164  out->u.m[1][0] = -scaling * tmp2;
165  out->u.m[1][1] = scaling * tmp1;
166 
167  if (rotationcenter)
168  {
169  FLOAT x, y;
170 
171  x = rotationcenter->x;
172  y = rotationcenter->y;
173 
174  out->u.m[3][0] = y * tmp2 - x * tmp1 + x;
175  out->u.m[3][1] = -x * tmp2 - y * tmp1 + y;
176  }
177 
178  if (translation)
179  {
180  out->u.m[3][0] += translation->x;
181  out->u.m[3][1] += translation->y;
182  }
183 
184  return out;
185 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
#define cosf
Definition: cosf.c:6
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
GLdouble s
Definition: gl.h:2039
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
float FLOAT
Definition: typedefs.h:67
#define sinf
Definition: sinf.c:6

◆ D3DXMatrixDecompose()

HRESULT WINAPI D3DXMatrixDecompose ( D3DXVECTOR3 poutscale,
D3DXQUATERNION poutrotation,
D3DXVECTOR3 pouttranslation,
const D3DXMATRIX pm 
)

Definition at line 187 of file math.c.

188 {
191 
192  TRACE("poutscale %p, poutrotation %p, pouttranslation %p, pm %p\n", poutscale, poutrotation, pouttranslation, pm);
193 
194  /*Compute the scaling part.*/
195  vec.x=pm->u.m[0][0];
196  vec.y=pm->u.m[0][1];
197  vec.z=pm->u.m[0][2];
198  poutscale->x=D3DXVec3Length(&vec);
199 
200  vec.x=pm->u.m[1][0];
201  vec.y=pm->u.m[1][1];
202  vec.z=pm->u.m[1][2];
203  poutscale->y=D3DXVec3Length(&vec);
204 
205  vec.x=pm->u.m[2][0];
206  vec.y=pm->u.m[2][1];
207  vec.z=pm->u.m[2][2];
208  poutscale->z=D3DXVec3Length(&vec);
209 
210  /*Compute the translation part.*/
211  pouttranslation->x=pm->u.m[3][0];
212  pouttranslation->y=pm->u.m[3][1];
213  pouttranslation->z=pm->u.m[3][2];
214 
215  /*Let's calculate the rotation now*/
216  if ( (poutscale->x == 0.0f) || (poutscale->y == 0.0f) || (poutscale->z == 0.0f) ) return D3DERR_INVALIDCALL;
217 
218  normalized.u.m[0][0]=pm->u.m[0][0]/poutscale->x;
219  normalized.u.m[0][1]=pm->u.m[0][1]/poutscale->x;
220  normalized.u.m[0][2]=pm->u.m[0][2]/poutscale->x;
221  normalized.u.m[1][0]=pm->u.m[1][0]/poutscale->y;
222  normalized.u.m[1][1]=pm->u.m[1][1]/poutscale->y;
223  normalized.u.m[1][2]=pm->u.m[1][2]/poutscale->y;
224  normalized.u.m[2][0]=pm->u.m[2][0]/poutscale->z;
225  normalized.u.m[2][1]=pm->u.m[2][1]/poutscale->z;
226  normalized.u.m[2][2]=pm->u.m[2][2]/poutscale->z;
227 
229  return S_OK;
230 }
FT_Pos y
Definition: ftimage.h:77
FT_Pos x
Definition: ftimage.h:76
static LPMONITOREX pm
Definition: localmon.c:45
#define D3DERR_INVALIDCALL
#define TRACE(s)
Definition: solgame.cpp:4
D3DXQUATERNION *WINAPI D3DXQuaternionRotationMatrix(D3DXQUATERNION *out, const D3DXMATRIX *m)
Definition: math.c:1467
FT_Vector * vec
Definition: ftbbox.c:448
#define S_OK
Definition: intsafe.h:59
GLint GLenum GLboolean normalized
Definition: glext.h:6117

◆ D3DXMatrixDeterminant()

FLOAT WINAPI D3DXMatrixDeterminant ( const D3DXMATRIX pm)

Definition at line 232 of file math.c.

233 {
234  FLOAT t[3], v[4];
235 
236  TRACE("pm %p\n", pm);
237 
238  t[0] = pm->u.m[2][2] * pm->u.m[3][3] - pm->u.m[2][3] * pm->u.m[3][2];
239  t[1] = pm->u.m[1][2] * pm->u.m[3][3] - pm->u.m[1][3] * pm->u.m[3][2];
240  t[2] = pm->u.m[1][2] * pm->u.m[2][3] - pm->u.m[1][3] * pm->u.m[2][2];
241  v[0] = pm->u.m[1][1] * t[0] - pm->u.m[2][1] * t[1] + pm->u.m[3][1] * t[2];
242  v[1] = -pm->u.m[1][0] * t[0] + pm->u.m[2][0] * t[1] - pm->u.m[3][0] * t[2];
243 
244  t[0] = pm->u.m[1][0] * pm->u.m[2][1] - pm->u.m[2][0] * pm->u.m[1][1];
245  t[1] = pm->u.m[1][0] * pm->u.m[3][1] - pm->u.m[3][0] * pm->u.m[1][1];
246  t[2] = pm->u.m[2][0] * pm->u.m[3][1] - pm->u.m[3][0] * pm->u.m[2][1];
247  v[2] = pm->u.m[3][3] * t[0] - pm->u.m[2][3] * t[1] + pm->u.m[1][3] * t[2];
248  v[3] = -pm->u.m[3][2] * t[0] + pm->u.m[2][2] * t[1] - pm->u.m[1][2] * t[2];
249 
250  return pm->u.m[0][0] * v[0] + pm->u.m[0][1] * v[1] +
251  pm->u.m[0][2] * v[2] + pm->u.m[0][3] * v[3];
252 }
static LPMONITOREX pm
Definition: localmon.c:45
GLdouble GLdouble t
Definition: gl.h:2047
#define TRACE(s)
Definition: solgame.cpp:4
const GLdouble * v
Definition: gl.h:2040
float FLOAT
Definition: typedefs.h:67

◆ D3DXMatrixInverse()

D3DXMATRIX* WINAPI D3DXMatrixInverse ( D3DXMATRIX pout,
FLOAT pdeterminant,
const D3DXMATRIX pm 
)

Definition at line 254 of file math.c.

255 {
256  FLOAT det, t[3], v[16];
257  UINT i, j;
258 
259  TRACE("pout %p, pdeterminant %p, pm %p\n", pout, pdeterminant, pm);
260 
261  t[0] = pm->u.m[2][2] * pm->u.m[3][3] - pm->u.m[2][3] * pm->u.m[3][2];
262  t[1] = pm->u.m[1][2] * pm->u.m[3][3] - pm->u.m[1][3] * pm->u.m[3][2];
263  t[2] = pm->u.m[1][2] * pm->u.m[2][3] - pm->u.m[1][3] * pm->u.m[2][2];
264  v[0] = pm->u.m[1][1] * t[0] - pm->u.m[2][1] * t[1] + pm->u.m[3][1] * t[2];
265  v[4] = -pm->u.m[1][0] * t[0] + pm->u.m[2][0] * t[1] - pm->u.m[3][0] * t[2];
266 
267  t[0] = pm->u.m[1][0] * pm->u.m[2][1] - pm->u.m[2][0] * pm->u.m[1][1];
268  t[1] = pm->u.m[1][0] * pm->u.m[3][1] - pm->u.m[3][0] * pm->u.m[1][1];
269  t[2] = pm->u.m[2][0] * pm->u.m[3][1] - pm->u.m[3][0] * pm->u.m[2][1];
270  v[8] = pm->u.m[3][3] * t[0] - pm->u.m[2][3] * t[1] + pm->u.m[1][3] * t[2];
271  v[12] = -pm->u.m[3][2] * t[0] + pm->u.m[2][2] * t[1] - pm->u.m[1][2] * t[2];
272 
273  det = pm->u.m[0][0] * v[0] + pm->u.m[0][1] * v[4] +
274  pm->u.m[0][2] * v[8] + pm->u.m[0][3] * v[12];
275  if (det == 0.0f)
276  return NULL;
277  if (pdeterminant)
278  *pdeterminant = det;
279 
280  t[0] = pm->u.m[2][2] * pm->u.m[3][3] - pm->u.m[2][3] * pm->u.m[3][2];
281  t[1] = pm->u.m[0][2] * pm->u.m[3][3] - pm->u.m[0][3] * pm->u.m[3][2];
282  t[2] = pm->u.m[0][2] * pm->u.m[2][3] - pm->u.m[0][3] * pm->u.m[2][2];
283  v[1] = -pm->u.m[0][1] * t[0] + pm->u.m[2][1] * t[1] - pm->u.m[3][1] * t[2];
284  v[5] = pm->u.m[0][0] * t[0] - pm->u.m[2][0] * t[1] + pm->u.m[3][0] * t[2];
285 
286  t[0] = pm->u.m[0][0] * pm->u.m[2][1] - pm->u.m[2][0] * pm->u.m[0][1];
287  t[1] = pm->u.m[3][0] * pm->u.m[0][1] - pm->u.m[0][0] * pm->u.m[3][1];
288  t[2] = pm->u.m[2][0] * pm->u.m[3][1] - pm->u.m[3][0] * pm->u.m[2][1];
289  v[9] = -pm->u.m[3][3] * t[0] - pm->u.m[2][3] * t[1]- pm->u.m[0][3] * t[2];
290  v[13] = pm->u.m[3][2] * t[0] + pm->u.m[2][2] * t[1] + pm->u.m[0][2] * t[2];
291 
292  t[0] = pm->u.m[1][2] * pm->u.m[3][3] - pm->u.m[1][3] * pm->u.m[3][2];
293  t[1] = pm->u.m[0][2] * pm->u.m[3][3] - pm->u.m[0][3] * pm->u.m[3][2];
294  t[2] = pm->u.m[0][2] * pm->u.m[1][3] - pm->u.m[0][3] * pm->u.m[1][2];
295  v[2] = pm->u.m[0][1] * t[0] - pm->u.m[1][1] * t[1] + pm->u.m[3][1] * t[2];
296  v[6] = -pm->u.m[0][0] * t[0] + pm->u.m[1][0] * t[1] - pm->u.m[3][0] * t[2];
297 
298  t[0] = pm->u.m[0][0] * pm->u.m[1][1] - pm->u.m[1][0] * pm->u.m[0][1];
299  t[1] = pm->u.m[3][0] * pm->u.m[0][1] - pm->u.m[0][0] * pm->u.m[3][1];
300  t[2] = pm->u.m[1][0] * pm->u.m[3][1] - pm->u.m[3][0] * pm->u.m[1][1];
301  v[10] = pm->u.m[3][3] * t[0] + pm->u.m[1][3] * t[1] + pm->u.m[0][3] * t[2];
302  v[14] = -pm->u.m[3][2] * t[0] - pm->u.m[1][2] * t[1] - pm->u.m[0][2] * t[2];
303 
304  t[0] = pm->u.m[1][2] * pm->u.m[2][3] - pm->u.m[1][3] * pm->u.m[2][2];
305  t[1] = pm->u.m[0][2] * pm->u.m[2][3] - pm->u.m[0][3] * pm->u.m[2][2];
306  t[2] = pm->u.m[0][2] * pm->u.m[1][3] - pm->u.m[0][3] * pm->u.m[1][2];
307  v[3] = -pm->u.m[0][1] * t[0] + pm->u.m[1][1] * t[1] - pm->u.m[2][1] * t[2];
308  v[7] = pm->u.m[0][0] * t[0] - pm->u.m[1][0] * t[1] + pm->u.m[2][0] * t[2];
309 
310  v[11] = -pm->u.m[0][0] * (pm->u.m[1][1] * pm->u.m[2][3] - pm->u.m[1][3] * pm->u.m[2][1]) +
311  pm->u.m[1][0] * (pm->u.m[0][1] * pm->u.m[2][3] - pm->u.m[0][3] * pm->u.m[2][1]) -
312  pm->u.m[2][0] * (pm->u.m[0][1] * pm->u.m[1][3] - pm->u.m[0][3] * pm->u.m[1][1]);
313 
314  v[15] = pm->u.m[0][0] * (pm->u.m[1][1] * pm->u.m[2][2] - pm->u.m[1][2] * pm->u.m[2][1]) -
315  pm->u.m[1][0] * (pm->u.m[0][1] * pm->u.m[2][2] - pm->u.m[0][2] * pm->u.m[2][1]) +
316  pm->u.m[2][0] * (pm->u.m[0][1] * pm->u.m[1][2] - pm->u.m[0][2] * pm->u.m[1][1]);
317 
318  det = 1.0f / det;
319 
320  for (i = 0; i < 4; i++)
321  for (j = 0; j < 4; j++)
322  pout->u.m[i][j] = v[4 * i + j] * det;
323 
324  return pout;
325 }
static LPMONITOREX pm
Definition: localmon.c:45
GLdouble GLdouble t
Definition: gl.h:2047
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
const GLdouble * v
Definition: gl.h:2040
unsigned int UINT
Definition: ndis.h:50
float m[4][4]
Definition: d3d8types.h:1116
float FLOAT
Definition: typedefs.h:67

Referenced by d3dx9_skin_info_UpdateSkinnedMesh(), D3DXIntersectTri(), and D3DXVec3Unproject().

◆ D3DXMatrixLookAtLH()

D3DXMATRIX* WINAPI D3DXMatrixLookAtLH ( D3DXMATRIX pout,
const D3DXVECTOR3 peye,
const D3DXVECTOR3 pat,
const D3DXVECTOR3 pup 
)

Definition at line 327 of file math.c.

329 {
330  D3DXVECTOR3 right, upn, vec;
331 
332  TRACE("out %p, eye %p, at %p, up %p\n", out, eye, at, up);
333 
334  D3DXVec3Subtract(&vec, at, eye);
336  D3DXVec3Cross(&right, up, &vec);
337  D3DXVec3Cross(&upn, &vec, &right);
339  D3DXVec3Normalize(&upn, &upn);
340  out->u.m[0][0] = right.x;
341  out->u.m[1][0] = right.y;
342  out->u.m[2][0] = right.z;
343  out->u.m[3][0] = -D3DXVec3Dot(&right, eye);
344  out->u.m[0][1] = upn.x;
345  out->u.m[1][1] = upn.y;
346  out->u.m[2][1] = upn.z;
347  out->u.m[3][1] = -D3DXVec3Dot(&upn, eye);
348  out->u.m[0][2] = vec.x;
349  out->u.m[1][2] = vec.y;
350  out->u.m[2][2] = vec.z;
351  out->u.m[3][2] = -D3DXVec3Dot(&vec, eye);
352  out->u.m[0][3] = 0.0f;
353  out->u.m[1][3] = 0.0f;
354  out->u.m[2][3] = 0.0f;
355  out->u.m[3][3] = 1.0f;
356 
357  return out;
358 }
FT_Pos y
Definition: ftimage.h:77
FT_Pos x
Definition: ftimage.h:76
#define up(mutex)
Definition: glue.h:30
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
GLdouble GLdouble right
Definition: glext.h:10859
FT_Vector * vec
Definition: ftbbox.c:448
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
Definition: math.c:1849

◆ D3DXMatrixLookAtRH()

D3DXMATRIX* WINAPI D3DXMatrixLookAtRH ( D3DXMATRIX pout,
const D3DXVECTOR3 peye,
const D3DXVECTOR3 pat,
const D3DXVECTOR3 pup 
)

Definition at line 360 of file math.c.

362 {
363  D3DXVECTOR3 right, upn, vec;
364 
365  TRACE("out %p, eye %p, at %p, up %p\n", out, eye, at, up);
366 
367  D3DXVec3Subtract(&vec, at, eye);
369  D3DXVec3Cross(&right, up, &vec);
370  D3DXVec3Cross(&upn, &vec, &right);
372  D3DXVec3Normalize(&upn, &upn);
373  out->u.m[0][0] = -right.x;
374  out->u.m[1][0] = -right.y;
375  out->u.m[2][0] = -right.z;
376  out->u.m[3][0] = D3DXVec3Dot(&right, eye);
377  out->u.m[0][1] = upn.x;
378  out->u.m[1][1] = upn.y;
379  out->u.m[2][1] = upn.z;
380  out->u.m[3][1] = -D3DXVec3Dot(&upn, eye);
381  out->u.m[0][2] = -vec.x;
382  out->u.m[1][2] = -vec.y;
383  out->u.m[2][2] = -vec.z;
384  out->u.m[3][2] = D3DXVec3Dot(&vec, eye);
385  out->u.m[0][3] = 0.0f;
386  out->u.m[1][3] = 0.0f;
387  out->u.m[2][3] = 0.0f;
388  out->u.m[3][3] = 1.0f;
389 
390  return out;
391 }
FT_Pos y
Definition: ftimage.h:77
FT_Pos x
Definition: ftimage.h:76
#define up(mutex)
Definition: glue.h:30
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
GLdouble GLdouble right
Definition: glext.h:10859
FT_Vector * vec
Definition: ftbbox.c:448
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
Definition: math.c:1849

◆ D3DXMatrixMultiply()

D3DXMATRIX* WINAPI D3DXMatrixMultiply ( D3DXMATRIX pout,
const D3DXMATRIX pm1,
const D3DXMATRIX pm2 
)

Definition at line 393 of file math.c.

394 {
395  D3DXMATRIX out;
396  int i,j;
397 
398  TRACE("pout %p, pm1 %p, pm2 %p\n", pout, pm1, pm2);
399 
400  for (i=0; i<4; i++)
401  {
402  for (j=0; j<4; j++)
403  {
404  out.u.m[i][j] = pm1->u.m[i][0] * pm2->u.m[0][j] + pm1->u.m[i][1] * pm2->u.m[1][j] + pm1->u.m[i][2] * pm2->u.m[2][j] + pm1->u.m[i][3] * pm2->u.m[3][j];
405  }
406  }
407 
408  *pout = out;
409  return pout;
410 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
float m[4][4]
Definition: d3d8types.h:1116
static LPMONITOR2 pm2
Definition: localmon.c:46

Referenced by d3dx9_skin_info_UpdateSkinnedMesh(), D3DXMatrixTransformation(), D3DXVec3Project(), D3DXVec3Unproject(), ID3DXMatrixStackImpl_MultMatrix(), ID3DXMatrixStackImpl_MultMatrixLocal(), ID3DXMatrixStackImpl_RotateAxis(), ID3DXMatrixStackImpl_RotateAxisLocal(), ID3DXMatrixStackImpl_RotateYawPitchRoll(), ID3DXMatrixStackImpl_RotateYawPitchRollLocal(), ID3DXMatrixStackImpl_Scale(), ID3DXMatrixStackImpl_ScaleLocal(), ID3DXMatrixStackImpl_Translate(), ID3DXMatrixStackImpl_TranslateLocal(), and parse_frame().

◆ D3DXMatrixMultiplyTranspose()

D3DXMATRIX* WINAPI D3DXMatrixMultiplyTranspose ( D3DXMATRIX pout,
const D3DXMATRIX pm1,
const D3DXMATRIX pm2 
)

Definition at line 412 of file math.c.

413 {
415  int i, j;
416 
417  TRACE("pout %p, pm1 %p, pm2 %p\n", pout, pm1, pm2);
418 
419  for (i = 0; i < 4; i++)
420  for (j = 0; j < 4; j++)
421  temp.u.m[j][i] = pm1->u.m[i][0] * pm2->u.m[0][j] + pm1->u.m[i][1] * pm2->u.m[1][j] + pm1->u.m[i][2] * pm2->u.m[2][j] + pm1->u.m[i][3] * pm2->u.m[3][j];
422 
423  *pout = temp;
424  return pout;
425 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
static calc_node_t temp
Definition: rpn_ieee.c:38
float m[4][4]
Definition: d3d8types.h:1116
static LPMONITOR2 pm2
Definition: localmon.c:46

◆ D3DXMatrixOrthoLH()

D3DXMATRIX* WINAPI D3DXMatrixOrthoLH ( D3DXMATRIX pout,
FLOAT  w,
FLOAT  h,
FLOAT  zn,
FLOAT  zf 
)

Definition at line 427 of file math.c.

428 {
429  TRACE("pout %p, w %f, h %f, zn %f, zf %f\n", pout, w, h, zn, zf);
430 
431  D3DXMatrixIdentity(pout);
432  pout->u.m[0][0] = 2.0f / w;
433  pout->u.m[1][1] = 2.0f / h;
434  pout->u.m[2][2] = 1.0f / (zf - zn);
435  pout->u.m[3][2] = zn / (zn - zf);
436  return pout;
437 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

Referenced by draw_quad_with_shader9().

◆ D3DXMatrixOrthoOffCenterLH()

D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterLH ( D3DXMATRIX pout,
FLOAT  l,
FLOAT  r,
FLOAT  b,
FLOAT  t,
FLOAT  zn,
FLOAT  zf 
)

Definition at line 439 of file math.c.

440 {
441  TRACE("pout %p, l %f, r %f, b %f, t %f, zn %f, zf %f\n", pout, l, r, b, t, zn, zf);
442 
443  D3DXMatrixIdentity(pout);
444  pout->u.m[0][0] = 2.0f / (r - l);
445  pout->u.m[1][1] = 2.0f / (t - b);
446  pout->u.m[2][2] = 1.0f / (zf -zn);
447  pout->u.m[3][0] = -1.0f -2.0f *l / (r - l);
448  pout->u.m[3][1] = 1.0f + 2.0f * t / (b - t);
449  pout->u.m[3][2] = zn / (zn -zf);
450  return pout;
451 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
#define b
Definition: ke_i.h:79
r l[0]
Definition: byte_order.h:167
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

Referenced by d3dx9_line_Begin(), and set_states().

◆ D3DXMatrixOrthoOffCenterRH()

D3DXMATRIX* WINAPI D3DXMatrixOrthoOffCenterRH ( D3DXMATRIX pout,
FLOAT  l,
FLOAT  r,
FLOAT  b,
FLOAT  t,
FLOAT  zn,
FLOAT  zf 
)

Definition at line 453 of file math.c.

454 {
455  TRACE("pout %p, l %f, r %f, b %f, t %f, zn %f, zf %f\n", pout, l, r, b, t, zn, zf);
456 
457  D3DXMatrixIdentity(pout);
458  pout->u.m[0][0] = 2.0f / (r - l);
459  pout->u.m[1][1] = 2.0f / (t - b);
460  pout->u.m[2][2] = 1.0f / (zn -zf);
461  pout->u.m[3][0] = -1.0f -2.0f *l / (r - l);
462  pout->u.m[3][1] = 1.0f + 2.0f * t / (b - t);
463  pout->u.m[3][2] = zn / (zn -zf);
464  return pout;
465 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
#define b
Definition: ke_i.h:79
r l[0]
Definition: byte_order.h:167
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

◆ D3DXMatrixOrthoRH()

D3DXMATRIX* WINAPI D3DXMatrixOrthoRH ( D3DXMATRIX pout,
FLOAT  w,
FLOAT  h,
FLOAT  zn,
FLOAT  zf 
)

Definition at line 467 of file math.c.

468 {
469  TRACE("pout %p, w %f, h %f, zn %f, zf %f\n", pout, w, h, zn, zf);
470 
471  D3DXMatrixIdentity(pout);
472  pout->u.m[0][0] = 2.0f / w;
473  pout->u.m[1][1] = 2.0f / h;
474  pout->u.m[2][2] = 1.0f / (zn - zf);
475  pout->u.m[3][2] = zn / (zn - zf);
476  return pout;
477 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

◆ D3DXMatrixPerspectiveFovLH()

D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovLH ( D3DXMATRIX pout,
FLOAT  fovy,
FLOAT  aspect,
FLOAT  zn,
FLOAT  zf 
)

Definition at line 479 of file math.c.

480 {
481  TRACE("pout %p, fovy %f, aspect %f, zn %f, zf %f\n", pout, fovy, aspect, zn, zf);
482 
483  D3DXMatrixIdentity(pout);
484  pout->u.m[0][0] = 1.0f / (aspect * tanf(fovy/2.0f));
485  pout->u.m[1][1] = 1.0f / tanf(fovy/2.0f);
486  pout->u.m[2][2] = zf / (zf - zn);
487  pout->u.m[2][3] = 1.0f;
488  pout->u.m[3][2] = (zf * zn) / (zn - zf);
489  pout->u.m[3][3] = 0.0f;
490  return pout;
491 }
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
_Check_return_ __CRT_INLINE float tanf(_In_ float x)
Definition: math.h:220
float m[4][4]
Definition: d3d8types.h:1116

◆ D3DXMatrixPerspectiveFovRH()

D3DXMATRIX* WINAPI D3DXMatrixPerspectiveFovRH ( D3DXMATRIX pout,
FLOAT  fovy,
FLOAT  aspect,
FLOAT  zn,
FLOAT  zf 
)

Definition at line 493 of file math.c.

494 {
495  TRACE("pout %p, fovy %f, aspect %f, zn %f, zf %f\n", pout, fovy, aspect, zn, zf);
496 
497  D3DXMatrixIdentity(pout);
498  pout->u.m[0][0] = 1.0f / (aspect * tanf(fovy/2.0f));
499  pout->u.m[1][1] = 1.0f / tanf(fovy/2.0f);
500  pout->u.m[2][2] = zf / (zn - zf);
501  pout->u.m[2][3] = -1.0f;
502  pout->u.m[3][2] = (zf * zn) / (zn - zf);
503  pout->u.m[3][3] = 0.0f;
504  return pout;
505 }
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
_Check_return_ __CRT_INLINE float tanf(_In_ float x)
Definition: math.h:220
float m[4][4]
Definition: d3d8types.h:1116

◆ D3DXMatrixPerspectiveLH()

D3DXMATRIX* WINAPI D3DXMatrixPerspectiveLH ( D3DXMATRIX pout,
FLOAT  w,
FLOAT  h,
FLOAT  zn,
FLOAT  zf 
)

Definition at line 507 of file math.c.

508 {
509  TRACE("pout %p, w %f, h %f, zn %f, zf %f\n", pout, w, h, zn, zf);
510 
511  D3DXMatrixIdentity(pout);
512  pout->u.m[0][0] = 2.0f * zn / w;
513  pout->u.m[1][1] = 2.0f * zn / h;
514  pout->u.m[2][2] = zf / (zf - zn);
515  pout->u.m[3][2] = (zn * zf) / (zn - zf);
516  pout->u.m[2][3] = 1.0f;
517  pout->u.m[3][3] = 0.0f;
518  return pout;
519 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

◆ D3DXMatrixPerspectiveOffCenterLH()

D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterLH ( D3DXMATRIX pout,
FLOAT  l,
FLOAT  r,
FLOAT  b,
FLOAT  t,
FLOAT  zn,
FLOAT  zf 
)

Definition at line 521 of file math.c.

522 {
523  TRACE("pout %p, l %f, r %f, b %f, t %f, zn %f, zf %f\n", pout, l, r, b, t, zn, zf);
524 
525  D3DXMatrixIdentity(pout);
526  pout->u.m[0][0] = 2.0f * zn / (r - l);
527  pout->u.m[1][1] = -2.0f * zn / (b - t);
528  pout->u.m[2][0] = -1.0f - 2.0f * l / (r - l);
529  pout->u.m[2][1] = 1.0f + 2.0f * t / (b - t);
530  pout->u.m[2][2] = - zf / (zn - zf);
531  pout->u.m[3][2] = (zn * zf) / (zn -zf);
532  pout->u.m[2][3] = 1.0f;
533  pout->u.m[3][3] = 0.0f;
534  return pout;
535 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
r l[0]
Definition: byte_order.h:167
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

◆ D3DXMatrixPerspectiveOffCenterRH()

D3DXMATRIX* WINAPI D3DXMatrixPerspectiveOffCenterRH ( D3DXMATRIX pout,
FLOAT  l,
FLOAT  r,
FLOAT  b,
FLOAT  t,
FLOAT  zn,
FLOAT  zf 
)

Definition at line 537 of file math.c.

538 {
539  TRACE("pout %p, l %f, r %f, b %f, t %f, zn %f, zf %f\n", pout, l, r, b, t, zn, zf);
540 
541  D3DXMatrixIdentity(pout);
542  pout->u.m[0][0] = 2.0f * zn / (r - l);
543  pout->u.m[1][1] = -2.0f * zn / (b - t);
544  pout->u.m[2][0] = 1.0f + 2.0f * l / (r - l);
545  pout->u.m[2][1] = -1.0f -2.0f * t / (b - t);
546  pout->u.m[2][2] = zf / (zn - zf);
547  pout->u.m[3][2] = (zn * zf) / (zn -zf);
548  pout->u.m[2][3] = -1.0f;
549  pout->u.m[3][3] = 0.0f;
550  return pout;
551 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble GLdouble t
Definition: gl.h:2047
r l[0]
Definition: byte_order.h:167
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

◆ D3DXMatrixPerspectiveRH()

D3DXMATRIX* WINAPI D3DXMatrixPerspectiveRH ( D3DXMATRIX pout,
FLOAT  w,
FLOAT  h,
FLOAT  zn,
FLOAT  zf 
)

Definition at line 553 of file math.c.

554 {
555  TRACE("pout %p, w %f, h %f, zn %f, zf %f\n", pout, w, h, zn, zf);
556 
557  D3DXMatrixIdentity(pout);
558  pout->u.m[0][0] = 2.0f * zn / w;
559  pout->u.m[1][1] = 2.0f * zn / h;
560  pout->u.m[2][2] = zf / (zn - zf);
561  pout->u.m[3][2] = (zn * zf) / (zn - zf);
562  pout->u.m[2][3] = -1.0f;
563  pout->u.m[3][3] = 0.0f;
564  return pout;
565 }
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

◆ D3DXMatrixReflect()

D3DXMATRIX* WINAPI D3DXMatrixReflect ( D3DXMATRIX pout,
const D3DXPLANE pplane 
)

Definition at line 567 of file math.c.

568 {
569  D3DXPLANE Nplane;
570 
571  TRACE("pout %p, pplane %p\n", pout, pplane);
572 
573  D3DXPlaneNormalize(&Nplane, pplane);
574  D3DXMatrixIdentity(pout);
575  pout->u.m[0][0] = 1.0f - 2.0f * Nplane.a * Nplane.a;
576  pout->u.m[0][1] = -2.0f * Nplane.a * Nplane.b;
577  pout->u.m[0][2] = -2.0f * Nplane.a * Nplane.c;
578  pout->u.m[1][0] = -2.0f * Nplane.a * Nplane.b;
579  pout->u.m[1][1] = 1.0f - 2.0f * Nplane.b * Nplane.b;
580  pout->u.m[1][2] = -2.0f * Nplane.b * Nplane.c;
581  pout->u.m[2][0] = -2.0f * Nplane.c * Nplane.a;
582  pout->u.m[2][1] = -2.0f * Nplane.c * Nplane.b;
583  pout->u.m[2][2] = 1.0f - 2.0f * Nplane.c * Nplane.c;
584  pout->u.m[3][0] = -2.0f * Nplane.d * Nplane.a;
585  pout->u.m[3][1] = -2.0f * Nplane.d * Nplane.b;
586  pout->u.m[3][2] = -2.0f * Nplane.d * Nplane.c;
587  return pout;
588 }
FLOAT d
Definition: d3dx9math.h:221
#define TRACE(s)
Definition: solgame.cpp:4
FLOAT c
Definition: d3dx9math.h:221
FLOAT b
Definition: d3dx9math.h:221
float m[4][4]
Definition: d3d8types.h:1116
D3DXPLANE *WINAPI D3DXPlaneNormalize(D3DXPLANE *out, const D3DXPLANE *p)
Definition: math.c:1297
FLOAT a
Definition: d3dx9math.h:221

◆ D3DXMatrixRotationAxis()

D3DXMATRIX* WINAPI D3DXMatrixRotationAxis ( D3DXMATRIX pout,
const D3DXVECTOR3 pv,
FLOAT  angle 
)

Definition at line 590 of file math.c.

591 {
592  D3DXVECTOR3 nv;
593  FLOAT sangle, cangle, cdiff;
594 
595  TRACE("out %p, v %p, angle %f\n", out, v, angle);
596 
597  D3DXVec3Normalize(&nv, v);
598  sangle = sinf(angle);
599  cangle = cosf(angle);
600  cdiff = 1.0f - cangle;
601 
602  out->u.m[0][0] = cdiff * nv.x * nv.x + cangle;
603  out->u.m[1][0] = cdiff * nv.x * nv.y - sangle * nv.z;
604  out->u.m[2][0] = cdiff * nv.x * nv.z + sangle * nv.y;
605  out->u.m[3][0] = 0.0f;
606  out->u.m[0][1] = cdiff * nv.y * nv.x + sangle * nv.z;
607  out->u.m[1][1] = cdiff * nv.y * nv.y + cangle;
608  out->u.m[2][1] = cdiff * nv.y * nv.z - sangle * nv.x;
609  out->u.m[3][1] = 0.0f;
610  out->u.m[0][2] = cdiff * nv.z * nv.x - sangle * nv.y;
611  out->u.m[1][2] = cdiff * nv.z * nv.y + sangle * nv.x;
612  out->u.m[2][2] = cdiff * nv.z * nv.z + cangle;
613  out->u.m[3][2] = 0.0f;
614  out->u.m[0][3] = 0.0f;
615  out->u.m[1][3] = 0.0f;
616  out->u.m[2][3] = 0.0f;
617  out->u.m[3][3] = 1.0f;
618 
619  return out;
620 }
GLfloat angle
Definition: glext.h:10853
#define cosf
Definition: cosf.c:6
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
const GLdouble * v
Definition: gl.h:2040
float FLOAT
Definition: typedefs.h:67
#define sinf
Definition: sinf.c:6
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
Definition: math.c:1849

Referenced by ID3DXMatrixStackImpl_RotateAxis(), and ID3DXMatrixStackImpl_RotateAxisLocal().

◆ D3DXMatrixRotationQuaternion()

D3DXMATRIX* WINAPI D3DXMatrixRotationQuaternion ( D3DXMATRIX pout,
const D3DXQUATERNION pq 
)

Definition at line 622 of file math.c.

623 {
624  TRACE("pout %p, pq %p\n", pout, pq);
625 
626  D3DXMatrixIdentity(pout);
627  pout->u.m[0][0] = 1.0f - 2.0f * (pq->y * pq->y + pq->z * pq->z);
628  pout->u.m[0][1] = 2.0f * (pq->x *pq->y + pq->z * pq->w);
629  pout->u.m[0][2] = 2.0f * (pq->x * pq->z - pq->y * pq->w);
630  pout->u.m[1][0] = 2.0f * (pq->x * pq->y - pq->z * pq->w);
631  pout->u.m[1][1] = 1.0f - 2.0f * (pq->x * pq->x + pq->z * pq->z);
632  pout->u.m[1][2] = 2.0f * (pq->y *pq->z + pq->x *pq->w);
633  pout->u.m[2][0] = 2.0f * (pq->x * pq->z + pq->y * pq->w);
634  pout->u.m[2][1] = 2.0f * (pq->y *pq->z - pq->x *pq->w);
635  pout->u.m[2][2] = 1.0f - 2.0f * (pq->x * pq->x + pq->y * pq->y);
636  return pout;
637 }
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

Referenced by D3DXMatrixTransformation().

◆ D3DXMatrixRotationX()

D3DXMATRIX* WINAPI D3DXMatrixRotationX ( D3DXMATRIX pout,
FLOAT  angle 
)

Definition at line 639 of file math.c.

640 {
641  TRACE("pout %p, angle %f\n", pout, angle);
642 
643  D3DXMatrixIdentity(pout);
644  pout->u.m[1][1] = cosf(angle);
645  pout->u.m[2][2] = cosf(angle);
646  pout->u.m[1][2] = sinf(angle);
647  pout->u.m[2][1] = -sinf(angle);
648  return pout;
649 }
GLfloat angle
Definition: glext.h:10853
#define cosf
Definition: cosf.c:6
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116
#define sinf
Definition: sinf.c:6

◆ D3DXMatrixRotationY()

D3DXMATRIX* WINAPI D3DXMatrixRotationY ( D3DXMATRIX pout,
FLOAT  angle 
)

Definition at line 651 of file math.c.

652 {
653  TRACE("pout %p, angle %f\n", pout, angle);
654 
655  D3DXMatrixIdentity(pout);
656  pout->u.m[0][0] = cosf(angle);
657  pout->u.m[2][2] = cosf(angle);
658  pout->u.m[0][2] = -sinf(angle);
659  pout->u.m[2][0] = sinf(angle);
660  return pout;
661 }
GLfloat angle
Definition: glext.h:10853
#define cosf
Definition: cosf.c:6
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116
#define sinf
Definition: sinf.c:6

◆ D3DXMatrixRotationYawPitchRoll()

D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll ( D3DXMATRIX pout,
FLOAT  yaw,
FLOAT  pitch,
FLOAT  roll 
)

Definition at line 663 of file math.c.

664 {
665  FLOAT sroll, croll, spitch, cpitch, syaw, cyaw;
666 
667  TRACE("out %p, yaw %f, pitch %f, roll %f\n", out, yaw, pitch, roll);
668 
669  sroll = sinf(roll);
670  croll = cosf(roll);
671  spitch = sinf(pitch);
672  cpitch = cosf(pitch);
673  syaw = sinf(yaw);
674  cyaw = cosf(yaw);
675 
676  out->u.m[0][0] = sroll * spitch * syaw + croll * cyaw;
677  out->u.m[0][1] = sroll * cpitch;
678  out->u.m[0][2] = sroll * spitch * cyaw - croll * syaw;
679  out->u.m[0][3] = 0.0f;
680  out->u.m[1][0] = croll * spitch * syaw - sroll * cyaw;
681  out->u.m[1][1] = croll * cpitch;
682  out->u.m[1][2] = croll * spitch * cyaw + sroll * syaw;
683  out->u.m[1][3] = 0.0f;
684  out->u.m[2][0] = cpitch * syaw;
685  out->u.m[2][1] = -spitch;
686  out->u.m[2][2] = cpitch * cyaw;
687  out->u.m[2][3] = 0.0f;
688  out->u.m[3][0] = 0.0f;
689  out->u.m[3][1] = 0.0f;
690  out->u.m[3][2] = 0.0f;
691  out->u.m[3][3] = 1.0f;
692 
693  return out;
694 }
#define cosf
Definition: cosf.c:6
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
float FLOAT
Definition: typedefs.h:67
#define sinf
Definition: sinf.c:6

Referenced by ID3DXMatrixStackImpl_RotateYawPitchRoll(), and ID3DXMatrixStackImpl_RotateYawPitchRollLocal().

◆ D3DXMatrixRotationZ()

D3DXMATRIX* WINAPI D3DXMatrixRotationZ ( D3DXMATRIX pout,
FLOAT  angle 
)

Definition at line 696 of file math.c.

697 {
698  TRACE("pout %p, angle %f\n", pout, angle);
699 
700  D3DXMatrixIdentity(pout);
701  pout->u.m[0][0] = cosf(angle);
702  pout->u.m[1][1] = cosf(angle);
703  pout->u.m[0][1] = sinf(angle);
704  pout->u.m[1][0] = -sinf(angle);
705  return pout;
706 }
GLfloat angle
Definition: glext.h:10853
#define cosf
Definition: cosf.c:6
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116
#define sinf
Definition: sinf.c:6

◆ D3DXMatrixScaling()

D3DXMATRIX* WINAPI D3DXMatrixScaling ( D3DXMATRIX pout,
FLOAT  sx,
FLOAT  sy,
FLOAT  sz 
)

Definition at line 708 of file math.c.

709 {
710  TRACE("pout %p, sx %f, sy %f, sz %f\n", pout, sx, sy, sz);
711 
712  D3DXMatrixIdentity(pout);
713  pout->u.m[0][0] = sx;
714  pout->u.m[1][1] = sy;
715  pout->u.m[2][2] = sz;
716  return pout;
717 }
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

Referenced by D3DXMatrixTransformation(), ID3DXMatrixStackImpl_Scale(), and ID3DXMatrixStackImpl_ScaleLocal().

◆ D3DXMatrixShadow()

D3DXMATRIX* WINAPI D3DXMatrixShadow ( D3DXMATRIX pout,
const D3DXVECTOR4 plight,
const D3DXPLANE pPlane 
)

Definition at line 719 of file math.c.

720 {
721  D3DXPLANE Nplane;
722  FLOAT dot;
723 
724  TRACE("pout %p, plight %p, pplane %p\n", pout, plight, pplane);
725 
726  D3DXPlaneNormalize(&Nplane, pplane);
727  dot = D3DXPlaneDot(&Nplane, plight);
728  pout->u.m[0][0] = dot - Nplane.a * plight->x;
729  pout->u.m[0][1] = -Nplane.a * plight->y;
730  pout->u.m[0][2] = -Nplane.a * plight->z;
731  pout->u.m[0][3] = -Nplane.a * plight->w;
732  pout->u.m[1][0] = -Nplane.b * plight->x;
733  pout->u.m[1][1] = dot - Nplane.b * plight->y;
734  pout->u.m[1][2] = -Nplane.b * plight->z;
735  pout->u.m[1][3] = -Nplane.b * plight->w;
736  pout->u.m[2][0] = -Nplane.c * plight->x;
737  pout->u.m[2][1] = -Nplane.c * plight->y;
738  pout->u.m[2][2] = dot - Nplane.c * plight->z;
739  pout->u.m[2][3] = -Nplane.c * plight->w;
740  pout->u.m[3][0] = -Nplane.d * plight->x;
741  pout->u.m[3][1] = -Nplane.d * plight->y;
742  pout->u.m[3][2] = -Nplane.d * plight->z;
743  pout->u.m[3][3] = dot - Nplane.d * plight->w;
744  return pout;
745 }
FLOAT d
Definition: d3dx9math.h:221
#define TRACE(s)
Definition: solgame.cpp:4
FLOAT c
Definition: d3dx9math.h:221
FLOAT b
Definition: d3dx9math.h:221
float m[4][4]
Definition: d3d8types.h:1116
float FLOAT
Definition: typedefs.h:67
D3DXPLANE *WINAPI D3DXPlaneNormalize(D3DXPLANE *out, const D3DXPLANE *p)
Definition: math.c:1297
FLOAT a
Definition: d3dx9math.h:221

◆ D3DXMatrixTransformation()

D3DXMATRIX* WINAPI D3DXMatrixTransformation ( D3DXMATRIX pout,
const D3DXVECTOR3 pscalingcenter,
const D3DXQUATERNION pscalingrotation,
const D3DXVECTOR3 pscaling,
const D3DXVECTOR3 protationcenter,
const D3DXQUATERNION protation,
const D3DXVECTOR3 ptranslation 
)

Definition at line 747 of file math.c.

748 {
749  D3DXMATRIX m1, m2, m3, m4, m5, m6, m7;
751  D3DXVECTOR3 psc, pt;
752 
753  TRACE("pout %p, pscalingcenter %p, pscalingrotation %p, pscaling %p, protationcentr %p, protation %p, ptranslation %p\n",
754  pout, pscalingcenter, pscalingrotation, pscaling, protationcenter, protation, ptranslation);
755 
756  if ( !pscalingcenter )
757  {
758  psc.x = 0.0f;
759  psc.y = 0.0f;
760  psc.z = 0.0f;
761  }
762  else
763  {
764  psc.x = pscalingcenter->x;
765  psc.y = pscalingcenter->y;
766  psc.z = pscalingcenter->z;
767  }
768 
769  if ( !protationcenter )
770  {
771  prc.x = 0.0f;
772  prc.y = 0.0f;
773  prc.z = 0.0f;
774  }
775  else
776  {
777  prc.x = protationcenter->x;
778  prc.y = protationcenter->y;
779  prc.z = protationcenter->z;
780  }
781 
782  if ( !ptranslation )
783  {
784  pt.x = 0.0f;
785  pt.y = 0.0f;
786  pt.z = 0.0f;
787  }
788  else
789  {
790  pt.x = ptranslation->x;
791  pt.y = ptranslation->y;
792  pt.z = ptranslation->z;
793  }
794 
795  D3DXMatrixTranslation(&m1, -psc.x, -psc.y, -psc.z);
796 
797  if ( !pscalingrotation || !pscaling )
798  {
799  D3DXMatrixIdentity(&m2);
800  D3DXMatrixIdentity(&m4);
801  }
802  else
803  {
805 
806  D3DXMatrixRotationQuaternion(&m4, pscalingrotation);
807  temp.w = pscalingrotation->w;
808  temp.x = -pscalingrotation->x;
809  temp.y = -pscalingrotation->y;
810  temp.z = -pscalingrotation->z;
812  }
813 
814  if ( !pscaling )
815  D3DXMatrixIdentity(&m3);
816  else
817  D3DXMatrixScaling(&m3, pscaling->x, pscaling->y, pscaling->z);
818 
819  if ( !protation )
820  D3DXMatrixIdentity(&m6);
821  else
822  D3DXMatrixRotationQuaternion(&m6, protation);
823 
824  D3DXMatrixTranslation(&m5, psc.x - prc.x, psc.y - prc.y, psc.z - prc.z);
825  D3DXMatrixTranslation(&m7, prc.x + pt.x, prc.y + pt.y, prc.z + pt.z);
826  D3DXMatrixMultiply(&m1, &m1, &m2);
827  D3DXMatrixMultiply(&m1, &m1, &m3);
828  D3DXMatrixMultiply(&m1, &m1, &m4);
829  D3DXMatrixMultiply(&m1, &m1, &m5);
830  D3DXMatrixMultiply(&m1, &m1, &m6);
831  D3DXMatrixMultiply(pout, &m1, &m7);
832  return pout;
833 }
D3DXMATRIX *WINAPI D3DXMatrixTranslation(D3DXMATRIX *pout, FLOAT x, FLOAT y, FLOAT z)
Definition: math.c:910
#define pt(x, y)
Definition: drawing.c:79
D3DXMATRIX *WINAPI D3DXMatrixMultiply(D3DXMATRIX *pout, const D3DXMATRIX *pm1, const D3DXMATRIX *pm2)
Definition: math.c:393
#define TRACE(s)
Definition: solgame.cpp:4
D3DXMATRIX *WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT sz)
Definition: math.c:708
static SCRIPT_CACHE * psc
Definition: usp10.c:64
static calc_node_t temp
Definition: rpn_ieee.c:38
D3DXMATRIX *WINAPI D3DXMatrixRotationQuaternion(D3DXMATRIX *pout, const D3DXQUATERNION *pq)
Definition: math.c:622
_Out_ LPRECT prc
Definition: ntgdi.h:1658

Referenced by D3DXMatrixTransformation2D().

◆ D3DXMatrixTransformation2D()

D3DXMATRIX* WINAPI D3DXMatrixTransformation2D ( D3DXMATRIX pout,
const D3DXVECTOR2 pscalingcenter,
FLOAT  scalingrotation,
const D3DXVECTOR2 pscaling,
const D3DXVECTOR2 protationcenter,
FLOAT  rotation,
const D3DXVECTOR2 ptranslation 
)

Definition at line 835 of file math.c.

836 {
837  D3DXQUATERNION rot, sca_rot;
838  D3DXVECTOR3 rot_center, sca, sca_center, trans;
839 
840  TRACE("pout %p, pscalingcenter %p, scalingrotation %f, pscaling %p, protztioncenter %p, rotation %f, ptranslation %p\n",
841  pout, pscalingcenter, scalingrotation, pscaling, protationcenter, rotation, ptranslation);
842 
843  if ( pscalingcenter )
844  {
845  sca_center.x=pscalingcenter->x;
846  sca_center.y=pscalingcenter->y;
847  sca_center.z=0.0f;
848  }
849  else
850  {
851  sca_center.x=0.0f;
852  sca_center.y=0.0f;
853  sca_center.z=0.0f;
854  }
855 
856  if ( pscaling )
857  {
858  sca.x=pscaling->x;
859  sca.y=pscaling->y;
860  sca.z=1.0f;
861  }
862  else
863  {
864  sca.x=1.0f;
865  sca.y=1.0f;
866  sca.z=1.0f;
867  }
868 
869  if ( protationcenter )
870  {
871  rot_center.x=protationcenter->x;
872  rot_center.y=protationcenter->y;
873  rot_center.z=0.0f;
874  }
875  else
876  {
877  rot_center.x=0.0f;
878  rot_center.y=0.0f;
879  rot_center.z=0.0f;
880  }
881 
882  if ( ptranslation )
883  {
884  trans.x=ptranslation->x;
885  trans.y=ptranslation->y;
886  trans.z=0.0f;
887  }
888  else
889  {
890  trans.x=0.0f;
891  trans.y=0.0f;
892  trans.z=0.0f;
893  }
894 
895  rot.w=cosf(rotation/2.0f);
896  rot.x=0.0f;
897  rot.y=0.0f;
898  rot.z=sinf(rotation/2.0f);
899 
900  sca_rot.w=cosf(scalingrotation/2.0f);
901  sca_rot.x=0.0f;
902  sca_rot.y=0.0f;
903  sca_rot.z=sinf(scalingrotation/2.0f);
904 
905  D3DXMatrixTransformation(pout, &sca_center, &sca_rot, &sca, &rot_center, &rot, &trans);
906 
907  return pout;
908 }
FLOAT y
Definition: d3dx9math.h:64
D3DXMATRIX *WINAPI D3DXMatrixTransformation(D3DXMATRIX *pout, const D3DXVECTOR3 *pscalingcenter, const D3DXQUATERNION *pscalingrotation, const D3DXVECTOR3 *pscaling, const D3DXVECTOR3 *protationcenter, const D3DXQUATERNION *protation, const D3DXVECTOR3 *ptranslation)
Definition: math.c:747
#define cosf
Definition: cosf.c:6
GLfloat rot
Definition: 3dtext.c:36
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
FLOAT x
Definition: d3dx9math.h:64
#define sinf
Definition: sinf.c:6

◆ D3DXMatrixTranslation()

D3DXMATRIX* WINAPI D3DXMatrixTranslation ( D3DXMATRIX pout,
FLOAT  x,
FLOAT  y,
FLOAT  z 
)

Definition at line 910 of file math.c.

911 {
912  TRACE("pout %p, x %f, y %f, z %f\n", pout, x, y, z);
913 
914  D3DXMatrixIdentity(pout);
915  pout->u.m[3][0] = x;
916  pout->u.m[3][1] = y;
917  pout->u.m[3][2] = z;
918  return pout;
919 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLdouble GLdouble z
Definition: glext.h:5874
#define TRACE(s)
Definition: solgame.cpp:4
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
float m[4][4]
Definition: d3d8types.h:1116

Referenced by D3DXMatrixTransformation(), ID3DXMatrixStackImpl_Translate(), and ID3DXMatrixStackImpl_TranslateLocal().

◆ D3DXMatrixTranspose()

D3DXMATRIX* WINAPI D3DXMatrixTranspose ( D3DXMATRIX pout,
const D3DXMATRIX pm 
)

Definition at line 921 of file math.c.

922 {
923  const D3DXMATRIX m = *pm;
924  int i,j;
925 
926  TRACE("pout %p, pm %p\n", pout, pm);
927 
928  for (i=0; i<4; i++)
929  for (j=0; j<4; j++) pout->u.m[i][j] = m.u.m[j][i];
930 
931  return pout;
932 }
static LPMONITOREX pm
Definition: localmon.c:45
const GLfloat * m
Definition: glext.h:10848
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
float m[4][4]
Definition: d3d8types.h:1116

Referenced by set().

◆ D3DXPlaneFromPointNormal()

D3DXPLANE* WINAPI D3DXPlaneFromPointNormal ( D3DXPLANE pout,
const D3DXVECTOR3 pvpoint,
const D3DXVECTOR3 pvnormal 
)

Definition at line 1248 of file math.c.

1249 {
1250  TRACE("pout %p, pvpoint %p, pvnormal %p\n", pout, pvpoint, pvnormal);
1251 
1252  pout->a = pvnormal->x;
1253  pout->b = pvnormal->y;
1254  pout->c = pvnormal->z;
1255  pout->d = -D3DXVec3Dot(pvpoint, pvnormal);
1256  return pout;
1257 }
FLOAT d
Definition: d3dx9math.h:221
#define TRACE(s)
Definition: solgame.cpp:4
FLOAT c
Definition: d3dx9math.h:221
FLOAT b
Definition: d3dx9math.h:221
FLOAT a
Definition: d3dx9math.h:221

Referenced by D3DXPlaneFromPoints().

◆ D3DXPlaneFromPoints()

D3DXPLANE* WINAPI D3DXPlaneFromPoints ( D3DXPLANE pout,
const D3DXVECTOR3 pv1,
const D3DXVECTOR3 pv2,
const D3DXVECTOR3 pv3 
)

Definition at line 1259 of file math.c.

1260 {
1261  D3DXVECTOR3 edge1, edge2, normal, Nnormal;
1262 
1263  TRACE("pout %p, pv1 %p, pv2 %p, pv3 %p\n", pout, pv1, pv2, pv3);
1264 
1265  edge1.x = 0.0f; edge1.y = 0.0f; edge1.z = 0.0f;
1266  edge2.x = 0.0f; edge2.y = 0.0f; edge2.z = 0.0f;
1267  D3DXVec3Subtract(&edge1, pv2, pv1);
1268  D3DXVec3Subtract(&edge2, pv3, pv1);
1269  D3DXVec3Cross(&normal, &edge1, &edge2);
1270  D3DXVec3Normalize(&Nnormal, &normal);
1271  D3DXPlaneFromPointNormal(pout, pv1, &Nnormal);
1272  return pout;
1273 }
D3DXPLANE *WINAPI D3DXPlaneFromPointNormal(D3DXPLANE *pout, const D3DXVECTOR3 *pvpoint, const D3DXVECTOR3 *pvnormal)
Definition: math.c:1248
#define TRACE(s)
Definition: solgame.cpp:4
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
Definition: math.c:1849

◆ D3DXPlaneIntersectLine()

D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine ( D3DXVECTOR3 pout,
const D3DXPLANE pp,
const D3DXVECTOR3 pv1,
const D3DXVECTOR3 pv2 
)

Definition at line 1275 of file math.c.

1276 {
1277  D3DXVECTOR3 direction, normal;
1278  FLOAT dot, temp;
1279 
1280  TRACE("pout %p, pp %p, pv1 %p, pv2 %p\n", pout, pp, pv1, pv2);
1281 
1282  normal.x = pp->a;
1283  normal.y = pp->b;
1284  normal.z = pp->c;
1285  direction.x = pv2->x - pv1->x;
1286  direction.y = pv2->y - pv1->y;
1287  direction.z = pv2->z - pv1->z;
1288  dot = D3DXVec3Dot(&normal, &direction);
1289  if ( !dot ) return NULL;
1290  temp = ( pp->d + D3DXVec3Dot(&normal, pv1) ) / dot;
1291  pout->x = pv1->x - temp * direction.x;
1292  pout->y = pv1->y - temp * direction.y;
1293  pout->z = pv1->z - temp * direction.z;
1294  return pout;
1295 }
#define pp
Definition: hlsl.yy.c:1208
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static calc_node_t temp
Definition: rpn_ieee.c:38
float FLOAT
Definition: typedefs.h:67

◆ D3DXPlaneNormalize()

D3DXPLANE* WINAPI D3DXPlaneNormalize ( D3DXPLANE pout,
const D3DXPLANE pp 
)

Definition at line 1297 of file math.c.

1298 {
1299  FLOAT norm;
1300 
1301  TRACE("out %p, p %p\n", out, p);
1302 
1303  norm = sqrtf(p->a * p->a + p->b * p->b + p->c * p->c);
1304  if (norm)
1305  {
1306  out->a = p->a / norm;
1307  out->b = p->b / norm;
1308  out->c = p->c / norm;
1309  out->d = p->d / norm;
1310  }
1311  else
1312  {
1313  out->a = 0.0f;
1314  out->b = 0.0f;
1315  out->c = 0.0f;
1316  out->d = 0.0f;
1317  }
1318 
1319  return out;
1320 }
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
Definition: _complex.h:741
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
#define sqrtf(x)
Definition: mymath.h:59
float FLOAT
Definition: typedefs.h:67
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by D3DXMatrixReflect(), and D3DXMatrixShadow().

◆ D3DXPlaneTransform()

D3DXPLANE* WINAPI D3DXPlaneTransform ( D3DXPLANE pout,
const D3DXPLANE pplane,
const D3DXMATRIX pm 
)

Definition at line 1322 of file math.c.

1323 {
1324  const D3DXPLANE plane = *pplane;
1325 
1326  TRACE("pout %p, pplane %p, pm %p\n", pout, pplane, pm);
1327 
1328  pout->a = pm->u.m[0][0] * plane.a + pm->u.m[1][0] * plane.b + pm->u.m[2][0] * plane.c + pm->u.m[3][0] * plane.d;
1329  pout->b = pm->u.m[0][1] * plane.a + pm->u.m[1][1] * plane.b + pm->u.m[2][1] * plane.c + pm->u.m[3][1] * plane.d;
1330  pout->c = pm->u.m[0][2] * plane.a + pm->u.m[1][2] * plane.b + pm->u.m[2][2] * plane.c + pm->u.m[3][2] * plane.d;
1331  pout->d = pm->u.m[0][3] * plane.a + pm->u.m[1][3] * plane.b + pm->u.m[2][3] * plane.c + pm->u.m[3][3] * plane.d;
1332  return pout;
1333 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum plane
Definition: glfuncs.h:270
static LPMONITOREX pm
Definition: localmon.c:45
FLOAT d
Definition: d3dx9math.h:221
#define TRACE(s)
Definition: solgame.cpp:4
FLOAT c
Definition: d3dx9math.h:221
FLOAT b
Definition: d3dx9math.h:221
FLOAT a
Definition: d3dx9math.h:221

Referenced by D3DXPlaneTransformArray().

◆ D3DXPlaneTransformArray()

D3DXPLANE* WINAPI D3DXPlaneTransformArray ( D3DXPLANE pout,
UINT  outstride,
const D3DXPLANE pplane,
UINT  pstride,
const D3DXMATRIX pm,
UINT  n 
)

Definition at line 1335 of file math.c.

1336 {
1337  UINT i;
1338 
1339  TRACE("out %p, outstride %u, in %p, instride %u, matrix %p, elements %u\n", out, outstride, in, instride, matrix, elements);
1340 
1341  for (i = 0; i < elements; ++i) {
1343  (D3DXPLANE*)((char*)out + outstride * i),
1344  (const D3DXPLANE*)((const char*)in + instride * i),
1345  matrix);
1346  }
1347  return out;
1348 }
GLuint GLenum matrix
Definition: glext.h:9407
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
D3DXPLANE *WINAPI D3DXPlaneTransform(D3DXPLANE *pout, const D3DXPLANE *pplane, const D3DXMATRIX *pm)
Definition: math.c:1322
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
GLuint in
Definition: glext.h:9616
unsigned int UINT
Definition: ndis.h:50

◆ D3DXQuaternionBaryCentric()

D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric ( D3DXQUATERNION pout,
const D3DXQUATERNION pq1,
const D3DXQUATERNION pq2,
const D3DXQUATERNION pq3,
FLOAT  f,
FLOAT  g 
)

Definition at line 1352 of file math.c.

1353 {
1354  D3DXQUATERNION temp1, temp2;
1355 
1356  TRACE("pout %p, pq1 %p, pq2 %p, pq3 %p, f %f, g %f\n", pout, pq1, pq2, pq3, f, g);
1357 
1358  D3DXQuaternionSlerp(pout, D3DXQuaternionSlerp(&temp1, pq1, pq2, f + g), D3DXQuaternionSlerp(&temp2, pq1, pq3, f+g), g / (f + g));
1359  return pout;
1360 }
GLboolean GLboolean g
Definition: glext.h:6204
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
D3DXQUATERNION *WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *out, const D3DXQUATERNION *q1, const D3DXQUATERNION *q2, FLOAT t)
Definition: math.c:1544

◆ D3DXQuaternionExp()

D3DXQUATERNION* WINAPI D3DXQuaternionExp ( D3DXQUATERNION pout,
const D3DXQUATERNION pq 
)

Definition at line 1362 of file math.c.

1363 {
1364  FLOAT norm;
1365 
1366  TRACE("out %p, q %p\n", out, q);
1367 
1368  norm = sqrtf(q->x * q->x + q->y * q->y + q->z * q->z);
1369  if (norm)
1370  {
1371  out->x = sinf(norm) * q->x / norm;
1372  out->y = sinf(norm) * q->y / norm;
1373  out->z = sinf(norm) * q->z / norm;
1374  out->w = cosf(norm);
1375  }
1376  else
1377  {
1378  out->x = 0.0f;
1379  out->y = 0.0f;
1380  out->z = 0.0f;
1381  out->w = 1.0f;
1382  }
1383 
1384  return out;
1385 }
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
Definition: _complex.h:741
#define cosf
Definition: cosf.c:6
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
#define sqrtf(x)
Definition: mymath.h:59
float FLOAT
Definition: typedefs.h:67
#define sinf
Definition: sinf.c:6

Referenced by D3DXQuaternionSquadSetup().

◆ D3DXQuaternionInverse()

D3DXQUATERNION* WINAPI D3DXQuaternionInverse ( D3DXQUATERNION pout,
const D3DXQUATERNION pq 
)

Definition at line 1387 of file math.c.

1388 {
1389  FLOAT norm;
1390 
1391  TRACE("pout %p, pq %p\n", pout, pq);
1392 
1393  norm = D3DXQuaternionLengthSq(pq);
1394 
1395  pout->x = -pq->x / norm;
1396  pout->y = -pq->y / norm;
1397  pout->z = -pq->z / norm;
1398  pout->w = pq->w / norm;
1399  return pout;
1400 }
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
Definition: _complex.h:741
#define TRACE(s)
Definition: solgame.cpp:4
float FLOAT
Definition: typedefs.h:67

Referenced by D3DXQuaternionSquadSetup().

◆ D3DXQuaternionLn()

D3DXQUATERNION* WINAPI D3DXQuaternionLn ( D3DXQUATERNION pout,
const D3DXQUATERNION pq 
)

Definition at line 1402 of file math.c.

1403 {
1404  FLOAT t;
1405 
1406  TRACE("out %p, q %p\n", out, q);
1407 
1408  if ((q->w >= 1.0f) || (q->w == -1.0f))
1409  t = 1.0f;
1410  else
1411  t = acosf(q->w) / sqrtf(1.0f - q->w * q->w);
1412 
1413  out->x = t * q->x;
1414  out->y = t * q->y;
1415  out->z = t * q->z;
1416  out->w = 0.0f;
1417 
1418  return out;
1419 }
_Check_return_ __CRT_INLINE float acosf(_In_ float x)
Definition: math.h:203
GLdouble GLdouble t
Definition: gl.h:2047
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
#define sqrtf(x)
Definition: mymath.h:59
float FLOAT
Definition: typedefs.h:67

Referenced by D3DXQuaternionSquadSetup().

◆ D3DXQuaternionMultiply()

D3DXQUATERNION* WINAPI D3DXQuaternionMultiply ( D3DXQUATERNION pout,
const D3DXQUATERNION pq1,
const D3DXQUATERNION pq2 
)

Definition at line 1421 of file math.c.

1422 {
1424 
1425  TRACE("pout %p, pq1 %p, pq2 %p\n", pout, pq1, pq2);
1426 
1427  out.x = pq2->w * pq1->x + pq2->x * pq1->w + pq2->y * pq1->z - pq2->z * pq1->y;
1428  out.y = pq2->w * pq1->y - pq2->x * pq1->z + pq2->y * pq1->w + pq2->z * pq1->x;
1429  out.z = pq2->w * pq1->z + pq2->x * pq1->y - pq2->y * pq1->x + pq2->z * pq1->w;
1430  out.w = pq2->w * pq1->w - pq2->x * pq1->x - pq2->y * pq1->y - pq2->z * pq1->z;
1431  *pout = out;
1432  return pout;
1433 }
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44

Referenced by D3DXQuaternionSquadSetup().

◆ D3DXQuaternionNormalize()

D3DXQUATERNION* WINAPI D3DXQuaternionNormalize ( D3DXQUATERNION pout,
const D3DXQUATERNION pq 
)

Definition at line 1435 of file math.c.

1436 {
1437  FLOAT norm;
1438 
1439  TRACE("out %p, q %p\n", out, q);
1440 
1441  norm = D3DXQuaternionLength(q);
1442 
1443  out->x = q->x / norm;
1444  out->y = q->y / norm;
1445  out->z = q->z / norm;
1446  out->w = q->w / norm;
1447 
1448  return out;
1449 }
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
Definition: _complex.h:741
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
float FLOAT
Definition: typedefs.h:67

◆ D3DXQuaternionRotationAxis()

D3DXQUATERNION* WINAPI D3DXQuaternionRotationAxis ( D3DXQUATERNION pout,
const D3DXVECTOR3 pv,
FLOAT  angle 
)

Definition at line 1451 of file math.c.

1452 {
1453  D3DXVECTOR3 temp;
1454 
1455  TRACE("out %p, v %p, angle %f\n", out, v, angle);
1456 
1458 
1459  out->x = sinf(angle / 2.0f) * temp.x;
1460  out->y = sinf(angle / 2.0f) * temp.y;
1461  out->z = sinf(angle / 2.0f) * temp.z;
1462  out->w = cosf(angle / 2.0f);
1463 
1464  return out;
1465 }
GLfloat angle
Definition: glext.h:10853
#define cosf
Definition: cosf.c:6
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
const GLdouble * v
Definition: gl.h:2040
static calc_node_t temp
Definition: rpn_ieee.c:38
#define sinf
Definition: sinf.c:6
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
Definition: math.c:1849

◆ D3DXQuaternionRotationMatrix()

D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix ( D3DXQUATERNION pout,
const D3DXMATRIX pm 
)

Definition at line 1467 of file math.c.

1468 {
1469  FLOAT s, trace;
1470 
1471  TRACE("out %p, m %p\n", out, m);
1472 
1473  trace = m->u.m[0][0] + m->u.m[1][1] + m->u.m[2][2] + 1.0f;
1474  if (trace > 1.0f)
1475  {
1476  s = 2.0f * sqrtf(trace);
1477  out->x = (m->u.m[1][2] - m->u.m[2][1]) / s;
1478  out->y = (m->u.m[2][0] - m->u.m[0][2]) / s;
1479  out->z = (m->u.m[0][1] - m->u.m[1][0]) / s;
1480  out->w = 0.25f * s;
1481  }
1482  else
1483  {
1484  int i, maxi = 0;
1485 
1486  for (i = 1; i < 3; i++)
1487  {
1488  if (m->u.m[i][i] > m->u.m[maxi][maxi])
1489  maxi = i;
1490  }
1491 
1492  switch (maxi)
1493  {
1494  case 0:
1495  s = 2.0f * sqrtf(1.0f + m->u.m[0][0] - m->u.m[1][1] - m->u.m[2][2]);
1496  out->x = 0.25f * s;
1497  out->y = (m->u.m[0][1] + m->u.m[1][0]) / s;
1498  out->z = (m->u.m[0][2] + m->u.m[2][0]) / s;
1499  out->w = (m->u.m[1][2] - m->u.m[2][1]) / s;
1500  break;
1501 
1502  case 1:
1503  s = 2.0f * sqrtf(1.0f + m->u.m[1][1] - m->u.m[0][0] - m->u.m[2][2]);
1504  out->x = (m->u.m[0][1] + m->u.m[1][0]) / s;
1505  out->y = 0.25f * s;
1506  out->z = (m->u.m[1][2] + m->u.m[2][1]) / s;
1507  out->w = (m->u.m[2][0] - m->u.m[0][2]) / s;
1508  break;
1509 
1510  case 2:
1511  s = 2.0f * sqrtf(1.0f + m->u.m[2][2] - m->u.m[0][0] - m->u.m[1][1]);
1512  out->x = (m->u.m[0][2] + m->u.m[2][0]) / s;
1513  out->y = (m->u.m[1][2] + m->u.m[2][1]) / s;
1514  out->z = 0.25f * s;
1515  out->w = (m->u.m[0][1] - m->u.m[1][0]) / s;
1516  break;
1517  }
1518  }
1519 
1520  return out;
1521 }
const GLfloat * m
Definition: glext.h:10848
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
#define trace
Definition: atltest.h:70
static FILE * out
Definition: regtests2xml.c:44
GLdouble s
Definition: gl.h:2039
#define sqrtf(x)
Definition: mymath.h:59
float FLOAT
Definition: typedefs.h:67

Referenced by D3DXMatrixDecompose().

◆ D3DXQuaternionRotationYawPitchRoll()

D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll ( D3DXQUATERNION pout,
FLOAT  yaw,
FLOAT  pitch,
FLOAT  roll 
)

Definition at line 1523 of file math.c.

1524 {
1525  FLOAT syaw, cyaw, spitch, cpitch, sroll, croll;
1526 
1527  TRACE("out %p, yaw %f, pitch %f, roll %f\n", out, yaw, pitch, roll);
1528 
1529  syaw = sinf(yaw / 2.0f);
1530  cyaw = cosf(yaw / 2.0f);
1531  spitch = sinf(pitch / 2.0f);
1532  cpitch = cosf(pitch / 2.0f);
1533  sroll = sinf(roll / 2.0f);
1534  croll = cosf(roll / 2.0f);
1535 
1536  out->x = syaw * cpitch * sroll + cyaw * spitch * croll;
1537  out->y = syaw * cpitch * croll - cyaw * spitch * sroll;
1538  out->z = cyaw * cpitch * sroll - syaw * spitch * croll;
1539  out->w = cyaw * cpitch * croll + syaw * spitch * sroll;
1540 
1541  return out;
1542 }
#define cosf
Definition: cosf.c:6
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
float FLOAT
Definition: typedefs.h:67
#define sinf
Definition: sinf.c:6

◆ D3DXQuaternionSlerp()

D3DXQUATERNION* WINAPI D3DXQuaternionSlerp ( D3DXQUATERNION pout,
const D3DXQUATERNION pq1,
const D3DXQUATERNION pq2,
FLOAT  t 
)

Definition at line 1544 of file math.c.

1546 {
1547  FLOAT dot, temp;
1548 
1549  TRACE("out %p, q1 %p, q2 %p, t %f\n", out, q1, q2, t);
1550 
1551  temp = 1.0f - t;
1552  dot = D3DXQuaternionDot(q1, q2);
1553  if (dot < 0.0f)
1554  {
1555  t = -t;
1556  dot = -dot;
1557  }
1558 
1559  if (1.0f - dot > 0.001f)
1560  {
1561  FLOAT theta = acosf(dot);
1562 
1563  temp = sinf(theta * temp) / sinf(theta);
1564  t = sinf(theta * t) / sinf(theta);
1565  }
1566 
1567  out->x = temp * q1->x + t * q2->x;
1568  out->y = temp * q1->y + t * q2->y;
1569  out->z = temp * q1->z + t * q2->z;
1570  out->w = temp * q1->w + t * q2->w;
1571 
1572  return out;
1573 }
_Check_return_ __CRT_INLINE float acosf(_In_ float x)
Definition: math.h:203
GLdouble GLdouble t
Definition: gl.h:2047
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
static calc_node_t temp
Definition: rpn_ieee.c:38
float FLOAT
Definition: typedefs.h:67
#define sinf
Definition: sinf.c:6

Referenced by D3DXQuaternionBaryCentric(), and D3DXQuaternionSquad().

◆ D3DXQuaternionSquad()

D3DXQUATERNION* WINAPI D3DXQuaternionSquad ( D3DXQUATERNION pout,
const D3DXQUATERNION pq1,
const D3DXQUATERNION pq2,
const D3DXQUATERNION pq3,
const D3DXQUATERNION pq4,
FLOAT  t 
)

Definition at line 1575 of file math.c.

1576 {
1577  D3DXQUATERNION temp1, temp2;
1578 
1579  TRACE("pout %p, pq1 %p, pq2 %p, pq3 %p, pq4 %p, t %f\n", pout, pq1, pq2, pq3, pq4, t);
1580 
1581  D3DXQuaternionSlerp(pout, D3DXQuaternionSlerp(&temp1, pq1, pq4, t), D3DXQuaternionSlerp(&temp2, pq2, pq3, t), 2.0f * t * (1.0f - t));
1582  return pout;
1583 }
GLdouble GLdouble t
Definition: gl.h:2047
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
D3DXQUATERNION *WINAPI D3DXQuaternionSlerp(D3DXQUATERNION *out, const D3DXQUATERNION *q1, const D3DXQUATERNION *q2, FLOAT t)
Definition: math.c:1544

◆ D3DXQuaternionSquadSetup()

void WINAPI D3DXQuaternionSquadSetup ( D3DXQUATERNION paout,
D3DXQUATERNION pbout,
D3DXQUATERNION pcout,
const D3DXQUATERNION pq0,
const D3DXQUATERNION pq1,
const D3DXQUATERNION pq2,
const D3DXQUATERNION pq3 
)

Definition at line 1597 of file math.c.

1598 {
1599  D3DXQUATERNION q, temp1, temp2, temp3, zero;
1600  D3DXQUATERNION aout, cout;
1601 
1602  TRACE("paout %p, pbout %p, pcout %p, pq0 %p, pq1 %p, pq2 %p, pq3 %p\n", paout, pbout, pcout, pq0, pq1, pq2, pq3);
1603 
1604  zero.x = 0.0f;
1605  zero.y = 0.0f;
1606  zero.z = 0.0f;
1607  zero.w = 0.0f;
1608 
1609  if (D3DXQuaternionDot(pq0, pq1) < 0.0f)
1610  temp2 = add_diff(&zero, pq0, -1.0f);
1611  else
1612  temp2 = *pq0;
1613 
1614  if (D3DXQuaternionDot(pq1, pq2) < 0.0f)
1615  cout = add_diff(&zero, pq2, -1.0f);
1616  else
1617  cout = *pq2;
1618 
1619  if (D3DXQuaternionDot(&cout, pq3) < 0.0f)
1620  temp3 = add_diff(&zero, pq3, -1.0f);
1621  else
1622  temp3 = *pq3;
1623 
1624  D3DXQuaternionInverse(&temp1, pq1);
1625  D3DXQuaternionMultiply(&temp2, &temp1, &temp2);
1626  D3DXQuaternionLn(&temp2, &temp2);
1627  D3DXQuaternionMultiply(&q, &temp1, &cout);
1628  D3DXQuaternionLn(&q, &q);
1629  temp1 = add_diff(&temp2, &q, 1.0f);
1630  temp1.x *= -0.25f;
1631  temp1.y *= -0.25f;
1632  temp1.z *= -0.25f;
1633  temp1.w *= -0.25f;
1634  D3DXQuaternionExp(&temp1, &temp1);
1635  D3DXQuaternionMultiply(&aout, pq1, &temp1);
1636 
1637  D3DXQuaternionInverse(&temp1, &cout);
1638  D3DXQuaternionMultiply(&temp2, &temp1, pq1);
1639  D3DXQuaternionLn(&temp2, &temp2);
1640  D3DXQuaternionMultiply(&q, &temp1, &temp3);
1641  D3DXQuaternionLn(&q, &q);
1642  temp1 = add_diff(&temp2, &q, 1.0f);
1643  temp1.x *= -0.25f;
1644  temp1.y *= -0.25f;
1645  temp1.z *= -0.25f;
1646  temp1.w *= -0.25f;
1647  D3DXQuaternionExp(&temp1, &temp1);
1648  D3DXQuaternionMultiply(pbout, &cout, &temp1);
1649  *paout = aout;
1650  *pcout = cout;
1651 }
static D3DXQUATERNION add_diff(const D3DXQUATERNION *q1, const D3DXQUATERNION *q2, const FLOAT add)
Definition: math.c:1585
#define cout
Definition: iostream.cpp:38
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
D3DXQUATERNION *WINAPI D3DXQuaternionInverse(D3DXQUATERNION *pout, const D3DXQUATERNION *pq)
Definition: math.c:1387
D3DXQUATERNION *WINAPI D3DXQuaternionLn(D3DXQUATERNION *out, const D3DXQUATERNION *q)
Definition: math.c:1402
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
static double zero
Definition: j0_y0.c:96
D3DXQUATERNION *WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, const D3DXQUATERNION *pq1, const D3DXQUATERNION *pq2)
Definition: math.c:1421
D3DXQUATERNION *WINAPI D3DXQuaternionExp(D3DXQUATERNION *out, const D3DXQUATERNION *q)
Definition: math.c:1362

◆ D3DXQuaternionToAxisAngle()

void WINAPI D3DXQuaternionToAxisAngle ( const D3DXQUATERNION pq,
D3DXVECTOR3 paxis,
FLOAT pangle 
)

Definition at line 1653 of file math.c.

1654 {
1655  TRACE("pq %p, paxis %p, pangle %p\n", pq, paxis, pangle);
1656 
1657  if (paxis)
1658  {
1659  paxis->x = pq->x;
1660  paxis->y = pq->y;
1661  paxis->z = pq->z;
1662  }
1663  if (pangle)
1664  *pangle = 2.0f * acosf(pq->w);
1665 }
_Check_return_ __CRT_INLINE float acosf(_In_ float x)
Definition: math.h:203
#define TRACE(s)
Definition: solgame.cpp:4

◆ D3DXSHAdd()

FLOAT* WINAPI D3DXSHAdd ( FLOAT out,
UINT  order,
const FLOAT a,
const FLOAT b 
)

Definition at line 2281 of file math.c.

2282 {
2283  UINT i;
2284 
2285  TRACE("out %p, order %u, a %p, b %p\n", out, order, a, b);
2286 
2287  for (i = 0; i < order * order; i++)
2288  out[i] = a[i] + b[i];
2289 
2290  return out;
2291 }
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
unsigned int UINT
Definition: ndis.h:50
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ D3DXSHDot()

FLOAT WINAPI D3DXSHDot ( UINT  order,
const FLOAT a,
const FLOAT b 
)

Definition at line 2293 of file math.c.

2294 {
2295  FLOAT s;
2296  UINT i;
2297 
2298  TRACE("order %u, a %p, b %p\n", order, a, b);
2299 
2300  s = a[0] * b[0];
2301  for (i = 1; i < order * order; i++)
2302  s += a[i] * b[i];
2303 
2304  return s;
2305 }
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
GLdouble s
Definition: gl.h:2039
unsigned int UINT
Definition: ndis.h:50
float FLOAT
Definition: typedefs.h:67
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

Referenced by D3DXSHMultiply2().

◆ D3DXSHEvalConeLight()

HRESULT WINAPI D3DXSHEvalConeLight ( UINT  order,
const D3DXVECTOR3 dir,
FLOAT  radius,
FLOAT  Rintensity,
FLOAT  Gintensity,
FLOAT  Bintensity,
FLOAT rout,
FLOAT gout,
FLOAT bout 
)

Definition at line 2336 of file math.c.

2338 {
2339  FLOAT cap[6], clamped_angle, norm, scale, temp;
2340  UINT i, index, j;
2341 
2342  TRACE("order %u, dir %p, radius %f, red %f, green %f, blue %f, rout %p, gout %p, bout %p\n",
2343  order, dir, radius, Rintensity, Gintensity, Bintensity, rout, gout, bout);
2344 
2345  if (radius <= 0.0f)
2346  return D3DXSHEvalDirectionalLight(order, dir, Rintensity, Gintensity, Bintensity, rout, gout, bout);
2347 
2348  clamped_angle = (radius > D3DX_PI / 2.0f) ? (D3DX_PI / 2.0f) : radius;
2349  norm = sinf(clamped_angle) * sinf(clamped_angle);
2350 
2351  if (order > D3DXSH_MAXORDER)
2352  {
2353  WARN("Order clamped at D3DXSH_MAXORDER\n");
2355  }
2356 
2357  weightedcapintegrale(cap, order, radius);
2358  D3DXSHEvalDirection(rout, order, dir);
2359 
2360  for (i = 0; i < order; i++)
2361  {
2362  scale = cap[i] / norm;
2363 
2364  for (j = 0; j < 2 * i + 1; j++)
2365  {
2366  index = i * i + j;
2367  temp = rout[index] * scale;
2368 
2369  rout[index] = temp * Rintensity;
2370  if (gout)
2371  gout[index] = temp * Gintensity;
2372  if (bout)
2373  bout[index] = temp * Bintensity;
2374  }
2375  }
2376 
2377  return D3D_OK;
2378 }
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
Definition: _complex.h:741
HRESULT WINAPI D3DXSHEvalDirectionalLight(UINT order, const D3DXVECTOR3 *dir, FLOAT Rintensity, FLOAT Gintensity, FLOAT Bintensity, FLOAT *Rout, FLOAT *Gout, FLOAT *Bout)
Definition: math.c:2450
GLenum GLenum GLenum GLenum GLenum scale
Definition: glext.h:9032
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DXSH_MAXORDER
Definition: d3dx9math.h:31
FLOAT *WINAPI D3DXSHEvalDirection(FLOAT *out, UINT order, const D3DXVECTOR3 *dir)
Definition: math.c:2380
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLenum cap
Definition: glext.h:9639
GLuint index
Definition: glext.h:6031
unsigned int dir
Definition: maze.c:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
#define index(s, c)
Definition: various.h:29
static void weightedcapintegrale(FLOAT *out, UINT order, FLOAT angle)
Definition: math.c:2307
#define D3D_OK
Definition: d3d.h:106
static calc_node_t temp
Definition: rpn_ieee.c:38
unsigned int UINT
Definition: ndis.h:50
float FLOAT
Definition: typedefs.h:67
#define D3DX_PI
Definition: d3dx9math.h:27
#define sinf
Definition: sinf.c:6

◆ D3DXSHEvalDirection()

FLOAT* WINAPI D3DXSHEvalDirection ( FLOAT out,
UINT  order,
const D3DXVECTOR3 dir 
)

Definition at line 2380 of file math.c.

2381 {
2382  const FLOAT dirxx = dir->x * dir->x;
2383  const FLOAT dirxy = dir->x * dir->y;
2384  const FLOAT dirxz = dir->x * dir->z;
2385  const FLOAT diryy = dir->y * dir->y;
2386  const FLOAT diryz = dir->y * dir->z;
2387  const FLOAT dirzz = dir->z * dir->z;
2388  const FLOAT dirxxxx = dirxx * dirxx;
2389  const FLOAT diryyyy = diryy * diryy;
2390  const FLOAT dirzzzz = dirzz * dirzz;
2391  const FLOAT dirxyxy = dirxy * dirxy;
2392 
2393  TRACE("out %p, order %u, dir %p\n", out, order, dir);
2394 
2395  if ((order < D3DXSH_MINORDER) || (order > D3DXSH_MAXORDER))
2396  return out;
2397 
2398  out[0] = 0.5f / sqrtf(D3DX_PI);
2399  out[1] = -0.5f / sqrtf(D3DX_PI / 3.0f) * dir->y;
2400  out[2] = 0.5f / sqrtf(D3DX_PI / 3.0f) * dir->z;
2401  out[3] = -0.5f / sqrtf(D3DX_PI / 3.0f) * dir->x;
2402  if (order == 2)
2403  return out;
2404 
2405  out[4] = 0.5f / sqrtf(D3DX_PI / 15.0f) * dirxy;
2406  out[5] = -0.5f / sqrtf(D3DX_PI / 15.0f) * diryz;
2407  out[6] = 0.25f / sqrtf(D3DX_PI / 5.0f) * (3.0f * dirzz - 1.0f);
2408  out[7] = -0.5f / sqrtf(D3DX_PI / 15.0f) * dirxz;
2409  out[8] = 0.25f / sqrtf(D3DX_PI / 15.0f) * (dirxx - diryy);
2410  if (order == 3)
2411  return out;
2412 
2413  out[9] = -sqrtf(70.0f / D3DX_PI) / 8.0f * dir->y * (3.0f * dirxx - diryy);
2414  out[10] = sqrtf(105.0f / D3DX_PI) / 2.0f * dirxy * dir->z;
2415  out[11] = -sqrtf(42.0f / D3DX_PI) / 8.0f * dir->y * (-1.0f + 5.0f * dirzz);
2416  out[12] = sqrtf(7.0f / D3DX_PI) / 4.0f * dir->z * (5.0f * dirzz - 3.0f);
2417  out[13] = sqrtf(42.0f / D3DX_PI) / 8.0f * dir->x * (1.0f - 5.0f * dirzz);
2418  out[14] = sqrtf(105.0f / D3DX_PI) / 4.0f * dir->z * (dirxx - diryy);
2419  out[15] = -sqrtf(70.0f / D3DX_PI) / 8.0f * dir->x * (dirxx - 3.0f * diryy);
2420  if (order == 4)
2421  return out;
2422 
2423  out[16] = 0.75f * sqrtf(35.0f / D3DX_PI) * dirxy * (dirxx - diryy);
2424  out[17] = 3.0f * dir->z * out[9];
2425  out[18] = 0.75f * sqrtf(5.0f / D3DX_PI) * dirxy * (7.0f * dirzz - 1.0f);
2426  out[19] = 0.375f * sqrtf(10.0f / D3DX_PI) * diryz * (3.0f - 7.0f * dirzz);
2427  out[20] = 3.0f / (16.0f * sqrtf(D3DX_PI)) * (35.0f * dirzzzz - 30.f * dirzz + 3.0f);
2428  out[21] = 0.375f * sqrtf(10.0f / D3DX_PI) * dirxz * (3.0f - 7.0f * dirzz);
2429  out[22] = 0.375f * sqrtf(5.0f / D3DX_PI) * (dirxx - diryy) * (7.0f * dirzz - 1.0f);
2430  out[23] = 3.0f * dir->z * out[15];
2431  out[24] = 3.0f / 16.0f * sqrtf(35.0f / D3DX_PI) * (dirxxxx - 6.0f * dirxyxy + diryyyy);
2432  if (order == 5)
2433  return out;
2434 
2435  out[25] = -3.0f/ 32.0f * sqrtf(154.0f / D3DX_PI) * dir->y * (5.0f * dirxxxx - 10.0f * dirxyxy + diryyyy);
2436  out[26] = 0.75f * sqrtf(385.0f / D3DX_PI) * dirxy * dir->z * (dirxx - diryy);
2437  out[27] = sqrtf(770.0f / D3DX_PI) / 32.0f * dir->y * (3.0f * dirxx - diryy) * (1.0f - 9.0f * dirzz);
2438  out[28] = sqrtf(1155.0f / D3DX_PI) / 4.0f * dirxy * dir->z * (3.0f * dirzz - 1.0f);
2439  out[29] = sqrtf(165.0f / D3DX_PI) / 16.0f * dir->y * (14.0f * dirzz - 21.0f * dirzzzz - 1.0f);
2440  out[30] = sqrtf(11.0f / D3DX_PI) / 16.0f * dir->z * (63.0f * dirzzzz - 70.0f * dirzz + 15.0f);
2441  out[31] = sqrtf(165.0f / D3DX_PI) / 16.0f * dir->x * (14.0f * dirzz - 21.0f * dirzzzz - 1.0f);
2442  out[32] = sqrtf(1155.0f / D3DX_PI) / 8.0f * dir->z * (dirxx - diryy) * (3.0f * dirzz - 1.0f);
2443  out[33] = sqrtf(770.0f / D3DX_PI) / 32.0f * dir->x * (dirxx - 3.0f * diryy) * (1.0f - 9.0f * dirzz);
2444  out[34] = 3.0f / 16.0f * sqrtf(385.0f / D3DX_PI) * dir->z * (dirxxxx - 6.0f * dirxyxy + diryyyy);
2445  out[35] = -3.0f/ 32.0f * sqrtf(154.0f / D3DX_PI) * dir->x * (dirxxxx - 10.0f * dirxyxy + 5.0f * diryyyy);
2446 
2447  return out;
2448 }
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
#define D3DXSH_MAXORDER
Definition: d3dx9math.h:31
#define D3DXSH_MINORDER
Definition: d3dx9math.h:30
unsigned int dir
Definition: maze.c:112
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
#define sqrtf(x)
Definition: mymath.h:59
float FLOAT
Definition: typedefs.h:67
#define D3DX_PI
Definition: d3dx9math.h:27

Referenced by D3DXSHEvalConeLight(), D3DXSHEvalDirectionalLight(), D3DXSHEvalHemisphereLight(), and D3DXSHEvalSphericalLight().

◆ D3DXSHEvalDirectionalLight()

HRESULT WINAPI D3DXSHEvalDirectionalLight ( UINT  order,
const D3DXVECTOR3 dir,
FLOAT  Rintensity,
FLOAT  Gintensity,
FLOAT  Bintensity,
FLOAT rout,
FLOAT gout,
FLOAT bout 
)

Definition at line 2450 of file math.c.

2451 {
2452  FLOAT s, temp;
2453  UINT j;
2454 
2455  TRACE("Order %u, Vector %p, Red %f, Green %f, Blue %f, Rout %p, Gout %p, Bout %p\n", order, dir, Rintensity, Gintensity, Bintensity, Rout, Gout, Bout);
2456 
2457  s = 0.75f;
2458  if ( order > 2 )
2459  s += 5.0f / 16.0f;
2460  if ( order > 4 )
2461  s -= 3.0f / 32.0f;
2462  s /= D3DX_PI;
2463 
2464  D3DXSHEvalDirection(Rout, order, dir);
2465  for (j = 0; j < order * order; j++)
2466  {
2467  temp = Rout[j] / s;
2468 
2469  Rout[j] = Rintensity * temp;
2470  if ( Gout )
2471  Gout[j] = Gintensity * temp;
2472  if ( Bout )
2473  Bout[j] = Bintensity * temp;
2474  }
2475 
2476  return D3D_OK;
2477 }
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
FLOAT *WINAPI D3DXSHEvalDirection(FLOAT *out, UINT order, const D3DXVECTOR3 *dir)
Definition: math.c:2380
unsigned int dir
Definition: maze.c:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
#define TRACE(s)
Definition: solgame.cpp:4
GLdouble s
Definition: gl.h:2039
#define D3D_OK
Definition: d3d.h:106
static calc_node_t temp
Definition: rpn_ieee.c:38
unsigned int UINT
Definition: ndis.h:50
float FLOAT
Definition: typedefs.h:67
#define D3DX_PI
Definition: d3dx9math.h:27

Referenced by D3DXSHEvalConeLight().

◆ D3DXSHEvalHemisphereLight()

HRESULT WINAPI D3DXSHEvalHemisphereLight ( UINT  order,
const D3DXVECTOR3 dir,
D3DXCOLOR  top,
D3DXCOLOR  bottom,
FLOAT rout,
FLOAT gout,
FLOAT bout 
)

Definition at line 2479 of file math.c.

2481 {
2482  FLOAT a[2], temp[4];
2483  UINT i, j;
2484 
2485  TRACE("order %u, dir %p, rout %p, gout %p, bout %p\n", order, dir, rout, gout, bout);
2486 
2488 
2489  a[0] = (top.r + bottom.r) * 3.0f * D3DX_PI;
2490  a[1] = (top.r - bottom.r) * D3DX_PI;
2491  for (i = 0; i < order; i++)
2492  for (j = 0; j < 2 * i + 1; j++)
2493  if (i < 2)
2494  rout[i * i + j] = temp[i * i + j] * a[i];
2495  else
2496  rout[i * i + j] = 0.0f;
2497 
2498  if (gout)
2499  {
2500  a[0] = (top.g + bottom.g) * 3.0f * D3DX_PI;
2501  a[1] = (top.g - bottom.g) * D3DX_PI;
2502  for (i = 0; i < order; i++)
2503  for (j = 0; j < 2 * i + 1; j++)
2504  if (i < 2)
2505  gout[i * i + j] = temp[i * i + j] * a[i];
2506  else
2507  gout[i * i + j] = 0.0f;
2508  }
2509 
2510  if (bout)
2511  {
2512  a[0] = (top.b + bottom.b) * 3.0f * D3DX_PI;
2513  a[1] = (top.b - bottom.b) * D3DX_PI;
2514  for (i = 0; i < order; i++)
2515  for (j = 0; j < 2 * i + 1; j++)
2516  if (i < 2)
2517  bout[i * i + j] = temp[i * i + j] * a[i];
2518  else
2519  bout[i * i + j] = 0.0f;
2520  }
2521 
2522  return D3D_OK;
2523 }
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
FLOAT *WINAPI D3DXSHEvalDirection(FLOAT *out, UINT order, const D3DXVECTOR3 *dir)
Definition: math.c:2380
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLint GLint bottom
Definition: glext.h:7726
unsigned int dir
Definition: maze.c:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106
static calc_node_t temp
Definition: rpn_ieee.c:38
unsigned int UINT
Definition: ndis.h:50
float FLOAT
Definition: typedefs.h:67
#define D3DX_PI
Definition: d3dx9math.h:27
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ D3DXSHEvalSphericalLight()

HRESULT WINAPI D3DXSHEvalSphericalLight ( UINT  order,
const D3DXVECTOR3 dir,
FLOAT  radius,
FLOAT  Rintensity,
FLOAT  Gintensity,
FLOAT  Bintensity,
FLOAT rout,
FLOAT gout,
FLOAT bout 
)

Definition at line 2525 of file math.c.

2527 {
2529  FLOAT cap[6], clamped_angle, dist, temp;
2530  UINT i, index, j;
2531 
2532  TRACE("order %u, dir %p, radius %f, red %f, green %f, blue %f, rout %p, gout %p, bout %p\n",
2533  order, dir, radius, Rintensity, Gintensity, Bintensity, rout, gout, bout);
2534 
2535  if (order > D3DXSH_MAXORDER)
2536  {
2537  WARN("Order clamped at D3DXSH_MAXORDER\n");
2539  }
2540 
2541  if (radius < 0.0f)
2542  radius = -radius;
2543 
2544  dist = D3DXVec3Length(dir);
2545  clamped_angle = (dist <= radius) ? D3DX_PI / 2.0f : asinf(radius / dist);
2546 
2547  weightedcapintegrale(cap, order, clamped_angle);
2549  D3DXSHEvalDirection(rout, order, &normal);
2550 
2551  for (i = 0; i < order; i++)
2552  for (j = 0; j < 2 * i + 1; j++)
2553  {
2554  index = i * i + j;
2555  temp = rout[index] * cap[i];
2556 
2557  rout[index] = temp * Rintensity;
2558  if (gout)
2559  gout[index] = temp * Gintensity;
2560  if (bout)
2561  bout[index] = temp * Bintensity;
2562  }
2563 
2564  return D3D_OK;
2565 }
GLuint GLdouble GLdouble GLint GLint order
Definition: glext.h:11194
#define WARN(fmt,...)
Definition: debug.h:111
#define D3DXSH_MAXORDER
Definition: d3dx9math.h:31
FLOAT *WINAPI D3DXSHEvalDirection(FLOAT *out, UINT order, const D3DXVECTOR3 *dir)
Definition: math.c:2380
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLenum cap
Definition: glext.h:9639
GLuint index
Definition: glext.h:6031
unsigned int dir
Definition: maze.c:112
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GLfloat f
Definition: glext.h:7540
#define TRACE(s)
Definition: solgame.cpp:4
#define index(s, c)
Definition: various.h:29
static void weightedcapintegrale(FLOAT *out, UINT order, FLOAT angle)
Definition: math.c:2307
#define D3D_OK
Definition: d3d.h:106
static calc_node_t temp
Definition: rpn_ieee.c:38
unsigned int UINT
Definition: ndis.h:50
float FLOAT
Definition: typedefs.h:67
#define D3DX_PI
Definition: d3dx9math.h:27
_Check_return_ __CRT_INLINE float asinf(_In_ float x)
Definition: math.h:204
D3DXVECTOR3 *WINAPI D3DXVec3Normalize(D3DXVECTOR3 *pout, const D3DXVECTOR3 *pv)
Definition: math.c:1849

◆ D3DXSHMultiply2()

FLOAT* WINAPI D3DXSHMultiply2 ( FLOAT out,
const FLOAT a,
const FLOAT b 
)

Definition at line 2567 of file math.c.

2568 {
2569  FLOAT ta, tb;
2570 
2571  TRACE("out %p, a %p, b %p\n", out, a, b);
2572 
2573  ta = 0.28209479f * a[0];
2574  tb = 0.28209479f * b[0];
2575 
2576  out[0] = 0.28209479f * D3DXSHDot(2, a, b);
2577  out[1] = ta * b[1] + tb * a[1];
2578  out[2] = ta * b[2] + tb * a[2];
2579  out[3] = ta * b[3] + tb * a[3];
2580 
2581  return out;
2582 }
FLOAT WINAPI D3DXSHDot(UINT order, const FLOAT *a, const FLOAT *b)
Definition: math.c:2293
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
static FILE * out
Definition: regtests2xml.c:44
static const WCHAR tb[]
Definition: suminfo.c:286
float FLOAT
Definition: typedefs.h:67
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204

◆ D3DXSHMultiply3()

FLOAT* WINAPI D3DXSHMultiply3 ( FLOAT out,
const FLOAT a,
const FLOAT b 
)

Definition at line 2584 of file math.c.

2585 {
2586  FLOAT t, ta, tb;
2587 
2588  TRACE("out %p, a %p, b %p\n", out, a, b);
2589 
2590  out[0] = 0.28209479f * a[0] * b[0];
2591 
2592  ta = 0.28209479f * a[0] - 0.12615663f * a[6] - 0.21850969f * a[8];
2593  tb = 0.28209479f * b[0] - 0.12615663f * b[6] - 0.21850969f * b[8];
2594  out[1] = ta * b[1] + tb * a[1];
2595  t = a[1] * b[1];
2596  out[0] += 0.28209479f * t;
2597  out[6] = -0.12615663f * t;
2598  out[8] = -0.21850969f * t;
2599 
2600  ta = 0.21850969f * a[5];
2601  tb = 0.21850969f * b[5];
2602  out[1] += ta * b[2] + tb * a[2];
2603  out[2] = ta * b[1] + tb * a[1];
2604  t = a[1] * b[2] +a[2] * b[1];
2605  out[5] = 0.21850969f * t;
2606 
2607  ta = 0.21850969f * a[4];
2608  tb = 0.21850969f * b[4];
2609  out[1] += ta * b[3] + tb * a[3];
2610  out[3] = ta * b[1] + tb * a[1];
2611  t = a[1] * b[3] + a[3] * b[1];
2612  out[4] = 0.21850969f * t;
2613 
2614  ta = 0.28209480f * a[0] + 0.25231326f * a[6];
2615  tb = 0.28209480f * b[0] + 0.25231326f * b[6];
2616  out[2] += ta * b[2] + tb * a[2];
2617  t = a[2] * b[2];
2618  out[0] += 0.28209480f * t;
2619  out[6] += 0.25231326f * t;
2620 
2621  ta = 0.21850969f * a[7];
2622  tb = 0.21850969f * b[7];
2623  out[2] += ta * b[3] + tb * a[3];
2624  out[3] += ta * b[2] + tb * a[2];
2625  t = a[2] * b[3] + a[3] * b[2];
2626  out[7] = 0.21850969f * t;
2627 
2628  ta = 0.28209479f * a[0] - 0.12615663f * a[6] + 0.21850969f * a[8];
2629  tb = 0.28209479f * b[0] - 0.12615663f * b[6] + 0.21850969f * b[8];
2630  out[3] += ta * b[3] + tb * a[3];
2631  t = a[3] * b[3];
2632  out[0] += 0.28209479f * t;
2633  out[6] -= 0.12615663f * t;
2634  out[8] += 0.21850969f * t;
2635 
2636  ta = 0.28209479f * a[0] - 0.18022375f * a[6];
2637  tb = 0.28209479f * b[0] - 0.18022375f * b[6];
2638  out[4] += ta * b[4] + tb * a[4];
2639  t = a[4] * b[4];
2640  o