Ybalrid/Annwvyn

Add implicit convertion operators on mathematical types

Ybalrid opened this issue · 3 comments

Vectors and Quaternions could benifit from being easilly convertible to their equivalent in other libraries explicitly (e.g. bullet)

This would permit this kind of syntax:

AnnQuaternion q = /*some value*/;
btQuaternion btq = /*some other value*/;

btQuaternion copoundedRotation = btq * q; //Currently impossible, would requirer to call q.getBtQuaternion();

What needs to be added is this kind of methods to the vector classes :

class V
{
    /*all the content*/

    operator OtherType() const
    {
         return getConvertionToOtherType();
    }
};

AnnVect3 -> BtVector3 done

AnnQuaternion -> btQuaternion done

This is basically done.