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
687ce938
Commit
687ce938
authored
Feb 14, 2009
by
David Adam
Committed by
Alexandre Julliard
Feb 16, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Simplify some functions.
parent
f877cb9a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
14 deletions
+15
-14
math.c
dlls/d3drm/math.c
+15
-14
No files found.
dlls/d3drm/math.c
View file @
687ce938
...
...
@@ -128,7 +128,7 @@ LPD3DRMQUATERNION WINAPI D3DRMQuaternionFromRotation(LPD3DRMQUATERNION q, LPD3DV
LPD3DRMQUATERNION
WINAPI
D3DRMQuaternionSlerp
(
LPD3DRMQUATERNION
q
,
LPD3DRMQUATERNION
a
,
LPD3DRMQUATERNION
b
,
D3DVALUE
alpha
)
{
D3DVALUE
dot
,
epsilon
,
temp
,
theta
,
u
;
D3DVECTOR
sca1
,
sca2
;
dot
=
a
->
s
*
b
->
s
+
D3DRMVectorDotProduct
(
&
a
->
v
,
&
b
->
v
);
epsilon
=
1
.
0
f
;
temp
=
1
.
0
f
-
alpha
;
...
...
@@ -145,8 +145,8 @@ LPD3DRMQUATERNION WINAPI D3DRMQuaternionSlerp(LPD3DRMQUATERNION q, LPD3DRMQUATER
u
=
sin
(
theta
*
alpha
)
/
sin
(
theta
);
}
q
->
s
=
temp
*
a
->
s
+
epsilon
*
u
*
b
->
s
;
D3DRMVectorAdd
(
&
q
->
v
,
D3DRMVectorScale
(
&
sca1
,
&
a
->
v
,
temp
),
D3DRMVectorScale
(
&
sca2
,
&
b
->
v
,
epsilon
*
u
));
D3DRMVectorAdd
(
&
q
->
v
,
D3DRMVectorScale
(
&
a
->
v
,
&
a
->
v
,
temp
),
D3DRMVectorScale
(
&
b
->
v
,
&
b
->
v
,
epsilon
*
u
));
return
q
;
}
...
...
@@ -245,19 +245,20 @@ LPD3DVECTOR WINAPI D3DRMVectorReflect(LPD3DVECTOR r, LPD3DVECTOR ray, LPD3DVECTO
/* Rotation of a vector */
LPD3DVECTOR
WINAPI
D3DRMVectorRotate
(
LPD3DVECTOR
r
,
LPD3DVECTOR
v
,
LPD3DVECTOR
axis
,
D3DVALUE
theta
)
{
D3DRMQUATERNION
quaternion
,
quaternion1
,
quaternion2
,
quaternion3
,
resultq
;
D3DVECTOR
NORM
;
quaternion1
.
s
=
cos
(
theta
*
.
5
);
quaternion2
.
s
=
cos
(
theta
*
.
5
);
NORM
=
*
D3DRMVectorNormalize
(
axis
);
D3DRMVectorScale
(
&
quaternion1
.
v
,
&
NORM
,
sin
(
theta
*
.
5
));
D3DRMVectorScale
(
&
quaternion2
.
v
,
&
NORM
,
-
sin
(
theta
*
.
5
));
D3DRMQUATERNION
quaternion
1
,
quaternion2
,
quaternion3
;
D3DVECTOR
norm
;
quaternion1
.
s
=
cos
(
theta
*
0
.
5
f
);
quaternion2
.
s
=
cos
(
theta
*
0
.
5
f
);
norm
=
*
D3DRMVectorNormalize
(
axis
);
D3DRMVectorScale
(
&
quaternion1
.
v
,
&
norm
,
sin
(
theta
*
0
.
5
f
));
D3DRMVectorScale
(
&
quaternion2
.
v
,
&
norm
,
-
sin
(
theta
*
0
.
5
f
));
quaternion3
.
s
=
0
.
0
;
quaternion3
.
v
=
*
v
;
D3DRMQuaternionMultiply
(
&
quaternion
,
&
quaternion1
,
&
quaternion3
);
D3DRMQuaternionMultiply
(
&
resultq
,
&
quaternion
,
&
quaternion2
);
*
r
=
*
D3DRMVectorNormalize
(
&
resultq
.
v
);
D3DRMQuaternionMultiply
(
&
quaternion1
,
&
quaternion1
,
&
quaternion3
);
D3DRMQuaternionMultiply
(
&
quaternion1
,
&
quaternion1
,
&
quaternion2
);
*
r
=
*
D3DRMVectorNormalize
(
&
quaternion1
.
v
);
return
r
;
}
...
...
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