inline DXVector4::DXVector4(const float _x, const float _y, const float _z, const float _w)
{
	x = _x;
	y = _y;
	z = _z;
	w = _w;
}

inline DXVector4::DXVector4(const float* const v)
{
	x = v[0];
	y = v[1];
	z = v[2];
	w = v[3];
}

inline DXVector4::DXVector4(const DXVector4 &v)
{
	x = v.x;
	y = v.y;
	z = v.z;
	w = v.w;
}

//casting
inline DXVector4::operator float* ()
{
	return (float*) &x;
}

inline DXVector4::operator const float* () const
{
	return (const float*) &x;
}

inline DXVector4::operator D3DXVECTOR4* ()
{
	return (D3DXVECTOR4*) &x;
}

inline DXVector4::operator const D3DXVECTOR4* () const
{
	return (const D3DXVECTOR4*) &x;
}

inline DXVector4::operator D3DXVECTOR4 () const
{
	return D3DXVECTOR4(x,y,z,w);
}

// assignment operators
inline DXVector4& DXVector4::operator += (const DXVector4& v)
{
	x += v.x;
    y += v.y;
	z += v.z;
	w += v.w;
	return *this;
}

inline DXVector4& DXVector4::operator -= (const DXVector4& v)
{
	x -= v.x;
    y -= v.y;
	z -= v.z;
	w -= v.w;
	return *this;
}

inline DXVector4& DXVector4::operator *= (const float f)
{
	x *= f;
    y *= f;
	z *= f;
	w *= f;
	return *this;
}

inline DXVector4& DXVector4::operator /= (const float f)
{
	x /= f;
    y /= f;
	z /= f;
	w /= f;
	return *this;
}

// unary operators
inline DXVector4 DXVector4::operator + () const
{
	return *this;
}

inline DXVector4 DXVector4::operator - () const
{
	return DXVector4(-x, -y, -z, -w);
}

// binary operators
inline DXVector4 DXVector4::operator + (const DXVector4& v) const
{
	return DXVector4(x + v.x, y + v.y, z + v.z, w + v.w);
}

inline DXVector4 DXVector4::operator - (const DXVector4& v) const
{
	return DXVector4(x - v.x, y - v.y, z - v.z, w - v.w);
}

inline DXVector4 DXVector4::operator * (float f) const
{
	return DXVector4(x * f, y * f, z * f, w * f);
}

inline DXVector4 DXVector4::operator / (float f) const
{
	return DXVector4(x / f, y / f, z / f, w / f);
}

inline DXVector4 operator * ( float f, const DXVector4& v)
{
	return DXVector4(f * v.x, f * v.y, f * v.z, f * v.w);
}

inline bool DXVector4::operator == ( const DXVector4& v) const
{
	 return x == v.x && y == v.y && z == v.z && w == v.w;
}

inline bool DXVector4::operator != ( const DXVector4& v) const
{
	 return x != v.x || y != v.y || z != v.z|| w != v.w;
}