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
c432b48a
Commit
c432b48a
authored
Nov 15, 2007
by
David Adam
Committed by
Alexandre Julliard
Nov 16, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXPlaneIntersectLine.
parent
8abfaa04
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
2 deletions
+38
-2
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+20
-0
math.c
dlls/d3dx8/tests/math.c
+16
-1
d3dx8math.h
include/d3dx8math.h
+1
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
c432b48a
...
...
@@ -62,7 +62,7 @@
@ stub D3DXQuaternionSquad
@ stub D3DXQuaternionBaryCentric
@ stdcall D3DXPlaneNormalize(ptr ptr)
@ st
ub D3DXPlaneIntersectLine
@ st
dcall D3DXPlaneIntersectLine(ptr ptr ptr ptr)
@ stub D3DXPlaneFromPointNormal
@ stub D3DXPlaneFromPoints
@ stub D3DXPlaneTransform
...
...
dlls/d3dx8/math.c
View file @
c432b48a
...
...
@@ -435,6 +435,26 @@ D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm)
/*_________________D3DXPLANE________________*/
D3DXVECTOR3
*
WINAPI
D3DXPlaneIntersectLine
(
D3DXVECTOR3
*
pout
,
CONST
D3DXPLANE
*
pp
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pv2
)
{
D3DXVECTOR3
direction
,
normal
;
FLOAT
dot
,
temp
;
normal
.
x
=
pp
->
a
;
normal
.
y
=
pp
->
b
;
normal
.
z
=
pp
->
c
;
direction
.
x
=
pv2
->
x
-
pv1
->
x
;
direction
.
y
=
pv2
->
y
-
pv1
->
y
;
direction
.
z
=
pv2
->
z
-
pv1
->
z
;
dot
=
D3DXVec3Dot
(
&
normal
,
&
direction
);
if
(
!
dot
)
return
NULL
;
temp
=
(
pp
->
d
+
D3DXVec3Dot
(
&
normal
,
pv1
)
)
/
dot
;
pout
->
x
=
pv1
->
x
-
temp
*
direction
.
x
;
pout
->
y
=
pv1
->
y
-
temp
*
direction
.
y
;
pout
->
z
=
pv1
->
z
-
temp
*
direction
.
z
;
return
pout
;
}
D3DXPLANE
*
WINAPI
D3DXPlaneNormalize
(
D3DXPLANE
*
pout
,
CONST
D3DXPLANE
*
pp
)
{
FLOAT
norm
;
...
...
dlls/d3dx8/tests/math.c
View file @
c432b48a
...
...
@@ -416,6 +416,8 @@ static void D3DXMatrixTest(void)
static
void
D3DXPlaneTest
(
void
)
{
D3DXPLANE
expectedplane
,
gotplane
,
nulplane
,
plane
;
D3DXVECTOR3
expectedvec
,
gotvec
,
vec1
,
vec2
;
LPD3DXVECTOR3
funcpointer
;
D3DXVECTOR4
vec
;
FLOAT
expected
,
got
;
...
...
@@ -455,7 +457,20 @@ static void D3DXPlaneTest(void)
got
=
D3DXPlaneDotNormal
(
NULL
,
NULL
),
ok
(
expected
==
got
,
"Expected : %f, Got : %f
\n
"
,
expected
,
got
);
/*_______________D3DXPlaneDotNormalize______________*/
/*_______________D3DXPlaneIntersectLine___________*/
vec1
.
x
=
9
.
0
f
;
vec1
.
y
=
6
.
0
f
;
vec1
.
z
=
3
.
0
f
;
vec2
.
x
=
2
.
0
f
;
vec2
.
y
=
5
.
0
f
;
vec2
.
z
=
8
.
0
f
;
expectedvec
.
x
=
20
.
0
f
/
3
.
0
f
;
expectedvec
.
y
=
17
.
0
f
/
3
.
0
f
;
expectedvec
.
z
=
14
.
0
f
/
3
.
0
f
;
D3DXPlaneIntersectLine
(
&
gotvec
,
&
plane
,
&
vec1
,
&
vec2
);
expect_vec3
(
expectedvec
,
gotvec
);
/* Test a parallele line */
vec1
.
x
=
11
.
0
f
;
vec1
.
y
=
13
.
0
f
;
vec1
.
z
=
15
.
0
f
;
vec2
.
x
=
17
.
0
f
;
vec2
.
y
=
31
.
0
f
;
vec2
.
z
=
24
.
0
f
;
expectedvec
.
x
=
20
.
0
f
/
3
.
0
f
;
expectedvec
.
y
=
17
.
0
f
/
3
.
0
f
;
expectedvec
.
z
=
14
.
0
f
/
3
.
0
f
;
funcpointer
=
D3DXPlaneIntersectLine
(
&
gotvec
,
&
plane
,
&
vec1
,
&
vec2
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXPlaneNormalize______________*/
expectedplane
.
a
=
-
3
.
0
f
/
sqrt
(
26
.
0
f
);
expectedplane
.
b
=
-
1
.
0
f
/
sqrt
(
26
.
0
f
);
expectedplane
.
c
=
4
.
0
f
/
sqrt
(
26
.
0
f
);
expectedplane
.
d
=
7
.
0
/
sqrt
(
26
.
0
f
);
D3DXPlaneNormalize
(
&
gotplane
,
&
plane
);
expect_plane
(
expectedplane
,
gotplane
);
...
...
include/d3dx8math.h
View file @
c432b48a
...
...
@@ -291,6 +291,7 @@ D3DXMATRIX* WINAPI D3DXMatrixScaling(D3DXMATRIX *pout, FLOAT sx, FLOAT sy, FLOAT
D3DXMATRIX
*
WINAPI
D3DXMatrixTranslation
(
D3DXMATRIX
*
pout
,
FLOAT
x
,
FLOAT
y
,
FLOAT
z
);
D3DXMATRIX
*
WINAPI
D3DXMatrixTranspose
(
D3DXMATRIX
*
pout
,
CONST
D3DXMATRIX
*
pm
);
D3DXVECTOR3
*
WINAPI
D3DXPlaneIntersectLine
(
D3DXVECTOR3
*
pout
,
CONST
D3DXPLANE
*
pp
,
CONST
D3DXVECTOR3
*
pv1
,
CONST
D3DXVECTOR3
*
pv2
);
D3DXPLANE
*
WINAPI
D3DXPlaneNormalize
(
D3DXPLANE
*
pout
,
CONST
D3DXPLANE
*
pp
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionNormalize
(
D3DXQUATERNION
*
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