Model loading · function

convertHandedness

Mirror an asset into the engine's right-handed frame, in place.

Explained in Importing models.

function convertHandedness(meshes: readonly MeshData[]): void
import { convertHandedness } from '@driftengine/assets';

Parameters

ParameterTypeDescription
meshesreadonly MeshData[]

In depth

This is the one thing the TURNS table above deliberately cannot do, and the paragraph at the top of this file explaining why is still correct: an up-axis correction must be a rotation, or it flips geometry that was already the right way round. A handedness conversion is the opposite case — the geometry is genuinely mirrored, and refusing to mirror it is what would leave it wrong. Keeping the two apart is what lets each stay honest about what it does.

Three changes, and all three or none. Negating X alone turns every triangle inside out; reversing the winding without flipping the bitangent sign lights every normal-mapped surface backwards. Doing them together, here, is why this is a function and not three lines inside a reader — the next left-handed format gets the same conversion and the same tests.

UVs are untouched. A mirror moves the surface, not its parameterisation.