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
cb954ca6
Commit
cb954ca6
authored
Nov 19, 2007
by
David Adam
Committed by
Alexandre Julliard
Nov 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXQuaternionSlerp.
parent
54e8d08e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
3 deletions
+30
-3
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+15
-0
math.c
dlls/d3dx8/tests/math.c
+13
-2
d3dx8math.h
include/d3dx8math.h
+1
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
cb954ca6
...
...
@@ -58,7 +58,7 @@
@ stdcall D3DXQuaternionInverse(ptr ptr)
@ stub D3DXQuaternionLn
@ stub D3DXQuaternionExp
@ st
ub D3DXQuaternionSlerp
@ st
dcall D3DXQuaternionSlerp(ptr ptr ptr long)
@ stub D3DXQuaternionSquad
@ stub D3DXQuaternionBaryCentric
@ stdcall D3DXPlaneNormalize(ptr ptr)
...
...
dlls/d3dx8/math.c
View file @
cb954ca6
...
...
@@ -635,6 +635,21 @@ D3DXQUATERNION* WINAPI D3DXQuaternionNormalize(D3DXQUATERNION *pout, CONST D3DXQ
}
return
pout
;
}
D3DXQUATERNION
*
WINAPI
D3DXQuaternionSlerp
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
,
FLOAT
t
)
{
FLOAT
dot
,
epsilon
;
epsilon
=
1
.
0
f
;
dot
=
D3DXQuaternionDot
(
pq1
,
pq2
);
if
(
dot
<
0
.
0
f
)
epsilon
=
-
1
.
0
f
;
pout
->
x
=
(
1
.
0
f
-
t
)
*
pq1
->
x
+
epsilon
*
t
*
pq2
->
x
;
pout
->
y
=
(
1
.
0
f
-
t
)
*
pq1
->
y
+
epsilon
*
t
*
pq2
->
y
;
pout
->
z
=
(
1
.
0
f
-
t
)
*
pq1
->
z
+
epsilon
*
t
*
pq2
->
z
;
pout
->
w
=
(
1
.
0
f
-
t
)
*
pq1
->
w
+
epsilon
*
t
*
pq2
->
w
;
return
pout
;
}
/*_________________D3DXVec2_____________________*/
D3DXVECTOR2
*
WINAPI
D3DXVec2BaryCentric
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
,
CONST
D3DXVECTOR2
*
pv3
,
FLOAT
f
,
FLOAT
g
)
...
...
dlls/d3dx8/tests/math.c
View file @
cb954ca6
...
...
@@ -552,14 +552,17 @@ static void D3DXPlaneTest(void)
static
void
D3X8QuaternionTest
(
void
)
{
D3DXQUATERNION
expectedquat
,
gotquat
,
nul
,
q
,
r
,
s
;
D3DXQUATERNION
expectedquat
,
gotquat
,
nul
,
q
,
r
,
s
,
t
;
LPD3DXQUATERNION
funcpointer
;
FLOAT
expected
,
got
;
FLOAT
expected
,
got
,
scale
;
BOOL
expectedbool
,
gotbool
;
nul
.
x
=
0
.
0
f
;
nul
.
y
=
0
.
0
f
;
nul
.
z
=
0
.
0
f
;
nul
.
w
=
0
.
0
f
;
q
.
x
=
1
.
0
f
,
q
.
y
=
2
.
0
f
;
q
.
z
=
4
.
0
f
;
q
.
w
=
10
.
0
f
;
r
.
x
=
-
3
.
0
f
;
r
.
y
=
4
.
0
f
;
r
.
z
=
-
5
.
0
f
;
r
.
w
=
7
.
0
;
t
.
x
=
-
1111
.
0
f
,
t
.
y
=
111
.
0
f
;
t
.
z
=
-
11
.
0
f
;
t
.
w
=
1
.
0
f
;
scale
=
0
.
3
f
;
/*_______________D3DXQuaternionConjugate________________*/
expectedquat
.
x
=
-
1
.
0
f
;
expectedquat
.
y
=
-
2
.
0
f
;
expectedquat
.
z
=
-
4
.
0
f
;
expectedquat
.
w
=
10
.
0
f
;
...
...
@@ -644,6 +647,14 @@ static void D3X8QuaternionTest(void)
expectedquat
.
x
=
0
.
0
f
;
expectedquat
.
y
=
0
.
0
f
;
expectedquat
.
z
=
0
.
0
f
;
expectedquat
.
w
=
0
.
0
f
;
D3DXQuaternionNormalize
(
&
gotquat
,
&
nul
);
expect_vec4
(
expectedquat
,
gotquat
);
/*_______________D3DXQuaternionSlerp________________________*/
expectedquat
.
x
=
-
0
.
2
f
;
expectedquat
.
y
=
2
.
6
f
;
expectedquat
.
z
=
1
.
3
f
;
expectedquat
.
w
=
9
.
1
f
;
D3DXQuaternionSlerp
(
&
gotquat
,
&
q
,
&
r
,
scale
);
expect_vec4
(
expectedquat
,
gotquat
);
expectedquat
.
x
=
334
.
0
f
;
expectedquat
.
y
=
-
31
.
9
f
;
expectedquat
.
z
=
6
.
1
f
;
expectedquat
.
w
=
6
.
7
f
;
D3DXQuaternionSlerp
(
&
gotquat
,
&
q
,
&
t
,
scale
);
expect_vec4
(
expectedquat
,
gotquat
);
}
static
void
D3X8Vector2Test
(
void
)
...
...
include/d3dx8math.h
View file @
cb954ca6
...
...
@@ -305,6 +305,7 @@ D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, C
D3DXQUATERNION
*
WINAPI
D3DXQuaternionInverse
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionMultiply
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionNormalize
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionSlerp
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
,
FLOAT
t
);
D3DXVECTOR2
*
WINAPI
D3DXVec2BaryCentric
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
,
CONST
D3DXVECTOR2
*
pv3
,
FLOAT
f
,
FLOAT
g
);
D3DXVECTOR2
*
WINAPI
D3DXVec2CatmullRom
(
D3DXVECTOR2
*
pout
,
CONST
D3DXVECTOR2
*
pv0
,
CONST
D3DXVECTOR2
*
pv1
,
CONST
D3DXVECTOR2
*
pv2
,
CONST
D3DXVECTOR2
*
pv3
,
FLOAT
s
);
...
...
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