Bug when casting FbxVector4 to double
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I discovered an issue with the FBX SDK (2020 but I believe earlier version as well) that affected Mac only. On Xcode, the following code would fail even though it worked fine on Visual Studio.
double* trans = (double*)pNode->GetGeometricTranslation(ePivotSet);
double* rot = (double*)pNode->GetGeometricRotation(ePivotSet);
double* scale = (double*)pNode->GetGeometricScaling(ePivotSet);
double* rot = (double*)pNode->GetGeometricRotation(ePivotSet);
double* scale = (double*)pNode->GetGeometricScaling(ePivotSet);
It seemed that when casting the FbxVector4 value returned from these methods to double, the result would always be a vector with all components set to 1.0.
It seems the casting that was the problem. If I did not cast it to double, the correct results were achieved.