26#define PI (4.0f*atanf(1.0f))
27#define admit_error 0.000001f
29#define expect_mat( expectedmat, gotmat)\
37 if (fabs(expectedmat[i][j]-gotmat[i][j])>admit_error)\
43 ok(equal, "Expected matrix=\n(%f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n)\n\n" \
44 "Got matrix=\n(%f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f\n %f,%f,%f,%f)\n", \
45 expectedmat[0][0],expectedmat[0][1],expectedmat[0][2],expectedmat[0][3], \
46 expectedmat[1][0],expectedmat[1][1],expectedmat[1][2],expectedmat[1][3], \
47 expectedmat[2][0],expectedmat[2][1],expectedmat[2][2],expectedmat[2][3], \
48 expectedmat[3][0],expectedmat[3][1],expectedmat[3][2],expectedmat[3][3], \
49 gotmat[0][0],gotmat[0][1],gotmat[0][2],gotmat[0][3], \
50 gotmat[1][0],gotmat[1][1],gotmat[1][2],gotmat[1][3], \
51 gotmat[2][0],gotmat[2][1],gotmat[2][2],gotmat[2][3], \
52 gotmat[3][0],gotmat[3][1],gotmat[3][2],gotmat[3][3] ); \
55#define expect_quat(expectedquat,gotquat) \
56 ok( (fabs(U1(expectedquat.v).x-U1(gotquat.v).x)<admit_error) && \
57 (fabs(U2(expectedquat.v).y-U2(gotquat.v).y)<admit_error) && \
58 (fabs(U3(expectedquat.v).z-U3(gotquat.v).z)<admit_error) && \
59 (fabs(expectedquat.s-gotquat.s)<admit_error), \
60 "Expected Quaternion %f %f %f %f , Got Quaternion %f %f %f %f\n", \
61 expectedquat.s,U1(expectedquat.v).x,U2(expectedquat.v).y,U3(expectedquat.v).z, \
62 gotquat.s,U1(gotquat.v).x,U2(gotquat.v).y,U3(gotquat.v).z);
64#define expect_vec(expectedvec,gotvec) \
65 ok( ((fabs(U1(expectedvec).x-U1(gotvec).x)<admit_error)&&(fabs(U2(expectedvec).y-U2(gotvec).y)<admit_error)&&(fabs(U3(expectedvec).z-U3(gotvec).z)<admit_error)), \
66 "Expected Vector= (%f, %f, %f)\n , Got Vector= (%f, %f, %f)\n", \
67 U1(expectedvec).x,U2(expectedvec).y,U3(expectedvec).z, U1(gotvec).x, U2(gotvec).y, U3(gotvec).z);
83 U1(self).x=9.0f;
U2(self).y=18.0f;
U3(self).z=27.0f;
85 U1(
e).x=11.0f;
U2(
e).y=20.0f;
U3(
e).z=28.0f;
90 U1(
e).x=-2.0f;
U2(
e).y=-2.0f;
U3(
e).z=1.0f;
93 U1(self).x=9.0f;
U2(self).y=18.0f;
U3(self).z=27.0f;
95 U1(
e).x=7.0f;
U2(
e).y=16.0f;
U3(
e).z=26.0f;
100 U1(
e).x=-4.0f;
U2(
e).y=4.0f;
U3(
e).z=0.0f;
103 U1(self).x=9.0f;
U2(self).y=18.0f;
U3(self).z=27.0f;
105 U1(
e).x=-36.0f;
U2(
e).y=45.0f;
U3(
e).z=-18.0f;
110 ok((
mod == 16.0f),
"Expected 16.0f, Got %f\n",
mod);
114 ok((
mod == 3.0f),
"Expected 3.0f, Got %f\n",
mod);
118 U1(
e).x=2.0f/3.0f;
U2(
e).y=2.0f/3.0f;
U3(
e).z=1.0f/3.0f;
123 U1(casnul).x=0.0f;
U2(casnul).y=0.0f;
U3(casnul).z=0.0f;
125 U1(
e).x=1.0f;
U2(
e).y=0.0f;
U3(
e).z=0.0f;
129 U1(ray).x=3.0f;
U2(ray).y=-4.0f;
U3(ray).z=5.0f;
131 U1(
e).x=79.0f;
U2(
e).y=-160.0f;
U3(
e).z=487.0f;
136 U1(
w).x=3.0f;
U2(
w).y=4.0f;
U3(
w).z=0.0f;
137 U1(axis).x=0.0f;
U2(axis).y=0.0f;
U3(axis).z=1.0f;
151 U1(
e).x=0.989950;
U2(
e).y=0.141421f;
U3(
e).z=0.0f;
157 U1(
e).x=10.0f;
U2(
e).y=10.0f;
U3(
e).z=0.0f;
160 U1(self).x=9.0f;
U2(self).y=18.0f;
U3(self).z=27.0f;
162 U1(
e).x=18.0f;
U2(
e).y=36.0f;
U3(
e).z=54.0f;
171 exp[0][0]=-49.0f;
exp[0][1]=4.0f;
exp[0][2]=22.0f;
exp[0][3]=0.0f;
172 exp[1][0]=20.0f;
exp[1][1]=-39.0f;
exp[1][2]=20.0f;
exp[1][3]=0.0f;
173 exp[2][0]=10.0f;
exp[2][1]=28.0f;
exp[2][2]=-25.0f;
exp[2][3]=0.0f;
174 exp[3][0]=0.0f;
exp[3][1]=0.0f;
exp[3][2]=0.0f;
exp[3][3]=1.0f;
175 q.s=1.0f;
U1(
q.v).x=2.0f;
U2(
q.v).y=3.0f;
U3(
q.v).z=4.0f;
188 U1(axis).x=1.0f;
U2(axis).y=1.0f;
U3(axis).z=1.0f;
191 q.s=0.5f;
U1(
q.v).x=0.5f;
U2(
q.v).y=0.5f;
U3(
q.v).z=0.5f;
199 q1.
s=1.0f;
U1(q1.
v).x=2.0f;
U2(q1.
v).y=3.0f;
U3(q1.
v).z=50.0f;
200 q2.
s=-4.0f;
U1(q2.
v).x=6.0f;
U2(q2.
v).y=7.0f;
U3(q2.
v).z=8.0f;
202 q.s = -0.55f;
U1(
q.v).x=3.24f;
U2(
q.v).y=4.24f;
U3(
q.v).z=36.98f;
206 q1.
s=1.0f;
U1(q1.
v).x=2.0f;
U2(q1.
v).y=3.0f;
U3(q1.
v).z=50.0f;
207 q2.
s=-94.0f;
U1(q2.
v).x=6.0f;
U2(q2.
v).y=7.0f;
U3(q2.
v).z=-8.0f;
209 q.s=29.83f;
U1(
q.v).x=-0.48f;
U2(
q.v).y=-0.10f;
U3(
q.v).z=36.98f;
214 q1.
s=0.1f;
U1(q1.
v).x=0.2f;
U2(q1.
v).y=0.3f;
U3(q1.
v).z=0.4f;
215 q2.
s=0.5f;
U1(q2.
v).x=0.6f;
U2(q2.
v).y=0.7f;
U3(q2.
v).z=0.8f;
216 q.s = 0.243943f;
U1(
q.v).x = 0.351172f;
U2(
q.v).y = 0.458401f;
U3(
q.v).z = 0.565629f;
237 expected_color=0xffcc4c8c;
239 ok((expected_color==got_color),
"Expected color=%x, Got color=%x\n",expected_color,got_color);
246 expected_color=0x931966b2;
248 ok((expected_color==got_color),
"Expected color=%x, Got color=%x\n",expected_color,got_color);
255 expected_color=0x68006699;
257 ok((expected_color==got_color),
"Expected color=%x, Got color=%x\n",expected_color,got_color);
264 expected_color=0x68ff6699;
266 ok((expected_color==got_color),
"Expected color=%x, Got color=%x\n",expected_color,got_color);
std::map< E_MODULE, HMODULE > mod
_Tp _STLP_CALL norm(const complex< _Tp > &__z)
D3DVALUE D3DRMMATRIX4D[4][4]
D3DCOLOR WINAPI D3DRMCreateColorRGB(D3DVALUE red, D3DVALUE green, D3DVALUE blue)
D3DVECTOR *WINAPI D3DRMVectorScale(D3DVECTOR *d, D3DVECTOR *s, D3DVALUE factor)
void WINAPI D3DRMMatrixFromQuaternion(D3DRMMATRIX4D m, D3DRMQUATERNION *q)
D3DVECTOR *WINAPI D3DRMVectorNormalize(D3DVECTOR *u)
D3DVALUE WINAPI D3DRMVectorModulus(D3DVECTOR *v)
D3DVECTOR *WINAPI D3DRMVectorAdd(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2)
D3DVECTOR *WINAPI D3DRMVectorCrossProduct(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2)
D3DVALUE WINAPI D3DRMColorGetRed(D3DCOLOR color)
D3DVECTOR *WINAPI D3DRMVectorReflect(D3DVECTOR *r, D3DVECTOR *ray, D3DVECTOR *norm)
D3DVECTOR *WINAPI D3DRMVectorSubtract(D3DVECTOR *d, D3DVECTOR *s1, D3DVECTOR *s2)
D3DVALUE WINAPI D3DRMColorGetBlue(D3DCOLOR color)
D3DRMQUATERNION *WINAPI D3DRMQuaternionFromRotation(D3DRMQUATERNION *q, D3DVECTOR *v, D3DVALUE theta)
D3DVALUE WINAPI D3DRMColorGetAlpha(D3DCOLOR color)
D3DRMQUATERNION *WINAPI D3DRMQuaternionSlerp(D3DRMQUATERNION *q, D3DRMQUATERNION *a, D3DRMQUATERNION *b, D3DVALUE alpha)
D3DVALUE WINAPI D3DRMVectorDotProduct(D3DVECTOR *s1, D3DVECTOR *s2)
D3DVALUE WINAPI D3DRMColorGetGreen(D3DCOLOR color)
D3DVECTOR *WINAPI D3DRMVectorRotate(D3DVECTOR *r, D3DVECTOR *v, D3DVECTOR *axis, D3DVALUE theta)
D3DCOLOR WINAPI D3DRMCreateColorRGBA(D3DVALUE red, D3DVALUE green, D3DVALUE blue, D3DVALUE alpha)
GLclampf GLclampf GLclampf alpha
GLdouble GLdouble GLdouble r
GLdouble GLdouble GLdouble GLdouble q
GLubyte GLubyte GLubyte GLubyte w
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 * u
_Check_return_ _CRT_JIT_INTRINSIC double __cdecl fabs(_In_ double x)
#define expect_quat(expectedquat, gotquat)
#define expect_mat(expectedmat, gotmat)
#define expect_vec(expectedvec, gotvec)
static void MatrixTest(void)
static void QuaternionTest(void)
static void ColorTest(void)
static void VectorTest(void)