UnrealPackageReader.js
    Preparing search index...

    Interface MeshVertex

    A single vertex position (FMeshVert), packed into one 32-bit word.

    11 bits for X and Y and 10 for Z, each a fixed-point value - X and Y divide by 8, Z by 4 - and each sign-corrected by subtracting 256 above the midpoint. The packing costs precision but quarters the size of a mesh, which mattered a great deal in 1998.

    The layout is game-specific rather than version-specific: Deus Ex widens it to 64 bits, 16 bits per axis at 1/256 precision, which cannot be told apart from the standard form by the package version alone. Choosing between them would need engine-fork detection, which this reader does not attempt, so the Deus Ex unpacking is recorded here:

    const xyz = cursor.bigUint64();

    let x = Number(xyz & 0xffffn) / 256;
    let y = Number((xyz >> 16n) & 0xffffn) / 256;
    let z = Number((xyz >> 32n) & 0xffffn) / 256;

    if (x > 128) x -= 256;
    if (y > 128) y -= 256;
    if (z > 128) z -= 256;
    interface MeshVertex {
        x: number;
        y: number;
        z: number;
    }
    Index
    x y z
    x: number
    y: number
    z: number