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
ed7c2835
Commit
ed7c2835
authored
Jun 14, 2012
by
Nozomi Kodama
Committed by
Alexandre Julliard
Jun 14, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9_36: Implementation of D3DXQuaternionSquadSetup.
parent
ac38e69a
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
111 additions
and
1 deletion
+111
-1
d3dx9_36.spec
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
math.c
dlls/d3dx9_36/math.c
+67
-0
math.c
dlls/d3dx9_36/tests/math.c
+42
-0
d3dx9math.h
include/d3dx9math.h
+1
-0
No files found.
dlls/d3dx9_36/d3dx9_36.spec
View file @
ed7c2835
...
...
@@ -252,7 +252,7 @@
@ stdcall D3DXQuaternionRotationYawPitchRoll(ptr float float float)
@ stdcall D3DXQuaternionSlerp(ptr ptr ptr float)
@ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr float)
@ st
ub
D3DXQuaternionSquadSetup(ptr ptr ptr ptr ptr ptr ptr)
@ st
dcall
D3DXQuaternionSquadSetup(ptr ptr ptr ptr ptr ptr ptr)
@ stdcall D3DXQuaternionToAxisAngle(ptr ptr ptr)
@ stub D3DXRectPatchSize(ptr ptr ptr)
@ stub D3DXSaveMeshHierarchyToFileA(ptr long ptr ptr ptr)
...
...
dlls/d3dx9_36/math.c
View file @
ed7c2835
...
...
@@ -1366,6 +1366,73 @@ D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATE
return
pout
;
}
static
D3DXQUATERNION
add_diff
(
CONST
D3DXQUATERNION
*
q1
,
CONST
D3DXQUATERNION
*
q2
,
CONST
FLOAT
add
)
{
D3DXQUATERNION
temp
;
temp
.
x
=
q1
->
x
+
add
*
q2
->
x
;
temp
.
y
=
q1
->
y
+
add
*
q2
->
y
;
temp
.
z
=
q1
->
z
+
add
*
q2
->
z
;
temp
.
w
=
q1
->
w
+
add
*
q2
->
w
;
return
temp
;
}
void
WINAPI
D3DXQuaternionSquadSetup
(
D3DXQUATERNION
*
paout
,
D3DXQUATERNION
*
pbout
,
D3DXQUATERNION
*
pcout
,
CONST
D3DXQUATERNION
*
pq0
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
,
CONST
D3DXQUATERNION
*
pq3
)
{
D3DXQUATERNION
q
,
temp1
,
temp2
,
temp3
,
zero
;
TRACE
(
"(%p, %p, %p, %p, %p, %p, %p)
\n
"
,
paout
,
pbout
,
pcout
,
pq0
,
pq1
,
pq2
,
pq3
);
zero
.
x
=
0
.
0
f
;
zero
.
y
=
0
.
0
f
;
zero
.
z
=
0
.
0
f
;
zero
.
w
=
0
.
0
f
;
if
(
D3DXQuaternionDot
(
pq0
,
pq1
)
<
0
.
0
f
)
temp2
=
add_diff
(
&
zero
,
pq0
,
-
1
.
0
f
);
else
temp2
=
*
pq0
;
if
(
D3DXQuaternionDot
(
pq1
,
pq2
)
<
0
.
0
f
)
*
pcout
=
add_diff
(
&
zero
,
pq2
,
-
1
.
0
f
);
else
*
pcout
=
*
pq2
;
if
(
D3DXQuaternionDot
(
pcout
,
pq3
)
<
0
.
0
f
)
temp3
=
add_diff
(
&
zero
,
pq3
,
-
1
.
0
f
);
else
temp3
=
*
pq3
;
D3DXQuaternionInverse
(
&
temp1
,
pq1
);
D3DXQuaternionMultiply
(
&
temp2
,
&
temp1
,
&
temp2
);
D3DXQuaternionLn
(
&
temp2
,
&
temp2
);
D3DXQuaternionMultiply
(
&
q
,
&
temp1
,
pcout
);
D3DXQuaternionLn
(
&
q
,
&
q
);
temp1
=
add_diff
(
&
temp2
,
&
q
,
1
.
0
f
);
temp1
.
x
*=
-
0
.
25
f
;
temp1
.
y
*=
-
0
.
25
f
;
temp1
.
z
*=
-
0
.
25
f
;
temp1
.
w
*=
-
0
.
25
f
;
D3DXQuaternionExp
(
&
temp1
,
&
temp1
);
D3DXQuaternionMultiply
(
paout
,
pq1
,
&
temp1
);
D3DXQuaternionInverse
(
&
temp1
,
pcout
);
D3DXQuaternionMultiply
(
&
temp2
,
&
temp1
,
pq1
);
D3DXQuaternionLn
(
&
temp2
,
&
temp2
);
D3DXQuaternionMultiply
(
&
q
,
&
temp1
,
&
temp3
);
D3DXQuaternionLn
(
&
q
,
&
q
);
temp1
=
add_diff
(
&
temp2
,
&
q
,
1
.
0
f
);
temp1
.
x
*=
-
0
.
25
f
;
temp1
.
y
*=
-
0
.
25
f
;
temp1
.
z
*=
-
0
.
25
f
;
temp1
.
w
*=
-
0
.
25
f
;
D3DXQuaternionExp
(
&
temp1
,
&
temp1
);
D3DXQuaternionMultiply
(
pbout
,
pcout
,
&
temp1
);
return
;
}
void
WINAPI
D3DXQuaternionToAxisAngle
(
CONST
D3DXQUATERNION
*
pq
,
D3DXVECTOR3
*
paxis
,
FLOAT
*
pangle
)
{
paxis
->
x
=
pq
->
x
;
...
...
dlls/d3dx9_36/tests/math.c
View file @
ed7c2835
...
...
@@ -940,6 +940,48 @@ static void D3DXQuaternionTest(void)
D3DXQuaternionSquad
(
&
gotquat
,
&
q
,
&
r
,
&
t
,
&
u
,
scale
);
expect_vec4
(
expectedquat
,
gotquat
);
/*_______________D3DXQuaternionSquadSetup___________________*/
r
.
x
=
1
.
0
f
,
r
.
y
=
2
.
0
f
;
r
.
z
=
4
.
0
f
;
r
.
w
=
10
.
0
f
;
s
.
x
=
-
3
.
0
f
;
s
.
y
=
4
.
0
f
;
s
.
z
=
-
5
.
0
f
;
s
.
w
=
7
.
0
;
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
;
D3DXQuaternionSquadSetup
(
&
gotquat
,
&
Nq
,
&
Nq1
,
&
r
,
&
s
,
&
t
,
&
u
);
expectedquat
.
x
=
7
.
121285
f
;
expectedquat
.
y
=
2
.
159964
f
;
expectedquat
.
z
=
-
3
.
855094
f
;
expectedquat
.
w
=
5
.
362844
f
;
expect_vec4
(
expectedquat
,
gotquat
);
expectedquat
.
x
=
-
1113
.
492920
f
;
expectedquat
.
y
=
82
.
679260
f
;
expectedquat
.
z
=
-
6
.
696645
f
;
expectedquat
.
w
=
-
4
.
090050
f
;
expect_vec4
(
expectedquat
,
Nq
);
expectedquat
.
x
=
-
1111
.
0
f
;
expectedquat
.
y
=
111
.
0
f
;
expectedquat
.
z
=
-
11
.
0
f
;
expectedquat
.
w
=
1
.
0
f
;
expect_vec4
(
expectedquat
,
Nq1
);
r
.
x
=
0
.
2
f
;
r
.
y
=
0
.
3
f
;
r
.
z
=
1
.
3
f
;
r
.
w
=
-
0
.
6
f
;
s
.
x
=
-
3
.
0
f
;
s
.
y
=-
2
.
0
f
;
s
.
z
=
4
.
0
f
;
s
.
w
=
0
.
2
f
;
t
.
x
=
0
.
4
f
;
t
.
y
=
8
.
3
f
;
t
.
z
=
-
3
.
1
f
;
t
.
w
=
-
2
.
7
f
;
u
.
x
=
1
.
1
f
;
u
.
y
=
-
0
.
7
f
;
u
.
z
=
9
.
2
f
;
u
.
w
=
0
.
0
f
;
D3DXQuaternionSquadSetup
(
&
gotquat
,
&
Nq
,
&
Nq1
,
&
r
,
&
s
,
&
u
,
&
t
);
expectedquat
.
x
=
-
4
.
139569
f
;
expectedquat
.
y
=
-
2
.
469115
f
;
expectedquat
.
z
=
2
.
364477
f
;
expectedquat
.
w
=
0
.
465494
f
;
expect_vec4
(
expectedquat
,
gotquat
);
expectedquat
.
x
=
2
.
342533
f
;
expectedquat
.
y
=
2
.
365127
f
;
expectedquat
.
z
=
8
.
628538
f
;
expectedquat
.
w
=
-
0
.
898356
f
;
expect_vec4
(
expectedquat
,
Nq
);
expectedquat
.
x
=
1
.
1
f
;
expectedquat
.
y
=
-
0
.
7
f
;
expectedquat
.
z
=
9
.
2
f
;
expectedquat
.
w
=
0
.
0
f
;
expect_vec4
(
expectedquat
,
Nq1
);
D3DXQuaternionSquadSetup
(
&
gotquat
,
&
Nq
,
&
Nq1
,
&
r
,
&
s
,
&
t
,
&
u
);
expectedquat
.
x
=
-
3
.
754567
f
;
expectedquat
.
y
=
-
0
.
586085
f
;
expectedquat
.
z
=
3
.
815818
f
;
expectedquat
.
w
=
-
0
.
198150
f
;
expect_vec4
(
expectedquat
,
gotquat
);
expectedquat
.
x
=
0
.
140773
f
;
expectedquat
.
y
=
-
8
.
737090
f
;
expectedquat
.
z
=
-
0
.
516593
f
;
expectedquat
.
w
=
3
.
053
942
f
;
expect_vec4
(
expectedquat
,
Nq
);
expectedquat
.
x
=
-
0
.
4
f
;
expectedquat
.
y
=
-
8
.
3
f
;
expectedquat
.
z
=
3
.
1
f
;
expectedquat
.
w
=
2
.
7
f
;
expect_vec4
(
expectedquat
,
Nq1
);
r
.
x
=
-
1
.
0
f
;
r
.
y
=
0
.
0
f
;
r
.
z
=
0
.
0
f
;
r
.
w
=
0
.
0
f
;
s
.
x
=
1
.
0
f
;
s
.
y
=
0
.
0
f
;
s
.
z
=
0
.
0
f
;
s
.
w
=
0
.
0
f
;
t
.
x
=
1
.
0
f
;
t
.
y
=
0
.
0
f
;
t
.
z
=
0
.
0
f
;
t
.
w
=
0
.
0
f
;
u
.
x
=
-
1
.
0
f
;
u
.
y
=
0
.
0
f
;
u
.
z
=
0
.
0
f
;
u
.
w
=
0
.
0
f
;
D3DXQuaternionSquadSetup
(
&
gotquat
,
&
Nq
,
&
Nq1
,
&
r
,
&
s
,
&
t
,
&
u
);
expectedquat
.
x
=
1
.
0
f
;
expectedquat
.
y
=
0
.
0
f
;
expectedquat
.
z
=
0
.
0
f
;
expectedquat
.
w
=
0
.
0
f
;
expect_vec4
(
expectedquat
,
gotquat
);
expectedquat
.
x
=
1
.
0
f
;
expectedquat
.
y
=
0
.
0
f
;
expectedquat
.
z
=
0
.
0
f
;
expectedquat
.
w
=
0
.
0
f
;
expect_vec4
(
expectedquat
,
Nq
);
expectedquat
.
x
=
1
.
0
f
;
expectedquat
.
y
=
0
.
0
f
;
expectedquat
.
z
=
0
.
0
f
;
expectedquat
.
w
=
0
.
0
f
;
expect_vec4
(
expectedquat
,
Nq1
);
/*_______________D3DXQuaternionToAxisAngle__________________*/
Nq
.
x
=
1
.
0
f
/
22
.
0
f
;
Nq
.
y
=
2
.
0
f
/
22
.
0
f
;
Nq
.
z
=
4
.
0
f
/
22
.
0
f
;
Nq
.
w
=
10
.
0
f
/
22
.
0
f
;
expectedvec
.
x
=
1
.
0
f
/
22
.
0
f
;
expectedvec
.
y
=
2
.
0
f
/
22
.
0
f
;
expectedvec
.
z
=
4
.
0
f
/
22
.
0
f
;
...
...
include/d3dx9math.h
View file @
ed7c2835
...
...
@@ -337,6 +337,7 @@ D3DXQUATERNION* WINAPI D3DXQuaternionRotationMatrix(D3DXQUATERNION *pout, CONST
D3DXQUATERNION
*
WINAPI
D3DXQuaternionRotationYawPitchRoll
(
D3DXQUATERNION
*
pout
,
FLOAT
yaw
,
FLOAT
pitch
,
FLOAT
roll
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionSlerp
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
,
FLOAT
t
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionSquad
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
,
CONST
D3DXQUATERNION
*
pq3
,
CONST
D3DXQUATERNION
*
pq4
,
FLOAT
t
);
void
WINAPI
D3DXQuaternionSquadSetup
(
D3DXQUATERNION
*
paout
,
D3DXQUATERNION
*
pbout
,
D3DXQUATERNION
*
pcout
,
CONST
D3DXQUATERNION
*
pq0
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
,
CONST
D3DXQUATERNION
*
pq3
);
void
WINAPI
D3DXQuaternionToAxisAngle
(
CONST
D3DXQUATERNION
*
pq
,
D3DXVECTOR3
*
paxis
,
FLOAT
*
pangle
);
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