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
a3634e2c
Commit
a3634e2c
authored
Jul 15, 2009
by
David Adam
Committed by
Alexandre Julliard
Jul 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Fix D3DXQuaternionToAxisAngle to make tests pass in Windows.
parent
8f1836cb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
22 deletions
+8
-22
math.c
dlls/d3dx9_36/math.c
+4
-17
math.c
dlls/d3dx9_36/tests/math.c
+4
-5
No files found.
dlls/d3dx9_36/math.c
View file @
a3634e2c
...
...
@@ -1373,23 +1373,10 @@ D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATE
void
WINAPI
D3DXQuaternionToAxisAngle
(
CONST
D3DXQUATERNION
*
pq
,
D3DXVECTOR3
*
paxis
,
FLOAT
*
pangle
)
{
FLOAT
norm
;
*
pangle
=
0
.
0
f
;
norm
=
D3DXQuaternionLength
(
pq
);
if
(
norm
)
{
paxis
->
x
=
pq
->
x
/
norm
;
paxis
->
y
=
pq
->
y
/
norm
;
paxis
->
z
=
pq
->
z
/
norm
;
if
(
fabs
(
pq
->
w
)
<=
1
.
0
f
)
*
pangle
=
2
.
0
f
*
acos
(
pq
->
w
);
}
else
{
paxis
->
x
=
1
.
0
f
;
paxis
->
y
=
0
.
0
f
;
paxis
->
z
=
0
.
0
f
;
}
paxis
->
x
=
pq
->
x
;
paxis
->
y
=
pq
->
y
;
paxis
->
z
=
pq
->
z
;
*
pangle
=
2
.
0
f
*
acos
(
pq
->
w
);
}
/*_________________D3DXVec2_____________________*/
...
...
dlls/d3dx9_36/tests/math.c
View file @
a3634e2c
...
...
@@ -938,20 +938,19 @@ static void D3DXQuaternionTest(void)
/*_______________D3DXQuaternionToAxisAngle__________________*/
Nq
.
x
=
1
.
0
f
/
22
.
0
f
;
Nq
.
y
=
2
.
0
f
/
22
.
0
f
;
Nq
.
z
=
4
.
0
f
/
22
.
0
f
;
Nq
.
w
=
10
.
0
f
/
22
.
0
f
;
expectedvec
.
x
=
1
.
0
f
/
11
.
0
f
;
expectedvec
.
y
=
2
.
0
f
/
11
.
0
f
;
expectedvec
.
z
=
4
.
0
f
/
11
.
0
f
;
expectedvec
.
x
=
1
.
0
f
/
22
.
0
f
;
expectedvec
.
y
=
2
.
0
f
/
22
.
0
f
;
expectedvec
.
z
=
4
.
0
f
/
22
.
0
f
;
expected
=
2
.
197869
f
;
D3DXQuaternionToAxisAngle
(
&
Nq
,
&
axis
,
&
angle
);
expect_vec3
(
expectedvec
,
axis
);
ok
(
fabs
(
angle
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
angle
);
/* Test if |w|>1.0f */
expectedvec
.
x
=
1
.
0
f
/
11
.
0
f
;
expectedvec
.
y
=
2
.
0
f
/
11
.
0
f
;
expectedvec
.
z
=
4
.
0
f
/
11
.
0
f
;
expectedvec
.
x
=
1
.
0
f
;
expectedvec
.
y
=
2
.
0
f
;
expectedvec
.
z
=
4
.
0
f
;
expected
=
0
.
0
f
;
D3DXQuaternionToAxisAngle
(
&
q
,
&
axis
,
&
angle
);
expect_vec3
(
expectedvec
,
axis
);
ok
(
fabs
(
angle
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
angle
);
/* Test the null quaternion */
expectedvec
.
x
=
1
.
0
f
;
expectedvec
.
y
=
0
.
0
f
;
expectedvec
.
z
=
0
.
0
f
;
expected
=
0
.
0
f
;
expectedvec
.
x
=
0
.
0
f
;
expectedvec
.
y
=
0
.
0
f
;
expectedvec
.
z
=
0
.
0
f
;
expected
=
3
.
141593
f
;
D3DXQuaternionToAxisAngle
(
&
nul
,
&
axis
,
&
angle
);
expect_vec3
(
expectedvec
,
axis
);
ok
(
fabs
(
angle
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
angle
);
...
...
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