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
10259cd8
Commit
10259cd8
authored
Oct 23, 2007
by
David Adam
Committed by
Alexandre Julliard
Oct 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXPlaneDot.
parent
74c5d175
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
math.c
dlls/d3dx8/tests/math.c
+22
-0
d3dx8math.inl
include/d3dx8math.inl
+8
-0
No files found.
dlls/d3dx8/tests/math.c
View file @
10259cd8
...
...
@@ -30,6 +30,27 @@
#define expect_vec4(expectedvec,gotvec) ok((fabs(expectedvec.x-gotvec.x)<admitted_error)&&(fabs(expectedvec.y-gotvec.y)<admitted_error)&&(fabs(expectedvec.z-gotvec.z)<admitted_error)&&(fabs(expectedvec.w-gotvec.w)<admitted_error),"Expected Vector= (%f, %f, %f, %f)\n , Got Vector= (%f, %f, %f, %f)\n", expectedvec.x, expectedvec.y, expectedvec.z, expectedvec.w, gotvec.x, gotvec.y, gotvec.z, gotvec.w);
static
void
D3DXPlaneTest
(
void
)
{
D3DXPLANE
plane
;
D3DXVECTOR4
vec
;
FLOAT
expected
,
got
;
plane
.
a
=
-
3
.
0
f
;
plane
.
b
=
-
1
.
0
f
;
plane
.
c
=
4
.
0
f
;
plane
.
d
=
7
.
0
f
;
vec
.
x
=
2
.
0
f
;
vec
.
y
=
5
.
0
f
;
vec
.
z
=
-
6
.
0
f
;
vec
.
w
=
11
.
0
f
;
/*_______________D3DXPlaneDot________________*/
expected
=
42
.
0
f
;
got
=
D3DXPlaneDot
(
&
plane
,
&
vec
),
ok
(
expected
==
got
,
"Expected : %f, Got : %f
\n
"
,
expected
,
got
);
expected
=
0
.
0
f
;
got
=
D3DXPlaneDot
(
NULL
,
&
vec
),
ok
(
expected
==
got
,
"Expected : %f, Got : %f
\n
"
,
expected
,
got
);
expected
=
0
.
0
f
;
got
=
D3DXPlaneDot
(
NULL
,
NULL
),
ok
(
expected
==
got
,
"Expected : %f, Got : %f
\n
"
,
expected
,
got
);
}
static
void
D3X8QuaternionTest
(
void
)
{
D3DXQUATERNION
expectedquat
,
gotquat
,
q
,
r
,
s
;
...
...
@@ -430,6 +451,7 @@ static void D3X8Vector4Test(void)
START_TEST
(
math
)
{
D3DXPlaneTest
();
D3X8QuaternionTest
();
D3X8Vector2Test
();
D3X8Vector3Test
();
...
...
include/d3dx8math.inl
View file @
10259cd8
...
...
@@ -258,6 +258,14 @@ static inline D3DXVECTOR4* D3DXVec4Subtract(D3DXVECTOR4 *pout, CONST D3DXVECTOR4
/*__________________D3DXQUATERNION____________________*/
static inline FLOAT D3DXPlaneDot( CONST D3DXPLANE *pp, CONST D3DXVECTOR4 *pv)
{
if ( !pp || !pv ) return 0.0f;
return ( (pp->a) * (pv->x) + (pp->b) * (pv->y) + (pp->c) * (pv->z) + (pp->d) * (pv->w) );
}
/*__________________D3DXQUATERNION____________________*/
static inline D3DXQUATERNION* D3DXQuaternionConjugate(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq)
{
if ( !pout || !pq) return NULL;
...
...
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