Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
ec9db0a1
Commit
ec9db0a1
authored
Oct 01, 2012
by
Rico Schüller
Committed by
Alexandre Julliard
Oct 01, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Fix D3DXMatrixAffineTransformation() and add some tests.
parent
b9c2a195
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
10 deletions
+40
-10
math.c
dlls/d3dx9_36/math.c
+11
-4
math.c
dlls/d3dx9_36/tests/math.c
+29
-6
No files found.
dlls/d3dx9_36/math.c
View file @
ec9db0a1
...
...
@@ -81,7 +81,7 @@ FLOAT WINAPI D3DXFresnelTerm(FLOAT costheta, FLOAT refractionindex)
{
FLOAT
a
,
d
,
g
,
result
;
TRACE
(
"costheta %f, refractionindex %f
)
\n
"
,
costheta
,
refractionindex
);
TRACE
(
"costheta %f, refractionindex %f
\n
"
,
costheta
,
refractionindex
);
g
=
sqrtf
(
refractionindex
*
refractionindex
+
costheta
*
costheta
-
1
.
0
f
);
a
=
g
+
costheta
;
...
...
@@ -102,6 +102,13 @@ D3DXMATRIX * WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *out, FLOAT scalin
D3DXMatrixIdentity
(
out
);
if
(
rotationcenter
)
{
out
->
u
.
m
[
3
][
0
]
=
-
rotationcenter
->
x
;
out
->
u
.
m
[
3
][
1
]
=
-
rotationcenter
->
y
;
out
->
u
.
m
[
3
][
2
]
=
-
rotationcenter
->
z
;
}
if
(
rotation
)
{
FLOAT
temp00
,
temp01
,
temp02
,
temp10
,
temp11
,
temp12
,
temp20
,
temp21
,
temp22
;
...
...
@@ -130,9 +137,9 @@ D3DXMATRIX * WINAPI D3DXMatrixAffineTransformation(D3DXMATRIX *out, FLOAT scalin
{
FLOAT
x
,
y
,
z
;
x
=
-
rotationcenter
->
x
;
y
=
-
rotationcenter
->
y
;
z
=
-
rotationcenter
->
z
;
x
=
out
->
u
.
m
[
3
][
0
]
;
y
=
out
->
u
.
m
[
3
][
1
]
;
z
=
out
->
u
.
m
[
3
][
2
]
;
out
->
u
.
m
[
3
][
0
]
=
x
*
temp00
+
y
*
temp10
+
z
*
temp20
;
out
->
u
.
m
[
3
][
1
]
=
x
*
temp01
+
y
*
temp11
+
z
*
temp21
;
...
...
dlls/d3dx9_36/tests/math.c
View file @
ec9db0a1
...
...
@@ -275,14 +275,37 @@ static void D3DXMatrixTest(void)
U
(
expectedmat
).
m
[
1
][
0
]
=
519
.
760010
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
-
352
.
440002
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
-
277
.
679993
f
;
U
(
expectedmat
).
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
363
.
119995
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
-
121
.
040001
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
117
.
479996
f
;
U
(
expectedmat
).
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
-
1239
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
667
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
567
.
0
f
;
U
(
expectedmat
).
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
&
at
,
&
q
,
&
axis
);
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
&
at
,
&
q
,
&
axis
);
expect_mat
(
&
expectedmat
,
&
gotmat
);
/* Test the NULL case */
U
(
expectedmat
).
m
[
0
][
0
]
=
-
459
.
239990
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
-
576
.
719971
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
-
263
.
440002
f
;
U
(
expectedmat
).
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
519
.
760010
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
-
352
.
440002
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
-
277
.
679993
f
;
U
(
expectedmat
).
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
363
.
119995
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
-
121
.
040001
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
117
.
479996
f
;
U
(
expectedmat
).
m
[
2
][
3
]
=
0
.
0
f
;
/* Test the NULL case */
U
(
expectedmat
).
m
[
3
][
0
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
-
3
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
7
.
0
f
;
U
(
expectedmat
).
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
NULL
,
&
q
,
&
axis
);
expect_mat
(
&
expectedmat
,
&
gotmat
);
U
(
expectedmat
).
m
[
3
][
0
]
=
-
1240
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
670
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
560
.
0
f
;
U
(
expectedmat
).
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
&
at
,
&
q
,
NULL
);
expect_mat
(
&
expectedmat
,
&
gotmat
);
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
NULL
,
&
q
,
NULL
);
expect_mat
(
&
expectedmat
,
&
gotmat
);
U
(
expectedmat
).
m
[
0
][
0
]
=
3
.
56
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
3
.
56
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
3
.
56
f
;
U
(
expectedmat
).
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
-
3
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
7
.
0
f
;
U
(
expectedmat
).
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
NULL
,
&
q
,
&
axis
);
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
NULL
,
NULL
,
&
axis
);
expect_mat
(
&
expectedmat
,
&
gotmat
);
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
&
at
,
NULL
,
&
axis
);
expect_mat
(
&
expectedmat
,
&
gotmat
);
U
(
expectedmat
).
m
[
3
][
0
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
&
at
,
NULL
,
NULL
);
expect_mat
(
&
expectedmat
,
&
gotmat
);
D3DXMatrixAffineTransformation
(
&
gotmat
,
3
.
56
f
,
NULL
,
NULL
,
NULL
);
expect_mat
(
&
expectedmat
,
&
gotmat
);
/*____________D3DXMatrixfDeterminant_____________*/
...
...
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