d3dx8: Implement the C++ stuff of the D3DXPLANE structure.
This commit is contained in:
parent
00bcbe254f
commit
94ccd3f014
|
@ -201,6 +201,20 @@ typedef struct D3DXQUATERNION
|
|||
|
||||
typedef struct D3DXPLANE
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
D3DXPLANE();
|
||||
D3DXPLANE(CONST FLOAT *pf);
|
||||
D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd);
|
||||
|
||||
operator FLOAT* ();
|
||||
operator CONST FLOAT* () const;
|
||||
|
||||
D3DXPLANE operator + () const;
|
||||
D3DXPLANE operator - () const;
|
||||
|
||||
BOOL operator == (CONST D3DXPLANE&) const;
|
||||
BOOL operator != (CONST D3DXPLANE&) const;
|
||||
#endif /* __cplusplus */
|
||||
FLOAT a, b, c, d;
|
||||
} D3DXPLANE, *LPD3DXPLANE;
|
||||
|
||||
|
|
|
@ -639,6 +639,57 @@ inline BOOL D3DXQUATERNION::operator != (CONST D3DXQUATERNION& quat) const
|
|||
return x != quat.x || y != quat.y || z != quat.z || w != quat.w;
|
||||
}
|
||||
|
||||
inline D3DXPLANE::D3DXPLANE()
|
||||
{
|
||||
}
|
||||
|
||||
inline D3DXPLANE::D3DXPLANE(CONST FLOAT *pf)
|
||||
{
|
||||
if(!pf) return;
|
||||
a = pf[0];
|
||||
b = pf[1];
|
||||
c = pf[2];
|
||||
d = pf[3];
|
||||
}
|
||||
|
||||
inline D3DXPLANE::D3DXPLANE(FLOAT fa, FLOAT fb, FLOAT fc, FLOAT fd)
|
||||
{
|
||||
a = fa;
|
||||
b = fb;
|
||||
c = fc;
|
||||
d = fd;
|
||||
}
|
||||
|
||||
inline D3DXPLANE::operator FLOAT* ()
|
||||
{
|
||||
return (FLOAT*)&a;
|
||||
}
|
||||
|
||||
inline D3DXPLANE::operator CONST FLOAT* () const
|
||||
{
|
||||
return (CONST FLOAT*)&a;
|
||||
}
|
||||
|
||||
inline D3DXPLANE D3DXPLANE::operator + () const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline D3DXPLANE D3DXPLANE::operator - () const
|
||||
{
|
||||
return D3DXPLANE(-a, -b, -c, -d);
|
||||
}
|
||||
|
||||
inline BOOL D3DXPLANE::operator == (CONST D3DXPLANE& pl) const
|
||||
{
|
||||
return a == pl.a && b == pl.b && c == pl.c && d == pl.d;
|
||||
}
|
||||
|
||||
inline BOOL D3DXPLANE::operator != (CONST D3DXPLANE& pl) const
|
||||
{
|
||||
return a != pl.a || b != pl.b || c != pl.c || d != pl.d;
|
||||
}
|
||||
|
||||
#endif /* __cplusplus */
|
||||
|
||||
/*_______________D3DXCOLOR_____________________*/
|
||||
|
|
Loading…
Reference in New Issue