import type { Document } from '@gltf-transform/core'; /** * WHICH SURFACES THE CAMERA IS INSIDE, DECLARED BY THE AVATAR. * * In first person the camera rides the head bone, so anything skinned to the head is around the lens: the face * fills the view, hair cards cut through the near plane, ears clip in from the sides. The engine already * handles this — `CameraRig` ref-counts a hide request per mesh-name matcher, pops it for the look-down * embodiment and pops it again for the selfie camera so your own face is in your own photo. * * What it could not handle was an avatar that is not Base Male. The matcher list defaulted to `['FaceMesh']`, * which is the name of one mesh in one first-party pack. An imported VRoid avatar's head mesh is called * `Face (merged).baked`; the substring never matched, nothing was ever hidden, and every imported character * put its own face through the camera in first person. A convention that only one asset satisfies is not a * contract — so the avatar now DECLARES its head surfaces and the runtime reads them. * * Selection is by skin weight, not by name. A mesh is head-attached when the overwhelming majority of its * weight sits on the head joint or something descended from it, which is true of a face, a hair card and a cat * ear, and false of a torso that happens to have a collar near the neck. Names are unreliable across exporters * in exactly the way this whole problem demonstrates. */ /** * The vertices a primitive actually draws. * * VRoid shares one JOINTS_0/WEIGHTS_0 accessor across every primitive in a mesh, so reading the whole * attribute answers a question about the MESH, not about this surface — and every primitive in `Body * (merged).baked` then gets the same verdict, which put the cat ears in the same bucket as the shoes. Only the * indexed vertices belong to this primitive. */ export declare function primitiveVertices(primitive: import('@gltf-transform/core').Primitive): Set; export interface FirstPersonHideResult { /** Runtime mesh names to hide, in the form `GLTFLoader` will produce them. */ readonly meshes: string[]; /** Runtime mesh names to draw ONLY in first person (`firstPersonOnly`), concealed in the third-person view. */ readonly thirdPersonHide: string[]; /** Primitives examined, for the report. */ readonly examined: number; } /** * The avatar's own answer for a mesh, from the VRM's `firstPerson.meshAnnotations`. * * `thirdPersonOnly` is the file saying "do not show this from inside my head" — that is the same question * `firstPersonHide` answers, and the file's answer beats our weight heuristic because it is authored. It covers * things no weight rule finds (a coat that clips the lens, a prop in front of the face) and excludes things the * rule would take (a mask the wearer should see). `firstPersonOnly` is the inverse: a dedicated FP body, an * interior mouth — drawn only from inside. `both` is the file saying "always draw this" (a collar the rule would * otherwise take), so it is never hidden. `auto` defers to the rule. */ export type FirstPersonAnnotation = 'thirdPersonOnly' | 'firstPersonOnly' | 'both' | 'auto'; /** VRM 0.x spells the flag PascalCase (`ThirdPersonOnly`), 1.0 camelCase; anything else is not an annotation. */ export declare function firstPersonAnnotation(value: unknown): FirstPersonAnnotation | undefined; /** * Runtime names for a mesh's primitives. * * `GLTFLoader` splits a multi-primitive mesh into one `Mesh` per primitive, naming the first after the mesh and * suffixing the rest `_1`, `_2`… Matching is by substring, so the base name alone would hide every primitive in * the mesh — which is wrong for a body mesh that carries the ears as one primitive among many. */ export declare function runtimeName(meshName: string, primitiveIndex: number): string; /** * Find every primitive the first-person camera sits inside, and write the list into each scene's extras. * * Returns the names rather than only stamping them so the caller can report what it hid — an avatar that * declares nothing is a first-person bug waiting to be filed, and it should be visible at import time. */ export declare function declareFirstPersonHide(document: Document, annotations?: ReadonlyMap): FirstPersonHideResult;