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
8abfaa04
Commit
8abfaa04
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 D3DXPlaneNormalize.
parent
d1a30258
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
2 deletions
+43
-2
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+24
-0
math.c
dlls/d3dx8/tests/math.c
+16
-1
d3dx8math.h
include/d3dx8math.h
+2
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
8abfaa04
...
...
@@ -61,7 +61,7 @@
@ stub D3DXQuaternionSlerp
@ stub D3DXQuaternionSquad
@ stub D3DXQuaternionBaryCentric
@ st
ub D3DXPlaneNormalize
@ st
dcall D3DXPlaneNormalize(ptr ptr)
@ stub D3DXPlaneIntersectLine
@ stub D3DXPlaneFromPointNormal
@ stub D3DXPlaneFromPoints
...
...
dlls/d3dx8/math.c
View file @
8abfaa04
...
...
@@ -433,6 +433,30 @@ D3DXMATRIX* WINAPI D3DXMatrixTranspose(D3DXMATRIX *pout, CONST D3DXMATRIX *pm)
return
pout
;
}
/*_________________D3DXPLANE________________*/
D3DXPLANE
*
WINAPI
D3DXPlaneNormalize
(
D3DXPLANE
*
pout
,
CONST
D3DXPLANE
*
pp
)
{
FLOAT
norm
;
norm
=
sqrt
(
pp
->
a
*
pp
->
a
+
pp
->
b
*
pp
->
b
+
pp
->
c
*
pp
->
c
);
if
(
norm
)
{
pout
->
a
=
pp
->
a
/
norm
;
pout
->
b
=
pp
->
b
/
norm
;
pout
->
c
=
pp
->
c
/
norm
;
pout
->
d
=
pp
->
d
/
norm
;
}
else
{
pout
->
a
=
0
.
0
f
;
pout
->
b
=
0
.
0
f
;
pout
->
c
=
0
.
0
f
;
pout
->
d
=
0
.
0
f
;
}
return
pout
;
}
/*_________________D3DXQUATERNION________________*/
D3DXQUATERNION
*
WINAPI
D3DXQuaternionNormalize
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
)
...
...
dlls/d3dx8/tests/math.c
View file @
8abfaa04
...
...
@@ -50,6 +50,8 @@
U(gotmat).m[3][0],U(gotmat).m[3][1],U(gotmat).m[3][2],U(gotmat).m[3][3]); \
}
#define expect_plane(expectedplane,gotplane) ok((fabs(expectedplane.a-gotplane.a)<admitted_error)&&(fabs(expectedplane.b-gotplane.b)<admitted_error)&&(fabs(expectedplane.c-gotplane.c)<admitted_error)&&(fabs(expectedplane.d-gotplane.d)<admitted_error),"Expected Plane= (%f, %f, %f, %f)\n , Got Plane= (%f, %f, %f, %f)\n", expectedplane.a, expectedplane.b, expectedplane.c, expectedplane.d, gotplane.a, gotplane.b, gotplane.c, gotplane.d);
#define expect_vec(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error),"Expected Vector= (%f, %f)\n , Got Vector= (%f, %f)\n", expectedvec.x, expectedvec.y, gotvec.x, gotvec.y);
#define expect_vec3(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error)&&(fabs(expectedvec.z-gotvec.z)<admitted_error),"Expected Vector= (%f, %f, %f)\n , Got Vector= (%f, %f, %f)\n", expectedvec.x, expectedvec.y, expectedvec.z, gotvec.x, gotvec.y, gotvec.z);
...
...
@@ -413,7 +415,7 @@ static void D3DXMatrixTest(void)
static
void
D3DXPlaneTest
(
void
)
{
D3DXPLANE
plane
;
D3DXPLANE
expectedplane
,
gotplane
,
nulplane
,
plane
;
D3DXVECTOR4
vec
;
FLOAT
expected
,
got
;
...
...
@@ -452,6 +454,19 @@ static void D3DXPlaneTest(void)
expected
=
0
.
0
f
;
got
=
D3DXPlaneDotNormal
(
NULL
,
NULL
),
ok
(
expected
==
got
,
"Expected : %f, Got : %f
\n
"
,
expected
,
got
);
/*_______________D3DXPlaneDotNormalize______________*/
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
);
nulplane
.
a
=
0
.
0
;
nulplane
.
b
=
0
.
0
f
,
nulplane
.
c
=
0
.
0
f
;
nulplane
.
d
=
0
.
0
f
;
expectedplane
.
a
=
0
.
0
f
;
expectedplane
.
b
=
0
.
0
f
;
expectedplane
.
c
=
0
.
0
f
;
expectedplane
.
d
=
0
.
0
f
;
D3DXPlaneNormalize
(
&
gotplane
,
&
nulplane
);
expect_plane
(
expectedplane
,
gotplane
);
nulplane
.
a
=
0
.
0
;
nulplane
.
b
=
0
.
0
f
,
nulplane
.
c
=
0
.
0
f
;
nulplane
.
d
=
4
.
3
f
;
expectedplane
.
a
=
0
.
0
f
;
expectedplane
.
b
=
0
.
0
f
;
expectedplane
.
c
=
0
.
0
f
;
expectedplane
.
d
=
0
.
0
f
;
D3DXPlaneNormalize
(
&
gotplane
,
&
nulplane
);
expect_plane
(
expectedplane
,
gotplane
);
}
static
void
D3X8QuaternionTest
(
void
)
...
...
include/d3dx8math.h
View file @
8abfaa04
...
...
@@ -291,6 +291,8 @@ 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
);
D3DXPLANE
*
WINAPI
D3DXPlaneNormalize
(
D3DXPLANE
*
pout
,
CONST
D3DXPLANE
*
pp
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionNormalize
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
D3DXVECTOR2
*
WINAPI
D3DXVec2BaryCentric
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
,
CONST
D3DXVECTOR2
*
pv3
,
FLOAT
f
,
FLOAT
g
);
...
...
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