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
cf443380
Commit
cf443380
authored
Nov 21, 2007
by
David Adam
Committed by
Alexandre Julliard
Nov 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXMatrixTransformation.
parent
f1bc4849
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
3 deletions
+96
-3
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+80
-0
math.c
dlls/d3dx8/tests/math.c
+14
-2
d3dx8math.h
include/d3dx8math.h
+1
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
cf443380
...
...
@@ -33,7 +33,7 @@
@ stdcall D3DXMatrixRotationAxis(ptr ptr long)
@ stdcall D3DXMatrixRotationQuaternion(ptr ptr)
@ stdcall D3DXMatrixRotationYawPitchRoll(ptr long long long)
@ st
ub D3DXMatrixTransformation
@ st
dcall D3DXMatrixTransformation(ptr ptr ptr ptr ptr ptr ptr)
@ stdcall D3DXMatrixAffineTransformation(ptr long ptr ptr ptr)
@ stdcall D3DXMatrixLookAtRH(ptr ptr ptr ptr)
@ stdcall D3DXMatrixLookAtLH(ptr ptr ptr ptr)
...
...
dlls/d3dx8/math.c
View file @
cf443380
...
...
@@ -480,6 +480,86 @@ D3DXMATRIX* WINAPI D3DXMatrixShadow(D3DXMATRIX *pout, CONST D3DXVECTOR4 *plight,
return
pout
;
}
D3DXMATRIX
*
D3DXMatrixTransformation
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR3
*
pscalingcenter
,
CONST
D3DXQUATERNION
*
pscalingrotation
,
CONST
D3DXVECTOR3
*
pscaling
,
CONST
D3DXVECTOR3
*
protationcenter
,
CONST
D3DXQUATERNION
*
protation
,
CONST
D3DXVECTOR3
*
ptranslation
)
{
D3DXMATRIX
m1
,
m2
,
m3
,
m4
,
m5
,
m6
,
m7
,
p1
,
p2
,
p3
,
p4
,
p5
;
D3DXQUATERNION
prc
;
D3DXVECTOR3
psc
,
pt
;
if
(
!
pscalingcenter
)
{
psc
.
x
=
0
.
0
f
;
psc
.
y
=
0
.
0
f
;
psc
.
z
=
0
.
0
f
;
}
else
{
psc
.
x
=
pscalingcenter
->
x
;
psc
.
y
=
pscalingcenter
->
y
;
psc
.
z
=
pscalingcenter
->
z
;
}
if
(
!
protationcenter
)
{
prc
.
x
=
0
.
0
f
;
prc
.
y
=
0
.
0
f
;
prc
.
z
=
0
.
0
f
;
}
else
{
prc
.
x
=
protationcenter
->
x
;
prc
.
y
=
protationcenter
->
y
;
prc
.
z
=
protationcenter
->
z
;
}
if
(
!
ptranslation
)
{
pt
.
x
=
0
.
0
f
;
pt
.
y
=
0
.
0
f
;
pt
.
z
=
0
.
0
f
;
}
else
{
pt
.
x
=
ptranslation
->
x
;
pt
.
y
=
ptranslation
->
y
;
pt
.
z
=
ptranslation
->
z
;
}
D3DXMatrixTranslation
(
&
m1
,
-
psc
.
x
,
-
psc
.
y
,
-
psc
.
z
);
if
(
!
pscalingrotation
)
{
D3DXMatrixIdentity
(
&
m2
);
D3DXMatrixIdentity
(
&
m4
);
}
else
{
D3DXMatrixRotationQuaternion
(
&
m4
,
pscalingrotation
);
D3DXMatrixInverse
(
&
m2
,
NULL
,
&
m4
);
}
if
(
!
pscaling
)
{
D3DXMatrixIdentity
(
&
m3
);
}
else
{
D3DXMatrixScaling
(
&
m3
,
pscaling
->
x
,
pscaling
->
y
,
pscaling
->
z
);
}
if
(
!
protation
)
{
D3DXMatrixIdentity
(
&
m6
);
}
else
{
D3DXMatrixRotationQuaternion
(
&
m6
,
protation
);
}
D3DXMatrixTranslation
(
&
m5
,
psc
.
x
-
prc
.
x
,
psc
.
y
-
prc
.
y
,
psc
.
z
-
prc
.
z
);
D3DXMatrixTranslation
(
&
m7
,
prc
.
x
+
pt
.
x
,
prc
.
y
+
pt
.
y
,
prc
.
z
+
pt
.
z
);
D3DXMatrixMultiply
(
&
p1
,
&
m1
,
&
m2
);
D3DXMatrixMultiply
(
&
p2
,
&
p1
,
&
m3
);
D3DXMatrixMultiply
(
&
p3
,
&
p2
,
&
m4
);
D3DXMatrixMultiply
(
&
p4
,
&
p3
,
&
m5
);
D3DXMatrixMultiply
(
&
p5
,
&
p4
,
&
m6
);
D3DXMatrixMultiply
(
pout
,
&
p5
,
&
m7
);
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixTranslation
(
D3DXMATRIX
*
pout
,
FLOAT
x
,
FLOAT
y
,
FLOAT
z
)
{
D3DXMatrixIdentity
(
pout
);
...
...
dlls/d3dx8/tests/math.c
View file @
cf443380
...
...
@@ -164,8 +164,8 @@ static void D3DXMatrixTest(void)
D3DXMATRIX
expectedmat
,
gotmat
,
mat
,
mat2
,
mat3
;
LPD3DXMATRIX
funcpointer
;
D3DXPLANE
plane
;
D3DXQUATERNION
q
;
D3DXVECTOR3
at
,
axis
,
eye
;
D3DXQUATERNION
q
,
r
;
D3DXVECTOR3
at
,
axis
,
eye
,
last
,
scaling
;
D3DXVECTOR4
light
;
BOOL
expected
,
got
;
FLOAT
angle
,
determinant
,
expectedfloat
,
gotfloat
;
...
...
@@ -187,10 +187,13 @@ static void D3DXMatrixTest(void)
plane
.
a
=
-
3
.
0
f
;
plane
.
b
=
-
1
.
0
f
;
plane
.
c
=
4
.
0
f
;
plane
.
d
=
7
.
0
f
;
q
.
x
=
1
.
0
f
;
q
.
y
=
-
4
.
0
f
;
q
.
z
=
7
.
0
f
;
q
.
w
=
-
11
.
0
f
;
r
.
x
=
0
.
87
f
;
r
.
y
=
0
.
65
f
;
r
.
z
=
0
.
43
f
;
r
.
w
=
0
.
21
f
;
at
.
x
=
-
2
.
0
f
;
at
.
y
=
13
.
0
f
;
at
.
z
=
-
9
.
0
f
;
axis
.
x
=
1
.
0
f
;
axis
.
y
=
-
3
.
0
f
;
axis
.
z
=
7
.
0
f
;
eye
.
x
=
8
.
0
f
;
eye
.
y
=
-
5
.
0
f
;
eye
.
z
=
5
.
75
f
;
last
.
x
=
9
.
7
f
;
last
.
y
=
-
8
.
6
;
last
.
z
=
1
.
3
f
;
scaling
.
x
=
0
.
03
f
;
scaling
.
y
=
0
.
05
f
;
scaling
.
z
=
0
.
06
f
;
light
.
x
=
9
.
6
f
;
light
.
y
=
8
.
5
f
;
light
.
z
=
7
.
4
;
light
.
w
=
6
.
3
;
...
...
@@ -364,6 +367,7 @@ static void D3DXMatrixTest(void)
U
(
expectedmat
).
m
[
3
][
0
]
=
1
.
615385
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
0
.
538462
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
-
2
.
153846
f
;
U
(
expectedmat
).
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixReflect
(
&
gotmat
,
&
plane
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixRotationAxis_____*/
U
(
expectedmat
).
m
[
0
][
0
]
=
0
.
508475
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
0
.
763805
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
397563
f
;
U
(
expectedmat
).
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
-
0
.
814652
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
0
.
576271
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
-
0
.
06521
9
f
;
U
(
expectedmat
).
m
[
1
][
3
]
=
0
.
0
f
;
...
...
@@ -428,6 +432,14 @@ static void D3DXMatrixTest(void)
D3DXMatrixShadow
(
&
gotmat
,
&
light
,
&
plane
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixTransformation______________*/
U
(
expectedmat
).
m
[
0
][
0
]
=
-
0
.
2148
f
;
U
(
expectedmat
).
m
[
0
][
1
]
=
1
.
3116
f
;
U
(
expectedmat
).
m
[
0
][
2
]
=
0
.
4752
f
;
U
(
expectedmat
).
m
[
0
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
0
]
=
0
.
9504
f
;
U
(
expectedmat
).
m
[
1
][
1
]
=
-
0
.
8836
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
9244
f
;
U
(
expectedmat
).
m
[
1
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
2
][
0
]
=
1
.
0212
f
;
U
(
expectedmat
).
m
[
2
][
1
]
=
0
.
1936
f
;
U
(
expectedmat
).
m
[
2
][
2
]
=
-
1
.
3588
f
;
U
(
expectedmat
).
m
[
2
][
3
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
3
][
0
]
=
18
.
2985
f
;
U
(
expectedmat
).
m
[
3
][
1
]
=
-
29
.
624001
f
;
U
(
expectedmat
).
m
[
3
][
2
]
=
15
.
683499
f
;
U
(
expectedmat
).
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixTransformation
(
&
gotmat
,
&
at
,
&
q
,
NULL
,
&
eye
,
&
r
,
&
last
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixTranslation______________*/
U
(
expectedmat
).
m
[
0
][
0
]
=
1
.
0
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
;
U
(
expectedmat
).
m
[
1
][
1
]
=
1
.
0
f
;
U
(
expectedmat
).
m
[
1
][
2
]
=
0
.
0
f
;
U
(
expectedmat
).
m
[
1
][
3
]
=
0
.
0
f
;
...
...
include/d3dx8math.h
View file @
cf443380
...
...
@@ -293,6 +293,7 @@ D3DXMATRIX* WINAPI D3DXMatrixRotationYawPitchRoll(D3DXMATRIX *pout, FLOAT yaw, F
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
*
D3DXMatrixTransformation
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR3
*
pscalingcenter
,
CONST
D3DXQUATERNION
*
pscalingrotation
,
CONST
D3DXVECTOR3
*
pscaling
,
CONST
D3DXVECTOR3
*
protationcenter
,
CONST
D3DXQUATERNION
*
protation
,
CONST
D3DXVECTOR3
*
ptranslation
);
D3DXMATRIX
*
WINAPI
D3DXMatrixTranslation
(
D3DXMATRIX
*
pout
,
FLOAT
x
,
FLOAT
y
,
FLOAT
z
);
D3DXMATRIX
*
WINAPI
D3DXMatrixTranspose
(
D3DXMATRIX
*
pout
,
CONST
D3DXMATRIX
*
pm
);
...
...
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