Skip to content

Use coordinate_system utility in glTF I/O#1089

Open
yutingye wants to merge 3 commits intomainfrom
export-D95260372
Open

Use coordinate_system utility in glTF I/O#1089
yutingye wants to merge 3 commits intomainfrom
export-D95260372

Conversation

@yutingye
Copy link
Contributor

@yutingye yutingye commented Mar 5, 2026

Summary:
Refactor io/gltf/utils/coordinate_utils.h to use the new
math/coordinate_system.h utility for vector unit conversions.

Defines kGltfCoordinateSystem = {Y-up, Right, Meter} and uses
scaleFactor() instead of hardcoded toCm()/toM() constants.

Quaternion component reordering (glTF xyzw vs Eigen wxyz) is
preserved as-is -- this is a data format concern, not a coordinate
system operation.

No behavior change -- this is a pure refactor.

Differential Revision: D95260372

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Meta Open Source bot. label Mar 5, 2026
@meta-codesync
Copy link
Contributor

meta-codesync bot commented Mar 5, 2026

@yutingye has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95260372.

yutingye added 3 commits March 4, 2026 22:26
Summary:

Add a lightweight coordinate system utility to momentum/math/ for converting
vectors, quaternions, and rotation matrices between coordinate systems with
different up axes, handedness, and length units.

This consolidates coordinate transform logic that was previously scattered
across the codebase (io/gltf/coordinate_utils.h,
io/marker/conversions.h) into a single, well-tested utility.

API: CoordinateSystem struct + free functions (changeVector, changeQuaternion,
changeRotationMatrix) with toMomentum*/fromMomentum* convenience wrappers.

Also updates BUCK to add coordinate_system as a dependency for io_marker and
io_gltf targets, which will be used in subsequent diffs in this stack.

Differential Revision: D95260371
Summary:

Refactor io/marker/conversions.cpp to use the new math/coordinate_system.h
utility for unit conversion (scaleFactor), eliminating the manual Unit switch.

The axis remapping is preserved exactly as-is because the marker I/O
internally uses a Z-up convention, which is inconsistent with momentum's
canonical Y-up. Fixing this requires downstream validation and is deferred.

No behavior change -- this is a pure refactor.

Differential Revision: D95260370
Summary:
Refactor io/gltf/utils/coordinate_utils.h to use the new
math/coordinate_system.h utility for vector unit conversions.

Defines kGltfCoordinateSystem = {Y-up, Right, Meter} and uses
scaleFactor() instead of hardcoded toCm()/toM() constants.

Quaternion component reordering (glTF xyzw vs Eigen wxyz) is
preserved as-is -- this is a data format concern, not a coordinate
system operation.

No behavior change -- this is a pure refactor.

Differential Revision: D95260372
@meta-codesync meta-codesync bot force-pushed the export-D95260372 branch from c0268e8 to c7539eb Compare March 5, 2026 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant