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
9fa78fd4
Commit
9fa78fd4
authored
Apr 19, 2007
by
David Adam
Committed by
Alexandre Julliard
Apr 23, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Implement D3DRMVectorRotate.
parent
f289cf31
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
3 deletions
+36
-3
d3drm.spec
dlls/d3drm/d3drm.spec
+1
-1
math.c
dlls/d3drm/math.c
+19
-0
vector.c
dlls/d3drm/tests/vector.c
+16
-2
No files found.
dlls/d3drm/d3drm.spec
View file @
9fa78fd4
...
...
@@ -15,7 +15,7 @@
@ stdcall D3DRMVectorNormalize(ptr)
@ stdcall D3DRMVectorRandom(ptr)
@ stdcall D3DRMVectorReflect(ptr ptr ptr)
@ st
ub D3DRMVectorRotate
@ st
dcall D3DRMVectorRotate(ptr ptr ptr long)
@ stdcall D3DRMVectorScale(ptr ptr long)
@ stdcall D3DRMVectorSubtract(ptr ptr ptr)
@ stub Direct3DRMCreate
...
...
dlls/d3drm/math.c
View file @
9fa78fd4
...
...
@@ -122,6 +122,25 @@ LPD3DVECTOR WINAPI D3DRMVectorReflect(LPD3DVECTOR r, LPD3DVECTOR ray, LPD3DVECTO
return
r
;
}
/* 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
));
quaternion3
.
s
=
0
.
0
;
quaternion3
.
v
=
*
v
;
D3DRMQuaternionMultiply
(
&
quaternion
,
&
quaternion1
,
&
quaternion3
);
D3DRMQuaternionMultiply
(
&
resultq
,
&
quaternion
,
&
quaternion2
);
*
r
=
*
D3DRMVectorNormalize
(
&
resultq
.
v
);
return
r
;
}
/* Scale a vector */
LPD3DVECTOR
WINAPI
D3DRMVectorScale
(
LPD3DVECTOR
d
,
LPD3DVECTOR
s
,
D3DVALUE
factor
)
{
...
...
dlls/d3drm/tests/vector.c
View file @
9fa78fd4
...
...
@@ -32,8 +32,8 @@
void
VectorTest
(
void
)
{
D3DVALUE
mod
,
par
;
D3DVECTOR
e
,
r
,
u
,
v
,
casnul
,
norm
,
ray
;
D3DVALUE
mod
,
par
,
theta
;
D3DVECTOR
e
,
r
,
u
,
v
,
w
,
axis
,
casnul
,
norm
,
ray
;
u
.
x
=
2
.
0
;
u
.
y
=
2
.
0
;
u
.
z
=
1
.
0
;
v
.
x
=
4
.
0
;
v
.
y
=
4
.
0
;
v
.
z
=
0
.
0
;
...
...
@@ -80,6 +80,20 @@ void VectorTest(void)
D3DRMVectorReflect
(
&
r
,
&
ray
,
&
norm
);
expect_vec
(
e
,
r
);
/*_______________________VectorRotate_______________________________*/
w
.
x
=
3
.
0
;
w
.
y
=
4
.
0
;
w
.
z
=
0
.
0
;
axis
.
x
=
0
.
0
;
axis
.
y
=
0
.
0
;
axis
.
z
=
1
.
0
;
theta
=
2
.
0
*
PI
/
3
.
0
;
D3DRMVectorRotate
(
&
r
,
&
w
,
&
axis
,
theta
);
e
.
x
=-
0
.
3
-
0
.
4
*
sqrt
(
3
.
0
);
e
.
y
=
0
.
3
*
sqrt
(
3
.
0
)
-
0
.
4
;
e
.
z
=
0
.
0
;
expect_vec
(
e
,
r
);
/* The same formula gives D3DRMVectorRotate, for theta in [-PI/2;+PI/2] or not. The following test proves this fact.*/
theta
=-
PI
/
4
.
0
;
D3DRMVectorRotate
(
&
r
,
&
w
,
&
axis
,
-
PI
/
4
);
e
.
x
=
1
.
4
/
sqrt
(
2
.
0
);
e
.
y
=
0
.
2
/
sqrt
(
2
.
0
);
e
.
z
=
0
.
0
;
expect_vec
(
e
,
r
);
/*_______________________VectorScale__________________________*/
par
=
2
.
5
;
D3DRMVectorScale
(
&
r
,
&
v
,
par
);
...
...
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