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
00bcbe25
Commit
00bcbe25
authored
Nov 10, 2007
by
Tony Wasserka
Committed by
Alexandre Julliard
Nov 12, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx8: Implement the C++ stuff of the D3DXQUATERNION structure.
parent
f422aead
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
159 additions
and
0 deletions
+159
-0
d3dx8math.h
include/d3dx8math.h
+28
-0
d3dx8math.inl
include/d3dx8math.inl
+131
-0
No files found.
include/d3dx8math.h
View file @
00bcbe25
...
...
@@ -168,6 +168,34 @@ typedef struct _D3DMATRIX D3DXMATRIX, *LPD3DXMATRIX;
typedef
struct
D3DXQUATERNION
{
#ifdef __cplusplus
D3DXQUATERNION
();
D3DXQUATERNION
(
CONST
FLOAT
*
pf
);
D3DXQUATERNION
(
FLOAT
fx
,
FLOAT
fy
,
FLOAT
fz
,
FLOAT
fw
);
operator
FLOAT
*
();
operator
CONST
FLOAT
*
()
const
;
D3DXQUATERNION
&
operator
+=
(
CONST
D3DXQUATERNION
&
);
D3DXQUATERNION
&
operator
-=
(
CONST
D3DXQUATERNION
&
);
D3DXQUATERNION
&
operator
*=
(
CONST
D3DXQUATERNION
&
);
D3DXQUATERNION
&
operator
*=
(
FLOAT
);
D3DXQUATERNION
&
operator
/=
(
FLOAT
);
D3DXQUATERNION
operator
+
()
const
;
D3DXQUATERNION
operator
-
()
const
;
D3DXQUATERNION
operator
+
(
CONST
D3DXQUATERNION
&
)
const
;
D3DXQUATERNION
operator
-
(
CONST
D3DXQUATERNION
&
)
const
;
D3DXQUATERNION
operator
*
(
CONST
D3DXQUATERNION
&
)
const
;
D3DXQUATERNION
operator
*
(
FLOAT
)
const
;
D3DXQUATERNION
operator
/
(
FLOAT
)
const
;
friend
D3DXQUATERNION
operator
*
(
FLOAT
,
CONST
D3DXQUATERNION
&
);
BOOL
operator
==
(
CONST
D3DXQUATERNION
&
)
const
;
BOOL
operator
!=
(
CONST
D3DXQUATERNION
&
)
const
;
#endif
/* __cplusplus */
FLOAT
x
,
y
,
z
,
w
;
}
D3DXQUATERNION
,
*
LPD3DXQUATERNION
;
...
...
include/d3dx8math.inl
View file @
00bcbe25
...
...
@@ -508,6 +508,137 @@ inline BOOL D3DXMATRIX::operator != (CONST D3DXMATRIX& mat) const
return (memcmp(this, &mat, sizeof(D3DXMATRIX)) != 0);
}
inline D3DXQUATERNION::D3DXQUATERNION()
{
}
inline D3DXQUATERNION::D3DXQUATERNION(CONST FLOAT *pf)
{
if(!pf) return;
x = pf[0];
y = pf[1];
z = pf[2];
w = pf[3];
}
inline D3DXQUATERNION::D3DXQUATERNION(FLOAT fx, FLOAT fy, FLOAT fz, FLOAT fw)
{
x = fx;
y = fy;
z = fz;
w = fw;
}
inline D3DXQUATERNION::operator FLOAT* ()
{
return (FLOAT*)&x;
}
inline D3DXQUATERNION::operator CONST FLOAT* () const
{
return (CONST FLOAT*)&x;
}
inline D3DXQUATERNION& D3DXQUATERNION::operator += (CONST D3DXQUATERNION& quat)
{
x += quat.x;
y += quat.y;
z += quat.z;
w += quat.w;
return *this;
}
inline D3DXQUATERNION& D3DXQUATERNION::operator -= (CONST D3DXQUATERNION& quat)
{
x -= quat.x;
y -= quat.y;
z -= quat.z;
w -= quat.w;
return *this;
}
/* TODO: uncomment this when D3DXQuaternionMultiply has been implemented
inline D3DXQUATERNION& D3DXQUATERNION::operator *= (CONST D3DXQUATERNION& quat)
{
D3DXQuaternionMultiply(this, this, &quat);
return *this;
}
*/
inline D3DXQUATERNION& D3DXQUATERNION::operator *= (FLOAT f)
{
x *= f;
y *= f;
z *= f;
w *= f;
return *this;
}
inline D3DXQUATERNION& D3DXQUATERNION::operator /= (FLOAT f)
{
FLOAT inv = 1.0f / f;
x *= inv;
y *= inv;
z *= inv;
w *= inv;
return *this;
}
inline D3DXQUATERNION D3DXQUATERNION::operator + () const
{
return *this;
}
inline D3DXQUATERNION D3DXQUATERNION::operator - () const
{
return D3DXQUATERNION(-x, -y, -z, -w);
}
inline D3DXQUATERNION D3DXQUATERNION::operator + (CONST D3DXQUATERNION& quat) const
{
return D3DXQUATERNION(x + quat.x, y + quat.y, z + quat.z, w + quat.w);
}
inline D3DXQUATERNION D3DXQUATERNION::operator - (CONST D3DXQUATERNION& quat) const
{
return D3DXQUATERNION(x - quat.x, y - quat.y, z - quat.z, w - quat.w);
}
/* TODO: uncomment this when D3DXQuaternionMultiply has been implemented
inline D3DXQUATERNION D3DXQUATERNION::operator * (CONST D3DXQUATERNION& quat) const
{
D3DXQUATERNION buf;
D3DXQuaternionMultiply(&buf, this, &quat);
return buf;
}
*/
inline D3DXQUATERNION D3DXQUATERNION::operator * (FLOAT f) const
{
return D3DXQUATERNION(x * f, y * f, z * f, w * f);
}
inline D3DXQUATERNION D3DXQUATERNION::operator / (FLOAT f) const
{
FLOAT inv = 1.0f / f;
return D3DXQUATERNION(x * inv, y * inv, z * inv, w * inv);
}
inline D3DXQUATERNION operator * (FLOAT f, CONST D3DXQUATERNION& quat)
{
return D3DXQUATERNION(f * quat.x, f * quat.y, f * quat.z, f * quat.w);
}
inline BOOL D3DXQUATERNION::operator == (CONST D3DXQUATERNION& quat) const
{
return x == quat.x && y == quat.y && z == quat.z && w == quat.w;
}
inline BOOL D3DXQUATERNION::operator != (CONST D3DXQUATERNION& quat) const
{
return x != quat.x || y != quat.y || z != quat.z || w != quat.w;
}
#endif /* __cplusplus */
/*_______________D3DXCOLOR_____________________*/
...
...
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