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
23478625
Commit
23478625
authored
Feb 14, 2009
by
David Adam
Committed by
Alexandre Julliard
Feb 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement the spherical interpolation part for D3DXQuaternionSlerp.
parent
687ce938
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
8 deletions
+25
-8
math.c
dlls/d3dx8/math.c
+18
-6
math.c
dlls/d3dx8/tests/math.c
+7
-2
No files found.
dlls/d3dx8/math.c
View file @
23478625
...
...
@@ -1173,15 +1173,27 @@ D3DXQUATERNION* WINAPI D3DXQuaternionRotationYawPitchRoll(D3DXQUATERNION *pout,
D3DXQUATERNION
*
WINAPI
D3DXQuaternionSlerp
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
,
FLOAT
t
)
{
FLOAT
dot
,
epsilon
;
FLOAT
dot
,
epsilon
,
temp
,
theta
,
u
;
epsilon
=
1
.
0
f
;
temp
=
1
.
0
f
-
t
;
u
=
t
;
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
;
if
(
dot
<
0
.
0
f
)
{
epsilon
=
-
1
.
0
f
;
dot
=
-
dot
;
}
if
(
1
.
0
f
-
dot
>
0
.
001
f
)
{
theta
=
acos
(
dot
);
temp
=
sin
(
theta
*
temp
)
/
sin
(
theta
);
u
=
sin
(
theta
*
u
)
/
sin
(
theta
);
}
pout
->
x
=
temp
*
pq1
->
x
+
epsilon
*
u
*
pq2
->
x
;
pout
->
y
=
temp
*
pq1
->
y
+
epsilon
*
u
*
pq2
->
y
;
pout
->
z
=
temp
*
pq1
->
z
+
epsilon
*
u
*
pq2
->
z
;
pout
->
w
=
temp
*
pq1
->
w
+
epsilon
*
u
*
pq2
->
w
;
return
pout
;
}
...
...
dlls/d3dx8/tests/math.c
View file @
23478625
...
...
@@ -582,7 +582,7 @@ static void D3DXPlaneTest(void)
static
void
D3X8QuaternionTest
(
void
)
{
D3DXMATRIX
mat
;
D3DXQUATERNION
expectedquat
,
gotquat
,
Nq
,
Nq1
,
nul
,
q
,
r
,
s
,
t
,
u
;
D3DXQUATERNION
expectedquat
,
gotquat
,
Nq
,
Nq1
,
nul
,
smallq
,
smallr
,
q
,
r
,
s
,
t
,
u
;
LPD3DXQUATERNION
funcpointer
;
D3DXVECTOR3
axis
,
expectedvec
;
FLOAT
angle
,
expected
,
got
,
scale
,
scale2
;
...
...
@@ -591,8 +591,10 @@ static void D3X8QuaternionTest(void)
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
;
t
.
x
=
-
1111
.
0
f
,
t
.
y
=
111
.
0
f
;
t
.
z
=
-
11
.
0
f
;
t
.
w
=
1
.
0
f
;
u
.
x
=
91
.
0
f
;
u
.
y
=
-
82
.
0
f
;
u
.
z
=
7
.
3
f
;
u
.
w
=
-
6
.
4
f
;
smallq
.
x
=
0
.
1
f
;
smallq
.
y
=
0
.
2
f
;
smallq
.
z
=
0
.
3
f
;
smallq
.
w
=
0
.
4
f
;
smallr
.
x
=
0
.
5
f
;
smallr
.
y
=
0
.
6
f
;
smallr
.
z
=
0
.
7
f
;
smallq
.
w
=
0
.
8
f
;
scale
=
0
.
3
f
;
scale2
=
0
.
78
f
;
...
...
@@ -873,6 +875,9 @@ static void D3X8QuaternionTest(void)
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
);
expectedquat
.
x
=
0
.
267071
f
;
expectedquat
.
y
=
0
.
384114
f
;
expectedquat
.
z
=
0
.
501157
f
;
expectedquat
.
w
=
0
.
636291
f
;
D3DXQuaternionSlerp
(
&
gotquat
,
&
smallq
,
&
smallr
,
scale
);
expect_vec4
(
expectedquat
,
gotquat
);
/*_______________D3DXQuaternionSquad________________________*/
expectedquat
.
x
=
-
156
.
296
f
;
expectedquat
.
y
=
30
.
242
f
;
expectedquat
.
z
=
-
2
.
5022
f
;
expectedquat
.
w
=
7
.
3576
f
;
...
...
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