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
8d996a22
Commit
8d996a22
authored
Nov 03, 2007
by
David Adam
Committed by
Alexandre Julliard
Nov 05, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXMatrixLookAtRH.
parent
15f029a5
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
2 deletions
+42
-2
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+29
-0
math.c
dlls/d3dx8/tests/math.c
+11
-1
d3dx8math.h
include/d3dx8math.h
+1
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
8d996a22
...
...
@@ -34,7 +34,7 @@
@ stdcall D3DXMatrixRotationYawPitchRoll(ptr long long long)
@ stub D3DXMatrixTransformation
@ stub D3DXMatrixAffineTransformation
@ st
ub D3DXMatrixLookAtRH
@ st
dcall D3DXMatrixLookAtRH(ptr ptr ptr ptr ptr)
@ stub D3DXMatrixLookAtLH
@ stub D3DXMatrixPerspectiveRH
@ stub D3DXMatrixPerspectiveLH
...
...
dlls/d3dx8/math.c
View file @
8d996a22
...
...
@@ -44,6 +44,35 @@ FLOAT WINAPI D3DXMatrixfDeterminant(CONST D3DXMATRIX *pm)
return
det
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixLookAtRH
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR3
*
peye
,
CONST
D3DXVECTOR3
*
pat
,
CONST
D3DXVECTOR3
*
pup
)
{
D3DXVECTOR3
right
,
rightn
,
up
,
upn
,
vec
,
vec2
;
D3DXVec3Subtract
(
&
vec2
,
pat
,
peye
);
D3DXVec3Normalize
(
&
vec
,
&
vec2
);
D3DXVec3Cross
(
&
right
,
pup
,
&
vec
);
D3DXVec3Cross
(
&
up
,
&
vec
,
&
right
);
D3DXVec3Normalize
(
&
rightn
,
&
right
);
D3DXVec3Normalize
(
&
upn
,
&
up
);
pout
->
m
[
0
][
0
]
=
-
rightn
.
x
;
pout
->
m
[
1
][
0
]
=
-
rightn
.
y
;
pout
->
m
[
2
][
0
]
=
-
rightn
.
z
;
pout
->
m
[
3
][
0
]
=
D3DXVec3Dot
(
&
rightn
,
peye
);
pout
->
m
[
0
][
1
]
=
upn
.
x
;
pout
->
m
[
1
][
1
]
=
upn
.
y
;
pout
->
m
[
2
][
1
]
=
upn
.
z
;
pout
->
m
[
3
][
1
]
=
-
D3DXVec3Dot
(
&
upn
,
peye
);
pout
->
m
[
0
][
2
]
=
-
vec
.
x
;
pout
->
m
[
1
][
2
]
=
-
vec
.
y
;
pout
->
m
[
2
][
2
]
=
-
vec
.
z
;
pout
->
m
[
3
][
2
]
=
D3DXVec3Dot
(
&
vec
,
peye
);
pout
->
m
[
0
][
3
]
=
0
.
0
f
;
pout
->
m
[
1
][
3
]
=
0
.
0
f
;
pout
->
m
[
2
][
3
]
=
0
.
0
f
;
pout
->
m
[
3
][
3
]
=
1
.
0
f
;
return
pout
;
}
D3DXMATRIX
*
WINAPI
D3DXMatrixMultiply
(
D3DXMATRIX
*
pout
,
CONST
D3DXMATRIX
*
pm1
,
CONST
D3DXMATRIX
*
pm2
)
{
int
i
,
j
;
...
...
dlls/d3dx8/tests/math.c
View file @
8d996a22
...
...
@@ -150,7 +150,7 @@ static void D3DXMatrixTest(void)
{
D3DXMATRIX
expectedmat
,
gotmat
,
mat
,
mat2
,
mat3
;
D3DXQUATERNION
q
;
D3DXVECTOR3
a
xis
;
D3DXVECTOR3
a
t
,
axis
,
eye
;
BOOL
expected
,
got
;
FLOAT
angle
,
expectedfloat
,
gotfloat
;
...
...
@@ -170,7 +170,9 @@ static void D3DXMatrixTest(void)
q
.
x
=
1
.
0
f
;
q
.
y
=
-
4
.
0
f
;
q
.
z
=
7
.
0
f
;
q
.
w
=
-
11
.
0
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
;
angle
=
D3DX_PI
/
3
.
0
f
;
...
...
@@ -196,6 +198,14 @@ static void D3DXMatrixTest(void)
got
=
D3DXMatrixIsIdentity
(
NULL
);
ok
(
expected
==
got
,
"Expected : %d, Got : %d
\n
"
,
expected
,
got
);
/*____________D3DXMatrixLookatRH_______________*/
expectedmat
.
m
[
0
][
0
]
=
0
.
822465
f
;
expectedmat
.
m
[
0
][
1
]
=
-
0
.
409489
f
;
expectedmat
.
m
[
0
][
2
]
=
0
.
394803
f
;
expectedmat
.
m
[
0
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
0
.
555856
f
;
expectedmat
.
m
[
1
][
1
]
=
0
.
431286
f
;
expectedmat
.
m
[
1
][
2
]
=
-
0
.
710645
f
;
expectedmat
.
m
[
1
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
2
][
0
]
=
0
.
120729
f
;
expectedmat
.
m
[
2
][
1
]
=
0
.
803935
f
;
expectedmat
.
m
[
2
][
2
]
=
0
.
582335
f
;
expectedmat
.
m
[
2
][
3
]
=
0
.
0
f
;
expectedmat
.
m
[
3
][
0
]
=
-
4
.
494634
f
;
expectedmat
.
m
[
3
][
1
]
=
0
.
809719
f
;
expectedmat
.
m
[
3
][
2
]
=
-
10
.
060076
f
;
expectedmat
.
m
[
3
][
3
]
=
1
.
0
f
;
D3DXMatrixLookAtRH
(
&
gotmat
,
&
eye
,
&
at
,
&
axis
);
expect_mat
(
expectedmat
,
gotmat
);
/*____________D3DXMatrixMultiply______________*/
expectedmat
.
m
[
0
][
0
]
=
73
.
0
f
;
expectedmat
.
m
[
0
][
1
]
=
193
.
0
f
;
expectedmat
.
m
[
0
][
2
]
=
-
197
.
0
f
;
expectedmat
.
m
[
0
][
3
]
=
-
77
.
0
f
;
expectedmat
.
m
[
1
][
0
]
=
231
.
0
f
;
expectedmat
.
m
[
1
][
1
]
=
551
.
0
f
;
expectedmat
.
m
[
1
][
2
]
=
-
489
.
0
f
;
expectedmat
.
m
[
1
][
3
]
=
-
169
.
0
;
...
...
include/d3dx8math.h
View file @
8d996a22
...
...
@@ -59,6 +59,7 @@ typedef struct D3DXCOLOR
}
D3DXCOLOR
,
*
LPD3DXCOLOR
;
FLOAT
WINAPI
D3DXMatrixfDeterminant
(
CONST
D3DXMATRIX
*
pm
);
D3DXMATRIX
*
WINAPI
D3DXMatrixLookAtRH
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR3
*
peye
,
CONST
D3DXVECTOR3
*
pat
,
CONST
D3DXVECTOR3
*
pup
);
D3DXMATRIX
*
WINAPI
D3DXMatrixMultiply
(
D3DXMATRIX
*
pout
,
CONST
D3DXMATRIX
*
pm1
,
CONST
D3DXMATRIX
*
pm2
);
D3DXMATRIX
*
WINAPI
D3DXMatrixRotationAxis
(
D3DXMATRIX
*
pout
,
CONST
D3DXVECTOR3
*
pv
,
FLOAT
angle
);
D3DXMATRIX
*
WINAPI
D3DXMatrixRotationQuaternion
(
D3DXMATRIX
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
...
...
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