Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
43add349
Commit
43add349
authored
Aug 15, 2023
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm/tests: Use nameless unions/structs.
parent
43d4956c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
65 deletions
+65
-65
d3drm.c
dlls/d3drm/tests/d3drm.c
+21
-21
vector.c
dlls/d3drm/tests/vector.c
+44
-44
No files found.
dlls/d3drm/tests/d3drm.c
View file @
43add349
...
...
@@ -93,18 +93,18 @@ static void expect_matrix_(unsigned int line, D3DRMMATRIX4D m,
#define expect_vector(v, x, y, z, u) expect_vector_(__LINE__, v, x, y, z, u)
static
void
expect_vector_
(
unsigned
int
line
,
const
D3DVECTOR
*
v
,
float
x
,
float
y
,
float
z
,
unsigned
int
ulps
)
{
BOOL
equal
=
compare_float
(
U1
(
*
v
).
x
,
x
,
ulps
)
&&
compare_float
(
U2
(
*
v
).
y
,
y
,
ulps
)
&&
compare_float
(
U3
(
*
v
).
z
,
z
,
ulps
);
BOOL
equal
=
compare_float
(
v
->
x
,
x
,
ulps
)
&&
compare_float
(
v
->
y
,
y
,
ulps
)
&&
compare_float
(
v
->
z
,
z
,
ulps
);
ok_
(
__FILE__
,
line
)(
equal
,
"Got unexpected vector {%.8e, %.8e, %.8e}, expected {%.8e, %.8e, %.8e}.
\n
"
,
U1
(
*
v
).
x
,
U2
(
*
v
).
y
,
U3
(
*
v
).
z
,
x
,
y
,
z
);
v
->
x
,
v
->
y
,
v
->
z
,
x
,
y
,
z
);
}
#define vector_eq(a, b) vector_eq_(__LINE__, a, b)
static
void
vector_eq_
(
unsigned
int
line
,
const
D3DVECTOR
*
left
,
const
D3DVECTOR
*
right
)
{
expect_vector_
(
line
,
left
,
U1
(
*
right
).
x
,
U2
(
*
right
).
y
,
U3
(
*
right
).
z
,
0
);
expect_vector_
(
line
,
left
,
right
->
x
,
right
->
y
,
right
->
z
,
0
);
}
static
BOOL
compare_color
(
D3DCOLOR
c1
,
D3DCOLOR
c2
,
BYTE
max_diff
)
...
...
@@ -139,9 +139,9 @@ static void frame_set_transform(IDirect3DRMFrame *frame,
static
void
set_vector
(
D3DVECTOR
*
v
,
float
x
,
float
y
,
float
z
)
{
U1
(
*
v
).
x
=
x
;
U2
(
*
v
).
y
=
y
;
U3
(
*
v
).
z
=
z
;
v
->
x
=
x
;
v
->
y
=
y
;
v
->
z
=
z
;
}
static
void
matrix_sanitise
(
D3DRMMATRIX4D
m
)
...
...
@@ -5158,7 +5158,7 @@ static IDirect3DDevice *create_device1(IDirectDraw *ddraw, HWND window, IDirectD
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_ZBUFFERBITDEPTH
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_ZBUFFER
;
U2
(
surface_desc
)
.
dwZBufferBitDepth
=
z_depths
[
i
];
surface_desc
.
dwZBufferBitDepth
=
z_depths
[
i
];
surface_desc
.
dwWidth
=
rc
.
right
;
surface_desc
.
dwHeight
=
rc
.
bottom
;
if
(
FAILED
(
IDirectDraw_CreateSurface
(
ddraw
,
&
surface_desc
,
ds
,
NULL
)))
...
...
@@ -5491,7 +5491,7 @@ static IDirect3DDevice2 *create_device2(IDirectDraw2 *ddraw, HWND window, IDirec
surface_desc
.
dwSize
=
sizeof
(
surface_desc
);
surface_desc
.
dwFlags
=
DDSD_CAPS
|
DDSD_ZBUFFERBITDEPTH
|
DDSD_WIDTH
|
DDSD_HEIGHT
;
surface_desc
.
ddsCaps
.
dwCaps
=
DDSCAPS_ZBUFFER
;
U2
(
surface_desc
)
.
dwZBufferBitDepth
=
z_depths
[
i
];
surface_desc
.
dwZBufferBitDepth
=
z_depths
[
i
];
surface_desc
.
dwWidth
=
rc
.
right
;
surface_desc
.
dwHeight
=
rc
.
bottom
;
if
(
FAILED
(
IDirectDraw2_CreateSurface
(
ddraw
,
&
surface_desc
,
ds
,
NULL
)))
...
...
@@ -6860,7 +6860,7 @@ static void clear_depth_surface(IDirectDrawSurface *surface, DWORD value)
memset
(
&
fx
,
0
,
sizeof
(
fx
));
fx
.
dwSize
=
sizeof
(
fx
);
U5
(
fx
)
.
dwFillDepth
=
value
;
fx
.
dwFillDepth
=
value
;
hr
=
IDirectDrawSurface_Blt
(
surface
,
NULL
,
NULL
,
NULL
,
DDBLT_DEPTHFILL
|
DDBLT_WAIT
,
&
fx
);
ok
(
SUCCEEDED
(
hr
),
"Got unexpected hr %#lx.
\n
"
,
hr
);
...
...
@@ -6889,8 +6889,8 @@ static void emit_set_ts(void **ptr, D3DTRANSFORMSTATETYPE state, DWORD value)
inst
->
bSize
=
sizeof
(
*
ts
);
inst
->
wCount
=
1
;
U1
(
*
ts
).
dtstTransformStateType
=
state
;
U2
(
*
ts
).
dwArg
[
0
]
=
value
;
ts
->
dtstTransformStateType
=
state
;
ts
->
dwArg
[
0
]
=
value
;
*
ptr
=
ts
+
1
;
}
...
...
@@ -6904,8 +6904,8 @@ static void emit_set_rs(void **ptr, D3DRENDERSTATETYPE state, DWORD value)
inst
->
bSize
=
sizeof
(
*
rs
);
inst
->
wCount
=
1
;
U1
(
*
rs
).
drstRenderStateType
=
state
;
U2
(
*
rs
).
dwArg
[
0
]
=
value
;
rs
->
drstRenderStateType
=
state
;
rs
->
dwArg
[
0
]
=
value
;
*
ptr
=
rs
+
1
;
}
...
...
@@ -6937,15 +6937,15 @@ static void emit_tquad(void **ptr, WORD base_idx)
inst
->
bSize
=
sizeof
(
*
tri
);
inst
->
wCount
=
2
;
U1
(
*
tri
).
v1
=
base_idx
;
U2
(
*
tri
).
v2
=
base_idx
+
1
;
U3
(
*
tri
).
v3
=
base_idx
+
2
;
tri
->
v1
=
base_idx
;
tri
->
v2
=
base_idx
+
1
;
tri
->
v3
=
base_idx
+
2
;
tri
->
wFlags
=
D3DTRIFLAG_START
;
++
tri
;
U1
(
*
tri
).
v1
=
base_idx
+
2
;
U2
(
*
tri
).
v2
=
base_idx
+
1
;
U3
(
*
tri
).
v3
=
base_idx
+
3
;
tri
->
v1
=
base_idx
+
2
;
tri
->
v2
=
base_idx
+
1
;
tri
->
v3
=
base_idx
+
3
;
tri
->
wFlags
=
D3DTRIFLAG_ODD
;
++
tri
;
...
...
dlls/d3drm/tests/vector.c
View file @
43add349
...
...
@@ -53,56 +53,56 @@
}
#define expect_quat(expectedquat,gotquat) \
ok( (fabs(
U1(expectedquat.v).x-U1(gotquat.v)
.x)<admit_error) && \
(fabs(
U2(expectedquat.v).y-U2(gotquat.v)
.y)<admit_error) && \
(fabs(
U3(expectedquat.v).z-U3(gotquat.v)
.z)<admit_error) && \
ok( (fabs(
expectedquat.v.x-gotquat.v
.x)<admit_error) && \
(fabs(
expectedquat.v.y-gotquat.v
.y)<admit_error) && \
(fabs(
expectedquat.v.z-gotquat.v
.z)<admit_error) && \
(fabs(expectedquat.s-gotquat.s)<admit_error), \
"Expected Quaternion %f %f %f %f , Got Quaternion %f %f %f %f\n", \
expectedquat.s,
U1(expectedquat.v).x,U2(expectedquat.v).y,U3(expectedquat.v)
.z, \
gotquat.s,
U1(gotquat.v).x,U2(gotquat.v).y,U3(gotquat.v)
.z);
expectedquat.s,
expectedquat.v.x,expectedquat.v.y,expectedquat.v
.z, \
gotquat.s,
gotquat.v.x,gotquat.v.y,gotquat.v
.z);
#define expect_vec(expectedvec,gotvec) \
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)), \
ok( ((fabs(
expectedvec.x-gotvec.x)<admit_error)&&(fabs(expectedvec.y-gotvec.y)<admit_error)&&(fabs(expectedvec.z-gotvec
.z)<admit_error)), \
"Expected Vector= (%f, %f, %f)\n , Got Vector= (%f, %f, %f)\n", \
U1(expectedvec).x,U2(expectedvec).y,U3(expectedvec).z, U1(gotvec).x, U2(gotvec).y, U3(gotvec)
.z);
expectedvec.x,expectedvec.y,expectedvec.z, gotvec.x, gotvec.y, gotvec
.z);
static
void
VectorTest
(
void
)
{
D3DVALUE
mod
,
par
,
theta
;
D3DVECTOR
e
,
r
,
u
,
v
,
w
,
axis
,
casnul
,
norm
,
ray
,
self
;
U1
(
u
).
x
=
2
.
0
f
;
U2
(
u
).
y
=
2
.
0
f
;
U3
(
u
)
.
z
=
1
.
0
f
;
U1
(
v
).
x
=
4
.
0
f
;
U2
(
v
).
y
=
4
.
0
f
;
U3
(
v
)
.
z
=
0
.
0
f
;
u
.
x
=
2
.
0
f
;
u
.
y
=
2
.
0
f
;
u
.
z
=
1
.
0
f
;
v
.
x
=
4
.
0
f
;
v
.
y
=
4
.
0
f
;
v
.
z
=
0
.
0
f
;
/*______________________VectorAdd_________________________________*/
D3DRMVectorAdd
(
&
r
,
&
u
,
&
v
);
U1
(
e
).
x
=
6
.
0
f
;
U2
(
e
).
y
=
6
.
0
f
;
U3
(
e
)
.
z
=
1
.
0
f
;
e
.
x
=
6
.
0
f
;
e
.
y
=
6
.
0
f
;
e
.
z
=
1
.
0
f
;
expect_vec
(
e
,
r
);
U1
(
self
).
x
=
9
.
0
f
;
U2
(
self
).
y
=
18
.
0
f
;
U3
(
self
)
.
z
=
27
.
0
f
;
self
.
x
=
9
.
0
f
;
self
.
y
=
18
.
0
f
;
self
.
z
=
27
.
0
f
;
D3DRMVectorAdd
(
&
self
,
&
self
,
&
u
);
U1
(
e
).
x
=
11
.
0
f
;
U2
(
e
).
y
=
20
.
0
f
;
U3
(
e
)
.
z
=
28
.
0
f
;
e
.
x
=
11
.
0
f
;
e
.
y
=
20
.
0
f
;
e
.
z
=
28
.
0
f
;
expect_vec
(
e
,
self
);
/*_______________________VectorSubtract__________________________*/
D3DRMVectorSubtract
(
&
r
,
&
u
,
&
v
);
U1
(
e
).
x
=-
2
.
0
f
;
U2
(
e
).
y
=-
2
.
0
f
;
U3
(
e
)
.
z
=
1
.
0
f
;
e
.
x
=-
2
.
0
f
;
e
.
y
=-
2
.
0
f
;
e
.
z
=
1
.
0
f
;
expect_vec
(
e
,
r
);
U1
(
self
).
x
=
9
.
0
f
;
U2
(
self
).
y
=
18
.
0
f
;
U3
(
self
)
.
z
=
27
.
0
f
;
self
.
x
=
9
.
0
f
;
self
.
y
=
18
.
0
f
;
self
.
z
=
27
.
0
f
;
D3DRMVectorSubtract
(
&
self
,
&
self
,
&
u
);
U1
(
e
).
x
=
7
.
0
f
;
U2
(
e
).
y
=
16
.
0
f
;
U3
(
e
)
.
z
=
26
.
0
f
;
e
.
x
=
7
.
0
f
;
e
.
y
=
16
.
0
f
;
e
.
z
=
26
.
0
f
;
expect_vec
(
e
,
self
);
/*_______________________VectorCrossProduct_______________________*/
D3DRMVectorCrossProduct
(
&
r
,
&
u
,
&
v
);
U1
(
e
).
x
=-
4
.
0
f
;
U2
(
e
).
y
=
4
.
0
f
;
U3
(
e
)
.
z
=
0
.
0
f
;
e
.
x
=-
4
.
0
f
;
e
.
y
=
4
.
0
f
;
e
.
z
=
0
.
0
f
;
expect_vec
(
e
,
r
);
U1
(
self
).
x
=
9
.
0
f
;
U2
(
self
).
y
=
18
.
0
f
;
U3
(
self
)
.
z
=
27
.
0
f
;
self
.
x
=
9
.
0
f
;
self
.
y
=
18
.
0
f
;
self
.
z
=
27
.
0
f
;
D3DRMVectorCrossProduct
(
&
self
,
&
self
,
&
u
);
U1
(
e
).
x
=-
36
.
0
f
;
U2
(
e
).
y
=
45
.
0
f
;
U3
(
e
)
.
z
=-
18
.
0
f
;
e
.
x
=-
36
.
0
f
;
e
.
y
=
45
.
0
f
;
e
.
z
=-
18
.
0
f
;
expect_vec
(
e
,
self
);
/*_______________________VectorDotProduct__________________________*/
...
...
@@ -115,51 +115,51 @@ static void VectorTest(void)
/*_______________________VectorNormalize___________________________*/
D3DRMVectorNormalize
(
&
u
);
U1
(
e
).
x
=
2
.
0
f
/
3
.
0
f
;
U2
(
e
).
y
=
2
.
0
f
/
3
.
0
f
;
U3
(
e
)
.
z
=
1
.
0
f
/
3
.
0
f
;
e
.
x
=
2
.
0
f
/
3
.
0
f
;
e
.
y
=
2
.
0
f
/
3
.
0
f
;
e
.
z
=
1
.
0
f
/
3
.
0
f
;
expect_vec
(
e
,
u
);
/* If u is the NULL vector, MSDN says that the return vector is NULL. In fact, the returned vector is (1,0,0). The following test case prove it. */
U1
(
casnul
).
x
=
0
.
0
f
;
U2
(
casnul
).
y
=
0
.
0
f
;
U3
(
casnul
)
.
z
=
0
.
0
f
;
casnul
.
x
=
0
.
0
f
;
casnul
.
y
=
0
.
0
f
;
casnul
.
z
=
0
.
0
f
;
D3DRMVectorNormalize
(
&
casnul
);
U1
(
e
).
x
=
1
.
0
f
;
U2
(
e
).
y
=
0
.
0
f
;
U3
(
e
)
.
z
=
0
.
0
f
;
e
.
x
=
1
.
0
f
;
e
.
y
=
0
.
0
f
;
e
.
z
=
0
.
0
f
;
expect_vec
(
e
,
casnul
);
/*____________________VectorReflect_________________________________*/
U1
(
ray
).
x
=
3
.
0
f
;
U2
(
ray
).
y
=-
4
.
0
f
;
U3
(
ray
)
.
z
=
5
.
0
f
;
U1
(
norm
).
x
=
1
.
0
f
;
U2
(
norm
).
y
=-
2
.
0
f
;
U3
(
norm
)
.
z
=
6
.
0
f
;
U1
(
e
).
x
=
79
.
0
f
;
U2
(
e
).
y
=-
160
.
0
f
;
U3
(
e
)
.
z
=
487
.
0
f
;
ray
.
x
=
3
.
0
f
;
ray
.
y
=-
4
.
0
f
;
ray
.
z
=
5
.
0
f
;
norm
.
x
=
1
.
0
f
;
norm
.
y
=-
2
.
0
f
;
norm
.
z
=
6
.
0
f
;
e
.
x
=
79
.
0
f
;
e
.
y
=-
160
.
0
f
;
e
.
z
=
487
.
0
f
;
D3DRMVectorReflect
(
&
r
,
&
ray
,
&
norm
);
expect_vec
(
e
,
r
);
/*_______________________VectorRotate_______________________________*/
U1
(
w
).
x
=
3
.
0
f
;
U2
(
w
).
y
=
4
.
0
f
;
U3
(
w
)
.
z
=
0
.
0
f
;
U1
(
axis
).
x
=
0
.
0
f
;
U2
(
axis
).
y
=
0
.
0
f
;
U3
(
axis
)
.
z
=
1
.
0
f
;
w
.
x
=
3
.
0
f
;
w
.
y
=
4
.
0
f
;
w
.
z
=
0
.
0
f
;
axis
.
x
=
0
.
0
f
;
axis
.
y
=
0
.
0
f
;
axis
.
z
=
1
.
0
f
;
theta
=
2
.
0
f
*
PI
/
3
.
0
f
;
D3DRMVectorRotate
(
&
r
,
&
w
,
&
axis
,
theta
);
U1
(
e
).
x
=-
0
.
3
f
-
0
.
4
f
*
sqrtf
(
3
.
0
f
);
U2
(
e
).
y
=
0
.
3
f
*
sqrtf
(
3
.
0
f
)
-
0
.
4
f
;
U3
(
e
)
.
z
=
0
.
0
f
;
e
.
x
=-
0
.
3
f
-
0
.
4
f
*
sqrtf
(
3
.
0
f
);
e
.
y
=
0
.
3
f
*
sqrtf
(
3
.
0
f
)
-
0
.
4
f
;
e
.
z
=
0
.
0
f
;
expect_vec
(
e
,
r
);
/* The same formula gives D3DRMVectorRotate, for theta in [-PI/2;+PI/2] or not. The following test proves this fact.*/
theta
=-
PI
/
4
.
0
f
;
D3DRMVectorRotate
(
&
r
,
&
w
,
&
axis
,
theta
);
U1
(
e
).
x
=
1
.
4
f
/
sqrtf
(
2
.
0
f
);
U2
(
e
).
y
=
0
.
2
f
/
sqrtf
(
2
.
0
f
);
U3
(
e
)
.
z
=
0
.
0
f
;
e
.
x
=
1
.
4
f
/
sqrtf
(
2
.
0
f
);
e
.
y
=
0
.
2
f
/
sqrtf
(
2
.
0
f
);
e
.
z
=
0
.
0
f
;
expect_vec
(
e
,
r
);
theta
=
PI
/
8
.
0
f
;
D3DRMVectorRotate
(
&
self
,
&
self
,
&
axis
,
theta
);
U1
(
e
).
x
=
0
.
989950
;
U2
(
e
).
y
=
0
.
141421
f
;
U3
(
e
)
.
z
=
0
.
0
f
;
e
.
x
=
0
.
989950
;
e
.
y
=
0
.
141421
f
;
e
.
z
=
0
.
0
f
;
expect_vec
(
e
,
r
);
/*_______________________VectorScale__________________________*/
par
=
2
.
5
f
;
D3DRMVectorScale
(
&
r
,
&
v
,
par
);
U1
(
e
).
x
=
10
.
0
f
;
U2
(
e
).
y
=
10
.
0
f
;
U3
(
e
)
.
z
=
0
.
0
f
;
e
.
x
=
10
.
0
f
;
e
.
y
=
10
.
0
f
;
e
.
z
=
0
.
0
f
;
expect_vec
(
e
,
r
);
U1
(
self
).
x
=
9
.
0
f
;
U2
(
self
).
y
=
18
.
0
f
;
U3
(
self
)
.
z
=
27
.
0
f
;
self
.
x
=
9
.
0
f
;
self
.
y
=
18
.
0
f
;
self
.
z
=
27
.
0
f
;
D3DRMVectorScale
(
&
self
,
&
self
,
2
);
U1
(
e
).
x
=
18
.
0
f
;
U2
(
e
).
y
=
36
.
0
f
;
U3
(
e
)
.
z
=
54
.
0
f
;
e
.
x
=
18
.
0
f
;
e
.
y
=
36
.
0
f
;
e
.
z
=
54
.
0
f
;
expect_vec
(
e
,
self
);
}
...
...
@@ -172,7 +172,7 @@ static void MatrixTest(void)
exp
[
1
][
0
]
=
20
.
0
f
;
exp
[
1
][
1
]
=-
39
.
0
f
;
exp
[
1
][
2
]
=
20
.
0
f
;
exp
[
1
][
3
]
=
0
.
0
f
;
exp
[
2
][
0
]
=
10
.
0
f
;
exp
[
2
][
1
]
=
28
.
0
f
;
exp
[
2
][
2
]
=-
25
.
0
f
;
exp
[
2
][
3
]
=
0
.
0
f
;
exp
[
3
][
0
]
=
0
.
0
f
;
exp
[
3
][
1
]
=
0
.
0
f
;
exp
[
3
][
2
]
=
0
.
0
f
;
exp
[
3
][
3
]
=
1
.
0
f
;
q
.
s
=
1
.
0
f
;
U1
(
q
.
v
).
x
=
2
.
0
f
;
U2
(
q
.
v
).
y
=
3
.
0
f
;
U3
(
q
.
v
)
.
z
=
4
.
0
f
;
q
.
s
=
1
.
0
f
;
q
.
v
.
x
=
2
.
0
f
;
q
.
v
.
y
=
3
.
0
f
;
q
.
v
.
z
=
4
.
0
f
;
D3DRMMatrixFromQuaternion
(
mat
,
&
q
);
expect_mat
(
exp
,
mat
);
...
...
@@ -185,10 +185,10 @@ static void QuaternionTest(void)
D3DRMQUATERNION
q
,
q1
,
q1final
,
q2
,
q2final
,
r
;
/*_________________QuaternionFromRotation___________________*/
U1
(
axis
).
x
=
1
.
0
f
;
U2
(
axis
).
y
=
1
.
0
f
;
U3
(
axis
)
.
z
=
1
.
0
f
;
axis
.
x
=
1
.
0
f
;
axis
.
y
=
1
.
0
f
;
axis
.
z
=
1
.
0
f
;
theta
=
2
.
0
f
*
PI
/
3
.
0
f
;
D3DRMQuaternionFromRotation
(
&
r
,
&
axis
,
theta
);
q
.
s
=
0
.
5
f
;
U1
(
q
.
v
).
x
=
0
.
5
f
;
U2
(
q
.
v
).
y
=
0
.
5
f
;
U3
(
q
.
v
)
.
z
=
0
.
5
f
;
q
.
s
=
0
.
5
f
;
q
.
v
.
x
=
0
.
5
f
;
q
.
v
.
y
=
0
.
5
f
;
q
.
v
.
z
=
0
.
5
f
;
expect_quat
(
q
,
r
);
/*_________________QuaternionSlerp_________________________*/
...
...
@@ -196,24 +196,24 @@ static void QuaternionTest(void)
* interpolates between the first quaternion and the opposite of the second one.
* The test proves this fact. */
par
=
0
.
31
f
;
q1
.
s
=
1
.
0
f
;
U1
(
q1
.
v
).
x
=
2
.
0
f
;
U2
(
q1
.
v
).
y
=
3
.
0
f
;
U3
(
q1
.
v
)
.
z
=
50
.
0
f
;
q2
.
s
=-
4
.
0
f
;
U1
(
q2
.
v
).
x
=
6
.
0
f
;
U2
(
q2
.
v
).
y
=
7
.
0
f
;
U3
(
q2
.
v
)
.
z
=
8
.
0
f
;
q1
.
s
=
1
.
0
f
;
q1
.
v
.
x
=
2
.
0
f
;
q1
.
v
.
y
=
3
.
0
f
;
q1
.
v
.
z
=
50
.
0
f
;
q2
.
s
=-
4
.
0
f
;
q2
.
v
.
x
=
6
.
0
f
;
q2
.
v
.
y
=
7
.
0
f
;
q2
.
v
.
z
=
8
.
0
f
;
/* The angle between q1 and q2 is in [-PI/2,PI/2]. So, one interpolates between q1 and q2. */
q
.
s
=
-
0
.
55
f
;
U1
(
q
.
v
).
x
=
3
.
24
f
;
U2
(
q
.
v
).
y
=
4
.
24
f
;
U3
(
q
.
v
)
.
z
=
36
.
98
f
;
q
.
s
=
-
0
.
55
f
;
q
.
v
.
x
=
3
.
24
f
;
q
.
v
.
y
=
4
.
24
f
;
q
.
v
.
z
=
36
.
98
f
;
D3DRMQuaternionSlerp
(
&
r
,
&
q1
,
&
q2
,
par
);
expect_quat
(
q
,
r
);
q1
.
s
=
1
.
0
f
;
U1
(
q1
.
v
).
x
=
2
.
0
f
;
U2
(
q1
.
v
).
y
=
3
.
0
f
;
U3
(
q1
.
v
)
.
z
=
50
.
0
f
;
q2
.
s
=-
94
.
0
f
;
U1
(
q2
.
v
).
x
=
6
.
0
f
;
U2
(
q2
.
v
).
y
=
7
.
0
f
;
U3
(
q2
.
v
)
.
z
=-
8
.
0
f
;
q1
.
s
=
1
.
0
f
;
q1
.
v
.
x
=
2
.
0
f
;
q1
.
v
.
y
=
3
.
0
f
;
q1
.
v
.
z
=
50
.
0
f
;
q2
.
s
=-
94
.
0
f
;
q2
.
v
.
x
=
6
.
0
f
;
q2
.
v
.
y
=
7
.
0
f
;
q2
.
v
.
z
=-
8
.
0
f
;
/* The angle between q1 and q2 is not in [-PI/2,PI/2]. So, one interpolates between q1 and -q2. */
q
.
s
=
29
.
83
f
;
U1
(
q
.
v
).
x
=-
0
.
48
f
;
U2
(
q
.
v
).
y
=-
0
.
10
f
;
U3
(
q
.
v
)
.
z
=
36
.
98
f
;
q
.
s
=
29
.
83
f
;
q
.
v
.
x
=-
0
.
48
f
;
q
.
v
.
y
=-
0
.
10
f
;
q
.
v
.
z
=
36
.
98
f
;
D3DRMQuaternionSlerp
(
&
r
,
&
q1
,
&
q2
,
par
);
expect_quat
(
q
,
r
);
/* Test the spherical interpolation part */
q1
.
s
=
0
.
1
f
;
U1
(
q1
.
v
).
x
=
0
.
2
f
;
U2
(
q1
.
v
).
y
=
0
.
3
f
;
U3
(
q1
.
v
)
.
z
=
0
.
4
f
;
q2
.
s
=
0
.
5
f
;
U1
(
q2
.
v
).
x
=
0
.
6
f
;
U2
(
q2
.
v
).
y
=
0
.
7
f
;
U3
(
q2
.
v
)
.
z
=
0
.
8
f
;
q
.
s
=
0
.
243943
f
;
U1
(
q
.
v
).
x
=
0
.
351172
f
;
U2
(
q
.
v
).
y
=
0
.
458401
f
;
U3
(
q
.
v
)
.
z
=
0
.
565629
f
;
q1
.
s
=
0
.
1
f
;
q1
.
v
.
x
=
0
.
2
f
;
q1
.
v
.
y
=
0
.
3
f
;
q1
.
v
.
z
=
0
.
4
f
;
q2
.
s
=
0
.
5
f
;
q2
.
v
.
x
=
0
.
6
f
;
q2
.
v
.
y
=
0
.
7
f
;
q2
.
v
.
z
=
0
.
8
f
;
q
.
s
=
0
.
243943
f
;
q
.
v
.
x
=
0
.
351172
f
;
q
.
v
.
y
=
0
.
458401
f
;
q
.
v
.
z
=
0
.
565629
f
;
q1final
=
q1
;
q2final
=
q2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment