std::ostream & operator <<( std::ostream & out, const D3DXVECTOR3 & vec)
out << "[" << vec.x << ", " << vec.y << ", " << vec.z << "]";
The function above is what im trying to achieve and from the previous topic i opened up.
I tried to implement it in my program but to no avail, though i understand some of it but can anyone see what im doing wrong?
The code below is what im currently using:
D3DXVECTOR3 TargetVector(D3DXVECTOR3 *Out, D3DXVECTOR3 *target, D3DXVECTOR3 *firer)
v.x = target->y * firer->z - target->z * firer->y;
v.y = target->z * firer->x - target->x * firer->z;
v.z = target->x * firer->y - target->y * firer->x;
*Out = v;
D3DXVECTOR3 TargetVector(D3DXVECTOR3 *Out, D3DXVECTOR3 *target, D3DXVECTOR3 *firer);
Current code that i implemented:
cout<<&operator<<(cout<<&Out, const D3DXVECTOR3 v);
This is what im currently working with though its coming up with some errors with the "const" and "v".
I tried to make it clear as possible but if you need additional code that might help i can quickly grab it.
Probably you misunderstood my reply.
You actually had to copy-paste that snippet of code, lol.