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
b8eb4cf8
Commit
b8eb4cf8
authored
Feb 03, 2009
by
David Adam
Committed by
Alexandre Julliard
Feb 03, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXIntersectTri.
parent
5bef4520
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
106 additions
and
1 deletion
+106
-1
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-0
mesh.c
dlls/d3dx8/mesh.c
+42
-0
mesh.c
dlls/d3dx8/tests/mesh.c
+61
-0
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
d3dx8mesh.h
include/d3dx8mesh.h
+1
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
b8eb4cf8
...
...
@@ -109,6 +109,7 @@
@ stub D3DXFVFFromDeclarator
@ stub D3DXWeldVertices
@ stub D3DXIntersect
@ cdecl D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr)
@ stdcall D3DXSphereBoundProbe(ptr long ptr ptr)
@ stdcall D3DXBoxBoundProbe(ptr ptr ptr ptr)
@ stub D3DXCreatePolygon
...
...
dlls/d3dx8/mesh.c
View file @
b8eb4cf8
...
...
@@ -90,6 +90,48 @@ done we've got an intersection of the ray with the box.
return
TRUE
;
}
BOOL
CDECL
D3DXIntersectTri
(
CONST
D3DXVECTOR3
*
p0
,
CONST
D3DXVECTOR3
*
p1
,
CONST
D3DXVECTOR3
*
p2
,
CONST
D3DXVECTOR3
*
praypos
,
CONST
D3DXVECTOR3
*
praydir
,
FLOAT
*
pu
,
FLOAT
*
pv
,
FLOAT
*
pdist
)
{
D3DXMATRIX
m
;
D3DXVECTOR4
vec
;
m
.
m
[
0
][
0
]
=
p1
->
x
-
p0
->
x
;
m
.
m
[
1
][
0
]
=
p2
->
x
-
p0
->
x
;
m
.
m
[
2
][
0
]
=
-
praydir
->
x
;
m
.
m
[
3
][
0
]
=
0
.
0
f
;
m
.
m
[
0
][
1
]
=
p1
->
y
-
p0
->
z
;
m
.
m
[
1
][
1
]
=
p2
->
y
-
p0
->
z
;
m
.
m
[
2
][
1
]
=
-
praydir
->
y
;
m
.
m
[
3
][
1
]
=
0
.
0
f
;
m
.
m
[
0
][
2
]
=
p1
->
z
-
p0
->
z
;
m
.
m
[
1
][
2
]
=
p2
->
z
-
p0
->
z
;
m
.
m
[
2
][
2
]
=
-
praydir
->
z
;
m
.
m
[
3
][
2
]
=
0
.
0
f
;
m
.
m
[
0
][
3
]
=
0
.
0
f
;
m
.
m
[
1
][
3
]
=
0
.
0
f
;
m
.
m
[
2
][
3
]
=
0
.
0
f
;
m
.
m
[
3
][
3
]
=
1
.
0
f
;
vec
.
x
=
praypos
->
x
-
p0
->
x
;
vec
.
y
=
praypos
->
y
-
p0
->
y
;
vec
.
z
=
praypos
->
z
-
p0
->
z
;
vec
.
w
=
0
.
0
f
;
if
(
D3DXMatrixInverse
(
&
m
,
NULL
,
&
m
)
)
{
D3DXVec4Transform
(
&
vec
,
&
vec
,
&
m
);
if
(
(
vec
.
x
>=
0
.
0
f
)
&&
(
vec
.
y
>=
0
.
0
f
)
&&
(
vec
.
x
+
vec
.
y
<=
1
.
0
f
)
&&
(
vec
.
z
>=
0
.
0
f
)
)
{
*
pu
=
vec
.
x
;
*
pv
=
vec
.
y
;
*
pdist
=
fabs
(
vec
.
z
);
return
TRUE
;
}
}
return
FALSE
;
}
BOOL
WINAPI
D3DXSphereBoundProbe
(
CONST
D3DXVECTOR3
*
pcenter
,
FLOAT
radius
,
CONST
D3DXVECTOR3
*
prayposition
,
CONST
D3DXVECTOR3
*
praydirection
)
{
D3DXVECTOR3
difference
;
...
...
dlls/d3dx8/tests/mesh.c
View file @
b8eb4cf8
...
...
@@ -20,6 +20,13 @@
#include "wine/test.h"
#define admitted_error 0.0001f
BOOL
compare
(
FLOAT
u
,
FLOAT
v
)
{
return
(
fabs
(
u
-
v
)
<
admitted_error
);
}
static
void
D3DXBoundProbeTest
(
void
)
{
BOOL
result
;
...
...
@@ -94,7 +101,61 @@ static void D3DXBoundProbeTest(void)
ok
(
result
==
FALSE
,
"expected FALSE, received TRUE
\n
"
);
}
static
void
D3DXIntersectTriTest
(
void
)
{
BOOL
exp_res
,
got_res
;
D3DXVECTOR3
position
,
ray
,
vertex
[
3
];
FLOAT
exp_dist
,
got_dist
,
exp_u
,
got_u
,
exp_v
,
got_v
;
vertex
[
0
].
x
=
1
.
0
f
;
vertex
[
0
].
y
=
0
.
0
f
;
vertex
[
0
].
z
=
0
.
0
f
;
vertex
[
1
].
x
=
2
.
0
f
;
vertex
[
1
].
y
=
0
.
0
f
;
vertex
[
1
].
z
=
0
.
0
f
;
vertex
[
2
].
x
=
1
.
0
f
;
vertex
[
2
].
y
=
1
.
0
f
;
vertex
[
2
].
z
=
0
.
0
f
;
position
.
x
=
-
14
.
5
f
;
position
.
y
=
-
23
.
75
f
;
position
.
z
=
-
32
.
0
f
;
ray
.
x
=
2
.
0
f
;
ray
.
y
=
3
.
0
f
;
ray
.
z
=
4
.
0
f
;
exp_res
=
TRUE
;
exp_u
=
0
.
5
f
;
exp_v
=
0
.
25
f
;
exp_dist
=
8
.
0
f
;
got_res
=
D3DXIntersectTri
(
&
vertex
[
0
],
&
vertex
[
1
],
&
vertex
[
2
],
&
position
,
&
ray
,
&
got_u
,
&
got_v
,
&
got_dist
);
ok
(
got_res
==
exp_res
,
"Expected result = %d, got %d
\n
"
,
exp_res
,
got_res
);
ok
(
compare
(
exp_u
,
got_u
),
"Expected u = %f, got %f
\n
"
,
exp_u
,
got_u
);
ok
(
compare
(
exp_v
,
got_v
),
"Expected v = %f, got %f
\n
"
,
exp_v
,
got_v
);
ok
(
compare
(
exp_dist
,
got_dist
),
"Expected distance = %f, got %f
\n
"
,
exp_dist
,
got_dist
);
/*Only positive ray is taken in account*/
vertex
[
0
].
x
=
1
.
0
f
;
vertex
[
0
].
y
=
0
.
0
f
;
vertex
[
0
].
z
=
0
.
0
f
;
vertex
[
1
].
x
=
2
.
0
f
;
vertex
[
1
].
y
=
0
.
0
f
;
vertex
[
1
].
z
=
0
.
0
f
;
vertex
[
2
].
x
=
1
.
0
f
;
vertex
[
2
].
y
=
1
.
0
f
;
vertex
[
2
].
z
=
0
.
0
f
;
position
.
x
=
17
.
5
f
;
position
.
y
=
24
.
25
f
;
position
.
z
=
32
.
0
f
;
ray
.
x
=
2
.
0
f
;
ray
.
y
=
3
.
0
f
;
ray
.
z
=
4
.
0
f
;
exp_res
=
FALSE
;
got_res
=
D3DXIntersectTri
(
&
vertex
[
0
],
&
vertex
[
1
],
&
vertex
[
2
],
&
position
,
&
ray
,
&
got_u
,
&
got_v
,
&
got_dist
);
ok
(
got_res
==
exp_res
,
"Expected result = %d, got %d
\n
"
,
exp_res
,
got_res
);
/*Intersection between ray and triangle in a same plane is considered as empty*/
vertex
[
0
].
x
=
4
.
0
f
;
vertex
[
0
].
y
=
0
.
0
f
;
vertex
[
0
].
z
=
0
.
0
f
;
vertex
[
1
].
x
=
6
.
0
f
;
vertex
[
1
].
y
=
0
.
0
f
;
vertex
[
1
].
z
=
0
.
0
f
;
vertex
[
2
].
x
=
4
.
0
f
;
vertex
[
2
].
y
=
2
.
0
f
;
vertex
[
2
].
z
=
0
.
0
f
;
position
.
x
=
1
.
0
f
;
position
.
y
=
1
.
0
f
;
position
.
z
=
0
.
0
f
;
ray
.
x
=
1
.
0
f
;
ray
.
y
=
0
.
0
f
;
ray
.
z
=
0
.
0
f
;
exp_res
=
FALSE
;
got_res
=
D3DXIntersectTri
(
&
vertex
[
0
],
&
vertex
[
1
],
&
vertex
[
2
],
&
position
,
&
ray
,
&
got_u
,
&
got_v
,
&
got_dist
);
ok
(
got_res
==
exp_res
,
"Expected result = %d, got %d
\n
"
,
exp_res
,
got_res
);
}
START_TEST
(
mesh
)
{
D3DXBoundProbeTest
();
D3DXIntersectTriTest
();
}
dlls/d3dx9_36/d3dx9_36.spec
View file @
b8eb4cf8
...
...
@@ -167,7 +167,7 @@
@ stdcall D3DXGetVertexShaderProfile(ptr)
@ stdcall D3DXIntersect(ptr ptr ptr ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXIntersect
@ stdcall D3DXIntersectSubset(ptr long ptr ptr ptr ptr ptr ptr ptr ptr ptr) d3dx8.D3DXIntersectSubset
@ st
dcall D3DXIntersectTri(ptr ptr ptr ptr ptr ptr ptr ptr) d3dx8.
D3DXIntersectTri
@ st
ub
D3DXIntersectTri
@ stub D3DXLoadMeshFromXA
@ stub D3DXLoadMeshFromXInMemory
@ stub D3DXLoadMeshFromXResource
...
...
include/d3dx8mesh.h
View file @
b8eb4cf8
...
...
@@ -30,6 +30,7 @@ HRESULT WINAPI D3DXCreateBuffer(DWORD,LPD3DXBUFFER*);
UINT
WINAPI
D3DXGetFVFVertexSize
(
DWORD
);
BOOL
WINAPI
D3DXBoxBoundProbe
(
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
);
BOOL
WINAPI
D3DXSphereBoundProbe
(
CONST
D3DXVECTOR3
*
,
FLOAT
,
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
);
BOOL
CDECL
D3DXIntersectTri
(
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
,
CONST
D3DXVECTOR3
*
,
FLOAT
*
,
FLOAT
*
,
FLOAT
*
);
#ifdef __cplusplus
}
...
...
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