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
9a281e5d
Commit
9a281e5d
authored
Sep 27, 2012
by
Rico Schüller
Committed by
Alexandre Julliard
Sep 27, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx9: Use float functions in D3DXQuaternionRotationMatrix().
parent
e9219533
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
47 additions
and
44 deletions
+47
-44
math.c
dlls/d3dx9_36/math.c
+47
-44
No files found.
dlls/d3dx9_36/math.c
View file @
9a281e5d
...
...
@@ -1370,57 +1370,60 @@ D3DXQUATERNION * WINAPI D3DXQuaternionRotationAxis(D3DXQUATERNION *out, const D3
return
out
;
}
D3DXQUATERNION
*
WINAPI
D3DXQuaternionRotationMatrix
(
D3DXQUATERNION
*
pout
,
CONST
D3DXMATRIX
*
p
m
)
D3DXQUATERNION
*
WINAPI
D3DXQuaternionRotationMatrix
(
D3DXQUATERNION
*
out
,
const
D3DXMATRIX
*
m
)
{
int
i
,
maxi
;
FLOAT
maxdiag
,
S
,
trace
;
FLOAT
s
,
trace
;
TRACE
(
"
(%p, %p)
\n
"
,
pout
,
p
m
);
TRACE
(
"
out %p, m %p
\n
"
,
out
,
m
);
trace
=
pm
->
u
.
m
[
0
][
0
]
+
pm
->
u
.
m
[
1
][
1
]
+
pm
->
u
.
m
[
2
][
2
]
+
1
.
0
f
;
if
(
trace
>
1
.
0
f
)
{
pout
->
x
=
(
pm
->
u
.
m
[
1
][
2
]
-
pm
->
u
.
m
[
2
][
1
]
)
/
(
2
.
0
f
*
sqrt
(
trace
)
);
pout
->
y
=
(
pm
->
u
.
m
[
2
][
0
]
-
pm
->
u
.
m
[
0
][
2
]
)
/
(
2
.
0
f
*
sqrt
(
trace
)
);
pout
->
z
=
(
pm
->
u
.
m
[
0
][
1
]
-
pm
->
u
.
m
[
1
][
0
]
)
/
(
2
.
0
f
*
sqrt
(
trace
)
);
pout
->
w
=
sqrt
(
trace
)
/
2
.
0
f
;
return
pout
;
}
maxi
=
0
;
maxdiag
=
pm
->
u
.
m
[
0
][
0
];
for
(
i
=
1
;
i
<
3
;
i
++
)
trace
=
m
->
u
.
m
[
0
][
0
]
+
m
->
u
.
m
[
1
][
1
]
+
m
->
u
.
m
[
2
][
2
]
+
1
.
0
f
;
if
(
trace
>
1
.
0
f
)
{
if
(
pm
->
u
.
m
[
i
][
i
]
>
maxdiag
)
{
maxi
=
i
;
maxdiag
=
pm
->
u
.
m
[
i
][
i
]
;
}
s
=
2
.
0
f
*
sqrtf
(
trace
);
out
->
x
=
(
m
->
u
.
m
[
1
][
2
]
-
m
->
u
.
m
[
2
][
1
])
/
s
;
out
->
y
=
(
m
->
u
.
m
[
2
][
0
]
-
m
->
u
.
m
[
0
][
2
])
/
s
;
out
->
z
=
(
m
->
u
.
m
[
0
][
1
]
-
m
->
u
.
m
[
1
][
0
])
/
s
;
out
->
w
=
0
.
25
f
*
s
;
}
switch
(
maxi
)
else
{
case
0
:
S
=
2
.
0
f
*
sqrt
(
1
.
0
f
+
pm
->
u
.
m
[
0
][
0
]
-
pm
->
u
.
m
[
1
][
1
]
-
pm
->
u
.
m
[
2
][
2
]);
pout
->
x
=
0
.
25
f
*
S
;
pout
->
y
=
(
pm
->
u
.
m
[
0
][
1
]
+
pm
->
u
.
m
[
1
][
0
]
)
/
S
;
pout
->
z
=
(
pm
->
u
.
m
[
0
][
2
]
+
pm
->
u
.
m
[
2
][
0
]
)
/
S
;
pout
->
w
=
(
pm
->
u
.
m
[
1
][
2
]
-
pm
->
u
.
m
[
2
][
1
]
)
/
S
;
break
;
case
1
:
S
=
2
.
0
f
*
sqrt
(
1
.
0
f
+
pm
->
u
.
m
[
1
][
1
]
-
pm
->
u
.
m
[
0
][
0
]
-
pm
->
u
.
m
[
2
][
2
]);
pout
->
x
=
(
pm
->
u
.
m
[
0
][
1
]
+
pm
->
u
.
m
[
1
][
0
]
)
/
S
;
pout
->
y
=
0
.
25
f
*
S
;
pout
->
z
=
(
pm
->
u
.
m
[
1
][
2
]
+
pm
->
u
.
m
[
2
][
1
]
)
/
S
;
pout
->
w
=
(
pm
->
u
.
m
[
2
][
0
]
-
pm
->
u
.
m
[
0
][
2
]
)
/
S
;
break
;
case
2
:
S
=
2
.
0
f
*
sqrt
(
1
.
0
f
+
pm
->
u
.
m
[
2
][
2
]
-
pm
->
u
.
m
[
0
][
0
]
-
pm
->
u
.
m
[
1
][
1
]);
pout
->
x
=
(
pm
->
u
.
m
[
0
][
2
]
+
pm
->
u
.
m
[
2
][
0
]
)
/
S
;
pout
->
y
=
(
pm
->
u
.
m
[
1
][
2
]
+
pm
->
u
.
m
[
2
][
1
]
)
/
S
;
pout
->
z
=
0
.
25
f
*
S
;
pout
->
w
=
(
pm
->
u
.
m
[
0
][
1
]
-
pm
->
u
.
m
[
1
][
0
]
)
/
S
;
break
;
int
i
,
maxi
=
0
;
for
(
i
=
1
;
i
<
3
;
i
++
)
{
if
(
m
->
u
.
m
[
i
][
i
]
>
m
->
u
.
m
[
maxi
][
maxi
])
maxi
=
i
;
}
switch
(
maxi
)
{
case
0
:
s
=
2
.
0
f
*
sqrtf
(
1
.
0
f
+
m
->
u
.
m
[
0
][
0
]
-
m
->
u
.
m
[
1
][
1
]
-
m
->
u
.
m
[
2
][
2
]);
out
->
x
=
0
.
25
f
*
s
;
out
->
y
=
(
m
->
u
.
m
[
0
][
1
]
+
m
->
u
.
m
[
1
][
0
])
/
s
;
out
->
z
=
(
m
->
u
.
m
[
0
][
2
]
+
m
->
u
.
m
[
2
][
0
])
/
s
;
out
->
w
=
(
m
->
u
.
m
[
1
][
2
]
-
m
->
u
.
m
[
2
][
1
])
/
s
;
break
;
case
1
:
s
=
2
.
0
f
*
sqrtf
(
1
.
0
f
+
m
->
u
.
m
[
1
][
1
]
-
m
->
u
.
m
[
0
][
0
]
-
m
->
u
.
m
[
2
][
2
]);
out
->
x
=
(
m
->
u
.
m
[
0
][
1
]
+
m
->
u
.
m
[
1
][
0
])
/
s
;
out
->
y
=
0
.
25
f
*
s
;
out
->
z
=
(
m
->
u
.
m
[
1
][
2
]
+
m
->
u
.
m
[
2
][
1
])
/
s
;
out
->
w
=
(
m
->
u
.
m
[
2
][
0
]
-
m
->
u
.
m
[
0
][
2
])
/
s
;
break
;
case
2
:
s
=
2
.
0
f
*
sqrtf
(
1
.
0
f
+
m
->
u
.
m
[
2
][
2
]
-
m
->
u
.
m
[
0
][
0
]
-
m
->
u
.
m
[
1
][
1
]);
out
->
x
=
(
m
->
u
.
m
[
0
][
2
]
+
m
->
u
.
m
[
2
][
0
])
/
s
;
out
->
y
=
(
m
->
u
.
m
[
1
][
2
]
+
m
->
u
.
m
[
2
][
1
])
/
s
;
out
->
z
=
0
.
25
f
*
s
;
out
->
w
=
(
m
->
u
.
m
[
0
][
1
]
-
m
->
u
.
m
[
1
][
0
])
/
s
;
break
;
}
}
return
pout
;
return
out
;
}
D3DXQUATERNION
*
WINAPI
D3DXQuaternionRotationYawPitchRoll
(
D3DXQUATERNION
*
out
,
FLOAT
yaw
,
FLOAT
pitch
,
FLOAT
roll
)
...
...
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