/*
* Copyright (C) 2007 David Adam
* Copyright (C) 2007 Tony Wasserka
*
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
/*
* Sun LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
* other than GPL or LGPL is available it will apply instead, Sun elects to use only
* the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
* a choice of LGPL license versions is made available with the language indicating
* that LGPLv2 or any later version may be used, or where a choice of which version
* of the LGPL is applied is otherwise unspecified.
*/
/* constructors & operators */
{
}
{
if(!pf) return;
x = pf[0];
y = pf[1];
}
{
x = fx;
y = fy;
}
{
return (FLOAT*)&x;
}
{
}
{
x += v.x;
y += v.y;
return *this;
}
{
x -= v.x;
y -= v.y;
return *this;
}
{
x *= f;
y *= f;
return *this;
}
{
x /= f;
y /= f;
return *this;
}
{
return *this;
}
{
return D3DXVECTOR2(-x, -y);
}
{
return D3DXVECTOR2(x + v.x, y + v.y);
}
{
return D3DXVECTOR2(x - v.x, y - v.y);
}
{
return D3DXVECTOR2(x * f, y * f);
}
{
return D3DXVECTOR2(x / f, y / f);
}
{
return D3DXVECTOR2(f * v.x, f * v.y);
}
{
return x == v.x && y == v.y;
}
{
return x != v.x || y != v.y;
}
{
}
{
if(!pf) return;
x = pf[0];
y = pf[1];
z = pf[2];
}
{
x = v.x;
y = v.y;
z = v.z;
}
{
x = fx;
y = fy;
z = fz;
}
{
return (FLOAT*)&x;
}
{
}
{
x += v.x;
y += v.y;
z += v.z;
return *this;
}
{
x -= v.x;
y -= v.y;
z -= v.z;
return *this;
}
{
x *= f;
y *= f;
z *= f;
return *this;
}
{
x /= f;
y /= f;
z /= f;
return *this;
}
{
return *this;
}
{
return D3DXVECTOR3(-x, -y, -z);
}
{
return D3DXVECTOR3(x + v.x, y + v.y, z + v.z);
}
{
return D3DXVECTOR3(x - v.x, y - v.y, z - v.z);
}
{
return D3DXVECTOR3(x * f, y * f, z * f);
}
{
return D3DXVECTOR3(x / f, y / f, z / f);
}
{
return D3DXVECTOR3(f * v.x, f * v.y, f * v.z);
}
{
return x == v.x && y == v.y && z == v.z;
}
{
return x != v.x || y != v.y || z != v.z;
}
{
}
{
if(!pf) return;
x = pf[0];
y = pf[1];
z = pf[2];
w = pf[3];
}
{
x = fx;
y = fy;
z = fz;
w = fw;
}
{
return (FLOAT*)&x;
}
{
}
{
x += v.x;
y += v.y;
z += v.z;
w += v.w;
return *this;
}
{
x -= v.x;
y -= v.y;
z -= v.z;
w -= v.w;
return *this;
}
{
x *= f;
y *= f;
z *= f;
w *= f;
return *this;
}
{
x /= f;
y /= f;
z /= f;
w /= f;
return *this;
}
{
return *this;
}
{
return D3DXVECTOR4(-x, -y, -z, -w);
}
{
return D3DXVECTOR4(x + v.x, y + v.y, z + v.z, w + v.w);
}
{
return D3DXVECTOR4(x - v.x, y - v.y, z - v.z, w - v.w);
}
{
return D3DXVECTOR4(x * f, y * f, z * f, w * f);
}
{
return D3DXVECTOR4(x / f, y / f, z / f, w / f);
}
{
return D3DXVECTOR4(f * v.x, f * v.y, f * v.z, f * v.w);
}
{
return x == v.x && y == v.y && z == v.z && w == v.w;
}
{
return x != v.x || y != v.y || z != v.z || w != v.w;
}
{
}
{
if(!pf) return;
}
{
}
{
}
{
}
{
}
{
}
{
}
{
D3DXMatrixMultiply(this, this, &mat);
return *this;
}
{
return *this;
}
{
return *this;
}
{
return *this;
}
{
return *this;
}
{
return *this;
}
{
}
{
return buf;
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
}
{
if(!pf) return;
x = pf[0];
y = pf[1];
z = pf[2];
w = pf[3];
}
{
x = fx;
y = fy;
z = fz;
w = fw;
}
{
return (FLOAT*)&x;
}
{
}
{
x += quat.x;
y += quat.y;
z += quat.z;
w += quat.w;
return *this;
}
{
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;
}
*/
{
x *= f;
y *= f;
z *= f;
w *= f;
return *this;
}
{
x *= inv;
y *= inv;
z *= inv;
w *= inv;
return *this;
}
{
return *this;
}
{
return D3DXQUATERNION(-x, -y, -z, -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;
}
*/
{
return D3DXQUATERNION(x * f, y * f, z * f, w * f);
}
{
}
{
}
{
}
{
}
{
}
{
if(!pf) return;
a = pf[0];
b = pf[1];
c = pf[2];
d = pf[3];
}
{
a = fa;
b = fb;
c = fc;
d = fd;
}
{
return (FLOAT*)&a;
}
{
}
{
return *this;
}
{
return D3DXPLANE(-a, -b, -c, -d);
}
{
}
{
}
{
}
{
}
{
if(!pf) return;
r = pf[0];
g = pf[1];
b = pf[2];
a = pf[3];
}
{
r = col.r;
g = col.g;
b = col.b;
a = col.a;
}
{
r = fr;
g = fg;
b = fb;
a = fa;
}
{
}
{
return (FLOAT*)&r;
}
{
}
{
return (D3DCOLORVALUE*)&r;
}
{
return (CONST D3DCOLORVALUE*)&r;
}
{
return *((D3DCOLORVALUE*)&r);
}
{
return *((CONST D3DCOLORVALUE*)&r);
}
{
r += col.r;
g += col.g;
b += col.b;
a += col.a;
return *this;
}
{
r -= col.r;
g -= col.g;
b -= col.b;
a -= col.a;
return *this;
}
{
r *= f;
g *= f;
b *= f;
a *= f;
return *this;
}
{
r *= inv;
g *= inv;
b *= inv;
a *= inv;
return *this;
}
{
return *this;
}
{
return D3DXCOLOR(-r, -g, -b, -a);
}
{
}
{
}
{
return D3DXCOLOR(r * f, g * f, b * f, a * f);
}
{
}
{
}
{
}
{
}
#endif /* __cplusplus */
/*_______________D3DXCOLOR_____________________*/
{
return pout;
}
static inline D3DXCOLOR* D3DXColorLerp(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2, FLOAT s)
{
return pout;
}
static inline D3DXCOLOR* D3DXColorModulate(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2)
{
return pout;
}
{
return pout;
}
{
return pout;
}
static inline D3DXCOLOR* D3DXColorSubtract(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2)
{
return pout;
}
/*_______________D3DXVECTOR2________________________*/
static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{
return pout;
}
{
}
{
}
{
if (!pv) return 0.0f;
}
{
if (!pv) return 0.0f;
}
static inline D3DXVECTOR2* D3DXVec2Lerp(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2, FLOAT s)
{
return pout;
}
static inline D3DXVECTOR2* D3DXVec2Maximize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{
return pout;
}
static inline D3DXVECTOR2* D3DXVec2Minimize(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{
return pout;
}
{
return pout;
}
static inline D3DXVECTOR2* D3DXVec2Subtract(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)
{
return pout;
}
/*__________________D3DXVECTOR3_______________________*/
static inline D3DXVECTOR3* D3DXVec3Add(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
{
return pout;
}
static inline D3DXVECTOR3* D3DXVec3Cross(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
{
return pout;
}
{
}
{
if (!pv) return 0.0f;
}
{
if (!pv) return 0.0f;
}
static inline D3DXVECTOR3* D3DXVec3Lerp(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2, FLOAT s)
{
return pout;
}
static inline D3DXVECTOR3* D3DXVec3Maximize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
{
return pout;
}
static inline D3DXVECTOR3* D3DXVec3Minimize(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
{
return pout;
}
{
return pout;
}
static inline D3DXVECTOR3* D3DXVec3Subtract(D3DXVECTOR3 *pout, CONST D3DXVECTOR3 *pv1, CONST D3DXVECTOR3 *pv2)
{
return pout;
}
/*__________________D3DXVECTOR4_______________________*/
static inline D3DXVECTOR4* D3DXVec4Add(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
{
return pout;
}
{
}
{
if (!pv) return 0.0f;
}
{
if (!pv) return 0.0f;
}
static inline D3DXVECTOR4* D3DXVec4Lerp(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2, FLOAT s)
{
return pout;
}
static inline D3DXVECTOR4* D3DXVec4Maximize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
{
return pout;
}
static inline D3DXVECTOR4* D3DXVec4Minimize(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
{
return pout;
}
{
return pout;
}
static inline D3DXVECTOR4* D3DXVec4Subtract(D3DXVECTOR4 *pout, CONST D3DXVECTOR4 *pv1, CONST D3DXVECTOR4 *pv2)
{
return pout;
}
/*__________________D3DXMatrix____________________*/
#else
{
return pout;
}
{
int i,j;
for (i=0; i<4; i++)
{
for (j=0; j<4; j++)
{
}
}
return TRUE;
}
/*__________________D3DXPLANE____________________*/
{
}
{
}
{
}
/*__________________D3DXQUATERNION____________________*/
static inline D3DXQUATERNION* D3DXQuaternionConjugate(D3DXQUATERNION *pout, CONST D3DXQUATERNION *pq)
{
return pout;
}
{
}
{
pout->x = 0.0f;
pout->y = 0.0f;
pout->z = 0.0f;
pout->w = 1.0f;
return pout;
}
{
}
{
if (!pq) return 0.0f;
}
{
if (!pq) return 0.0f;
}