Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
f1bc4849
Commit
f1bc4849
authored
Nov 21, 2007
by
David Adam
Committed by
Alexandre Julliard
Nov 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXQuaternionExp.
parent
41029cc8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
1 deletion
+38
-1
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+22
-0
math.c
dlls/d3dx8/tests/math.c
+14
-0
d3dx8math.h
include/d3dx8math.h
+1
-0
No files found.
dlls/d3dx8/d3dx8.spec
View file @
f1bc4849
...
...
@@ -57,7 +57,7 @@
@ stdcall D3DXQuaternionNormalize(ptr ptr)
@ stdcall D3DXQuaternionInverse(ptr ptr)
@ stdcall D3DXQuaternionLn(ptr ptr)
@ st
ub D3DXQuaternionExp
@ st
dcall D3DXQuaternionExp(ptr ptr)
@ stdcall D3DXQuaternionSlerp(ptr ptr ptr long)
@ stdcall D3DXQuaternionSquad(ptr ptr ptr ptr ptr long)
@ stdcall D3DXQuaternionBaryCentric(ptr ptr ptr ptr long long)
...
...
dlls/d3dx8/math.c
View file @
f1bc4849
...
...
@@ -588,6 +588,28 @@ D3DXQUATERNION* WINAPI D3DXQuaternionBaryCentric(D3DXQUATERNION *pout, CONST D3D
return
pout
;
}
D3DXQUATERNION
*
WINAPI
D3DXQuaternionExp
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
)
{
FLOAT
norm
;
norm
=
sqrt
(
pq
->
x
*
pq
->
x
+
pq
->
y
*
pq
->
y
+
pq
->
z
*
pq
->
z
);
if
(
norm
)
{
pout
->
x
=
sin
(
norm
)
*
pq
->
x
/
norm
;
pout
->
y
=
sin
(
norm
)
*
pq
->
y
/
norm
;
pout
->
z
=
sin
(
norm
)
*
pq
->
z
/
norm
;
pout
->
w
=
cos
(
norm
);
}
else
{
pout
->
x
=
0
.
0
f
;
pout
->
y
=
0
.
0
f
;
pout
->
z
=
0
.
0
f
;
pout
->
w
=
1
.
0
f
;
}
return
pout
;
}
D3DXQUATERNION
*
WINAPI
D3DXQuaternionInverse
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
)
{
D3DXQUATERNION
temp
;
...
...
dlls/d3dx8/tests/math.c
View file @
f1bc4849
...
...
@@ -595,6 +595,20 @@ static void D3X8QuaternionTest(void)
got
=
D3DXQuaternionDot
(
NULL
,
NULL
);
ok
(
fabs
(
got
-
expected
)
<
admitted_error
,
"Expected: %f, Got: %f
\n
"
,
expected
,
got
);
/*_______________D3DXQuaternionExp______________________________*/
expectedquat
.
x
=
-
0
.
216382
f
;
expectedquat
.
y
=
-
0
.
432764
f
;
expectedquat
.
z
=
-
0
.
8655270
f
;
expectedquat
.
w
=
-
0
.
129449
f
;
D3DXQuaternionExp
(
&
gotquat
,
&
q
);
expect_vec4
(
expectedquat
,
gotquat
);
/* Test the null quaternion */
expectedquat
.
x
=
0
.
0
f
;
expectedquat
.
y
=
0
.
0
f
;
expectedquat
.
z
=
0
.
0
f
;
expectedquat
.
w
=
1
.
0
f
;
D3DXQuaternionExp
(
&
gotquat
,
&
nul
);
expect_vec4
(
expectedquat
,
gotquat
);
/* Test the case where the norm of the quaternion is <1 */
Nq1
.
x
=
0
.
2
f
;
Nq1
.
y
=
0
.
1
f
;
Nq1
.
z
=
0
.
3
;
Nq1
.
w
=
0
.
9
f
;
expectedquat
.
x
=
0
.
195366
;
expectedquat
.
y
=
0
.
097683
f
;
expectedquat
.
z
=
0
.
293049
f
;
expectedquat
.
w
=
0
.
930813
f
;
D3DXQuaternionExp
(
&
gotquat
,
&
Nq1
);
expect_vec4
(
expectedquat
,
gotquat
);
/*_______________D3DXQuaternionIdentity________________*/
expectedquat
.
x
=
0
.
0
f
;
expectedquat
.
y
=
0
.
0
f
;
expectedquat
.
z
=
0
.
0
f
;
expectedquat
.
w
=
1
.
0
f
;
D3DXQuaternionIdentity
(
&
gotquat
);
...
...
include/d3dx8math.h
View file @
f1bc4849
...
...
@@ -303,6 +303,7 @@ D3DXPLANE* WINAPI D3DXPlaneNormalize(D3DXPLANE *pout, CONST D3DXPLANE *pp);
D3DXPLANE
*
WINAPI
D3DXPlaneTransform
(
D3DXPLANE
*
pout
,
CONST
D3DXPLANE
*
pplane
,
CONST
D3DXMATRIX
*
pm
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionBaryCentric
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
,
CONST
D3DXQUATERNION
*
pq3
,
FLOAT
f
,
FLOAT
g
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionExp
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionInverse
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionLn
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionMultiply
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
);
...
...
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