On 26/05/2016 at 08:18, xxxxxxxx wrote:
Not 100% sure about R12, but I would be surprised if it didnt contain a matrix inverse implementation.
/*!
\* Invert a Matrix. The Cinema 4D API has changed the operator
\* to invert a matrix in R15 and this is what this function handles.
\*/
inline Matrix invert_matrix(const Matrix& mat)
{
#if API_VERSION < 15000
return !mat;
#else
return ~mat;
#endif
}
It's usually simpler to develop with pre-R15 versions due to the name changes and then use the Legacy API mode in R15 and R16. Usually,
plugins compiled with older versions will also load in newer ones.
If however you need to recompile for R17 in that case, you need to
copy the legacy header or write one by yourself.
Since you started in R17 it might be easier to just write a "legacy header"
for the reverse to support pre R15 API. It's not always doable just by
preprocessor defintitions so sometimes you need to write different code
for differen versions. Especiallyy if you want to use maxon::BaseArray
or maxon::HashSet etc. in older versions.
-Niklas