Wow, I still learn something new about C++ every day. Just haven't worked with function pointers that much I guess.
Thanks for the tip, I got it working great. For the sake of anyone else who's trying this in the future, though, you did make one minor syntax mistake:
instead of this:
D3DXVECTOR3 (D3DXVECTOR3::*fopadd) operator + ( CONST D3DXVECTOR3& ) const = &D3DXVECTOR3::operator +;
it should be this:
D3DXVECTOR3 (D3DXVECTOR3::*fopadd)( CONST D3DXVECTOR3& ) const = &D3DXVECTOR3::operator +;
A small difference, but we all know how much compilers like to whine about small differences. :) Also, for anyone looking to use the D3DX Vector in the future, here's my setup code:
//Somewhere outside of main()
DECLARE_INSTANCE_TYPE(D3DXVECTOR3)
//Somewhere inside of main()
D3DXVECTOR3 (D3DXVECTOR3::*fopadd)( CONST D3DXVECTOR3& ) const = &D3DXVECTOR3::operator +;
D3DXVECTOR3 (D3DXVECTOR3::*fopsub)( CONST D3DXVECTOR3& ) const = &D3DXVECTOR3::operator -;
D3DXVECTOR3 (D3DXVECTOR3::*fopunm)( ) const = &D3DXVECTOR3::operator -;
SQClassDef<D3DXVECTOR3>(_T("D3DXVECTOR3")).
func(fopadd, _T("_add")).
func(fopsub, _T("_sub")).
func(fopunm, _T("_unm")).
func(&D3DXVECTOR3::operator *, _T("_mul")).
func(&D3DXVECTOR3::operator /, _T("_div")).
func(&D3DXVECTOR3::operator ==, _T("_cmp")).
var(&D3DXVECTOR3::x, _T("x")).
var(&D3DXVECTOR3::y, _T("y")).
var(&D3DXVECTOR3::z, _T("z"));
This exposes the following operators: +, -, -(unary), *, /, +=, -=, *=, /=, ==, !=
Thanks again, and I hope this post helps someone else out in the future!