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
7a4490c0
Commit
7a4490c0
authored
Nov 20, 2007
by
David Adam
Committed by
Alexandre Julliard
Nov 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXQuaternionToAxisAngle.
parent
aa30f442
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
3 deletions
+46
-3
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+21
-0
math.c
dlls/d3dx8/tests/math.c
+23
-2
d3dx8math.h
include/d3dx8math.h
+1
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
7a4490c0
...
...
@@ -49,7 +49,7 @@
@ stdcall D3DXMatrixOrthoOffCenterLH(ptr long long long long long long)
@ stdcall D3DXMatrixShadow(ptr ptr ptr)
@ stdcall D3DXMatrixReflect(ptr ptr)
@ st
ub D3DXQuaternionToAxisAngle
@ st
dcall D3DXQuaternionToAxisAngle(ptr ptr ptr)
@ stub D3DXQuaternionRotationMatrix
@ stub D3DXQuaternionRotationAxis
@ stub D3DXQuaternionRotationYawPitchRoll
...
...
dlls/d3dx8/math.c
View file @
7a4490c0
...
...
@@ -665,6 +665,27 @@ D3DXQUATERNION* WINAPI D3DXQuaternionSquad(D3DXQUATERNION *pout, CONST D3DXQUATE
return
pout
;
}
void
WINAPI
D3DXQuaternionToAxisAngle
(
CONST
D3DXQUATERNION
*
pq
,
D3DXVECTOR3
*
paxis
,
FLOAT
*
pangle
)
{
FLOAT
norm
;
*
pangle
=
0
.
0
f
;
norm
=
D3DXQuaternionLength
(
pq
);
if
(
norm
)
{
paxis
->
x
=
pq
->
x
/
norm
;
paxis
->
y
=
pq
->
y
/
norm
;
paxis
->
z
=
pq
->
z
/
norm
;
if
(
fabs
(
pq
->
w
)
<=
1
.
0
f
)
*
pangle
=
2
.
0
f
*
acos
(
pq
->
w
);
}
else
{
paxis
->
x
=
1
.
0
f
;
paxis
->
y
=
0
.
0
f
;
paxis
->
z
=
0
.
0
f
;
}
}
/*_________________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 @
7a4490c0
...
...
@@ -552,9 +552,10 @@ static void D3DXPlaneTest(void)
static
void
D3X8QuaternionTest
(
void
)
{
D3DXQUATERNION
expectedquat
,
gotquat
,
nul
,
q
,
r
,
s
,
t
,
u
;
D3DXQUATERNION
expectedquat
,
gotquat
,
Nq
,
nul
,
q
,
r
,
s
,
t
,
u
;
LPD3DXQUATERNION
funcpointer
;
FLOAT
expected
,
got
,
scale
,
scale2
;
D3DXVECTOR3
axis
,
expectedvec
;
FLOAT
angle
,
expected
,
got
,
scale
,
scale2
;
BOOL
expectedbool
,
gotbool
;
nul
.
x
=
0
.
0
f
;
nul
.
y
=
0
.
0
f
;
nul
.
z
=
0
.
0
f
;
nul
.
w
=
0
.
0
f
;
...
...
@@ -667,6 +668,26 @@ static void D3X8QuaternionTest(void)
expectedquat
.
x
=
-
156
.
296
f
;
expectedquat
.
y
=
30
.
242
f
;
expectedquat
.
z
=
-
2
.
5022
f
;
expectedquat
.
w
=
7
.
3576
f
;
D3DXQuaternionSquad
(
&
gotquat
,
&
q
,
&
r
,
&
t
,
&
u
,
scale
);
expect_vec4
(
expectedquat
,
gotquat
);
/*_______________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
/
11
.
0
f
;
expectedvec
.
y
=
2
.
0
f
/
11
.
0
f
;
expectedvec
.
z
=
4
.
0
f
/
11
.
0
f
;
expected
=
2
.
197869
f
;
D3DXQuaternionToAxisAngle
(
&
Nq
,
&
axis
,
&
angle
);
expect_vec3
(
expectedvec
,
axis
);
ok
(
fabs
(
angle
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
angle
);
/* Test if |w|>1.0f */
expectedvec
.
x
=
1
.
0
f
/
11
.
0
f
;
expectedvec
.
y
=
2
.
0
f
/
11
.
0
f
;
expectedvec
.
z
=
4
.
0
f
/
11
.
0
f
;
expected
=
0
.
0
f
;
D3DXQuaternionToAxisAngle
(
&
q
,
&
axis
,
&
angle
);
expect_vec3
(
expectedvec
,
axis
);
ok
(
fabs
(
angle
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
angle
);
/* Test the null quaternion */
expectedvec
.
x
=
1
.
0
f
;
expectedvec
.
y
=
0
.
0
f
;
expectedvec
.
z
=
0
.
0
f
;
expected
=
0
.
0
f
;
D3DXQuaternionToAxisAngle
(
&
nul
,
&
axis
,
&
angle
);
expect_vec3
(
expectedvec
,
axis
);
ok
(
fabs
(
angle
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
angle
);
}
static
void
D3X8Vector2Test
(
void
)
...
...
include/d3dx8math.h
View file @
7a4490c0
...
...
@@ -308,6 +308,7 @@ D3DXQUATERNION* WINAPI D3DXQuaternionMultiply(D3DXQUATERNION *pout, CONST D3DXQU
D3DXQUATERNION
*
WINAPI
D3DXQuaternionNormalize
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
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
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
);
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