Sorry this took a while. While fixing the camera rotation animations, I noticed that the solution was inconsistent with both the glTF loader and a related piece of the glTF exporter. It turned out to be a very nasty bug that led to Breaking change in target camera rotations when using right-handed system !
In any case, this PR should address the broken camera rotation animations:
master
← alexchuber:gltf-exporter-cam-fixes
opened 12:51AM - 03 Jun 25 UTC
This PR primarily aims to fix exported camera rotation animations ([see most rec… ent forum post](https://forum.babylonjs.com/t/gltfexport-flipped-camera/45986/22)). While in the area, I've also minorly cleaned up the surrounding camera code.
Fixes:
- Fix camera rotation animation export
- Allow camera nodes' transformations to collapse into parents
- Update CollapseChildIntoParent to disregard parent scaling
- Add tests for camera animation export
- Ensure rotation and rotationQuaternion are mutually exclusive in _setNodeTransformation and _setCameraTransformation
Cleanup nits:
- Renames CollapseParentNode -> CollapseChildIntoParent, and IsParentAddedByImporter -> AreCollapsible
- Remove unused RotateNode180Y and ConvertToRightHandedNode
- Use TargetCamera instead of Camera, as Camera doesn't have TRS fields.
- Simplify rotation animation export
- Move camera transformation export into _setCameraTransformation
- Clarify that CollapseChildIntoParent only accepts light and camera-type children
Misc:
- Allow KHR_punctual_lights to throw a warning for non-shadow lights
- Change usages of .equals() to .equalsWithEpsilon(), using Epsilon constant from math package
1 Like