Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
ed7c2835
Commit
ed7c2835
authored
12 years ago
by
Nozomi Kodama
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
d3dx9_36: Implementation of D3DXQuaternionSquadSetup.
parent
ac38e69a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
dlls/d3dx9_36/d3dx9_36.spec
+1
-1
1 addition, 1 deletion
dlls/d3dx9_36/d3dx9_36.spec
dlls/d3dx9_36/math.c
+67
-0
67 additions, 0 deletions
dlls/d3dx9_36/math.c
dlls/d3dx9_36/tests/math.c
+42
-0
42 additions, 0 deletions
dlls/d3dx9_36/tests/math.c
include/d3dx9math.h
+1
-0
1 addition, 0 deletions
include/d3dx9math.h
with
111 additions
and
1 deletion
dlls/d3dx9_36/d3dx9_36.spec
+
1
−
1
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)
...
...
This diff is collapsed.
Click to expand it.
dlls/d3dx9_36/math.c
+
67
−
0
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
;
...
...
This diff is collapsed.
Click to expand it.
dlls/d3dx9_36/tests/math.c
+
42
−
0
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
;
...
...
This diff is collapsed.
Click to expand it.
include/d3dx9math.h
+
1
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment