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
54e8d08e
Commit
54e8d08e
authored
Nov 19, 2007
by
David Adam
Committed by
Alexandre Julliard
Nov 20, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement D3DXQuaternionInverse.
parent
45b13a6c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
3 deletions
+37
-3
d3dx8.spec
dlls/d3dx8/d3dx8.spec
+1
-1
math.c
dlls/d3dx8/math.c
+25
-1
math.c
dlls/d3dx8/tests/math.c
+9
-0
d3dx8math.h
include/d3dx8math.h
+2
-1
No files found.
dlls/d3dx8/d3dx8.spec
View file @
54e8d08e
...
...
@@ -55,7 +55,7 @@
@ stub D3DXQuaternionRotationYawPitchRoll
@ stdcall D3DXQuaternionMultiply(ptr ptr ptr)
@ stdcall D3DXQuaternionNormalize(ptr ptr)
@ st
ub D3DXQuaternionInverse
@ st
dcall D3DXQuaternionInverse(ptr ptr)
@ stub D3DXQuaternionLn
@ stub D3DXQuaternionExp
@ stub D3DXQuaternionSlerp
...
...
dlls/d3dx8/math.c
View file @
54e8d08e
...
...
@@ -581,7 +581,31 @@ D3DXPLANE* WINAPI D3DXPlaneTransform(D3DXPLANE *pout, CONST D3DXPLANE *pplane, C
/*_________________D3DXQUATERNION________________*/
D3DXQUATERNION
*
WINAPI
D3DXQuaternionMultiply
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
)
D3DXQUATERNION
*
WINAPI
D3DXQuaternionInverse
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
)
{
D3DXQUATERNION
temp
;
FLOAT
norm
;
norm
=
D3DXQuaternionLengthSq
(
pq
);
if
(
!
norm
)
{
pout
->
x
=
0
.
0
f
;
pout
->
y
=
0
.
0
f
;
pout
->
z
=
0
.
0
f
;
pout
->
w
=
0
.
0
f
;
}
else
{
D3DXQuaternionConjugate
(
&
temp
,
pq
);
pout
->
x
=
temp
.
x
/
norm
;
pout
->
y
=
temp
.
y
/
norm
;
pout
->
z
=
temp
.
z
/
norm
;
pout
->
w
=
temp
.
w
/
norm
;
}
return
pout
;
}
D3DXQUATERNION
*
WINAPI
D3DXQuaternionMultiply
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
)
{
pout
->
x
=
pq2
->
w
*
pq1
->
x
+
pq2
->
x
*
pq1
->
w
+
pq2
->
y
*
pq1
->
z
-
pq2
->
z
*
pq1
->
y
;
pout
->
y
=
pq2
->
w
*
pq1
->
y
-
pq2
->
x
*
pq1
->
z
+
pq2
->
y
*
pq1
->
w
+
pq2
->
z
*
pq1
->
x
;
...
...
dlls/d3dx8/tests/math.c
View file @
54e8d08e
...
...
@@ -591,6 +591,15 @@ static void D3X8QuaternionTest(void)
funcpointer
=
D3DXQuaternionIdentity
(
NULL
);
ok
(
funcpointer
==
NULL
,
"Expected: %p, Got: %p
\n
"
,
NULL
,
funcpointer
);
/*_______________D3DXQuaternionInverse________________________*/
expectedquat
.
x
=
-
1
.
0
f
/
121
.
0
f
;
expectedquat
.
y
=
-
2
.
0
f
/
121
.
0
f
;
expectedquat
.
z
=
-
4
.
0
f
/
121
.
0
f
;
expectedquat
.
w
=
10
.
0
f
/
121
.
0
f
;
D3DXQuaternionInverse
(
&
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
=
0
.
0
f
;
D3DXQuaternionInverse
(
&
gotquat
,
&
nul
);
expect_vec4
(
expectedquat
,
gotquat
);
/*_______________D3DXQuaternionIsIdentity________________*/
s
.
x
=
0
.
0
f
;
s
.
y
=
0
.
0
f
;
s
.
z
=
0
.
0
f
;
s
.
w
=
1
.
0
f
;
expectedbool
=
TRUE
;
...
...
include/d3dx8math.h
View file @
54e8d08e
...
...
@@ -302,7 +302,8 @@ D3DXVECTOR3* WINAPI D3DXPlaneIntersectLine(D3DXVECTOR3 *pout, CONST D3DXPLANE *p
D3DXPLANE
*
WINAPI
D3DXPlaneNormalize
(
D3DXPLANE
*
pout
,
CONST
D3DXPLANE
*
pp
);
D3DXPLANE
*
WINAPI
D3DXPlaneTransform
(
D3DXPLANE
*
pout
,
CONST
D3DXPLANE
*
pplane
,
CONST
D3DXMATRIX
*
pm
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionMultiply
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionInverse
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionMultiply
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq1
,
CONST
D3DXQUATERNION
*
pq2
);
D3DXQUATERNION
*
WINAPI
D3DXQuaternionNormalize
(
D3DXQUATERNION
*
pout
,
CONST
D3DXQUATERNION
*
pq
);
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