Description
when exporting .mesh files, axis swapping optionally bakes-in a rotation, like 90° around x resulting in xz-y.
When exporting .scene, we also have to rotate the nodes for consistency. This poses the following problem:
Node
| \
| \
Light Mesh
lets say a car with some headlights.
To apply the xz-y transform, to the light, we must rotate the node as described above. However, currently we also bake the rotation to the mesh, so the transform will be applied twice and the result is wrong.
The easiest solutions (considering multiple cars) is to add an intermediate node as:
Node (rotate 90° around x)
|
|
Node
| \
| \
Light Mesh (no swapping)
this way all entities will be only rotated once.
However, given that the current Ogre API for loading .scene looks like:
https://ogrecave.github.io/ogre/api/14/class_ogre_1_1_scene_node.html#aee2ef1147dd19f9195babeb676da377c
it is trivial to do the swapping in user code as:
node->pitch(Degree(90), Vector3::X_AXIS);
node->loadChildren(...);
therefore, I would just disable swapping when exporting .scene