Add support for arbitrary coordinate systems
Opened this issue · 0 comments
Might need to go in a major release as it might be quite a big change.
See #92 for prior discussion.
The idea is to expose to the host runtime a mechanism for specifying the default coordinate system that RTM is compiled with. This would allow it to just work with things like rotation matrices and look at transforms. A template argument could be added to functions that care about it, along the lines of:
template<class coord = RTM_DEFAULT_COORDINATE_SYSTEM>
matrix3x4f look_at(vector4f position, vector4f direction, vector4f up)
Callers can just use loop_at(foo, bar, up)
to use the default coordinate system (the one specified by the host runtime) or they can explicitly provide one (e.g rtm::coord:maya
) for import/export purposes. I haven't seen anything quite like this used out there, so it'll be experimental in a way. Hopefully it pans out without too many complications.
Questions that arise with a design like this:
- Does it scale?
- Is it easy/possible to implement functions that are coordinate system agnostic (e.g. look_at)?
- How do they compose (callers need to expose/propagate the template argument if they wish to be agnostic)?
See how the FBX SDK handles it.
A WIP draft is available in the research/coordinate-system
branch.