Expand description
Compact, optional vertex-normal field sidecar for compiled mesh assets.
The existing QuantizedMesh payload remains byte-for-byte stable. This field sidecar stores unit normals as two signed normalized 16-bit octahedral coordinates (4 bytes per vertex).
Structs§
- Mesh
Frame Decode Limits - Admission limits apply equally to borrowed decoding and cold owned output. Decoded bytes count only active streams (12 bytes/normal, 16 bytes/tangent). They bound logical output storage, not allocator bookkeeping or the envelope.
- Mesh
Frame Layout - Fully validated active stream layout; no borrowed typed cast is required.
- Mesh
Frame Streams - Normal and tangent data decoded from one vertex-aligned FieldSidecar.
Enums§
Constants§
Functions§
- decode_
mesh_ frames - Decode either the legacy NRM1 stream or the combined FRM1 normal/tangent stream.
- decode_
mesh_ frames_ into - Decode all present streams into caller storage. Absent streams and buffer
tails remain untouched. A present stream requires at least
layout.countslots, even if the caller only plans to consume the other stream. Every validation and capacity error leaves BOTH outputs unchanged. - decode_
mesh_ frames_ with_ limits - Cold convenience API. Full admission precedes any allocation; requested
vector capacities fit the explicit decoded-byte budget. Allocation refusal
is an error, not an unchecked
with_capacitypanic. The hot API is_into. - decode_
normals - Decode vertex normals from a normal-only or combined mesh-frame FieldSidecar.
- decode_
tangents - Decode vertex tangents and handedness from a combined mesh-frame FieldSidecar.
- encode_
mesh_ frames - Encode normal and tangent streams in an interleaved, vertex-aligned FRM1 sidecar. Normals-only data retains the existing NRM1 representation for byte-stable containers.
- encode_
normals - Encode normalized vertex normals into a caller-owned payload buffer.
- encoded_
len - Byte size of a normals-only (NRM1) section for
countvertices (header + 4 bytes per vertex);Noneon overflow. - frame_
encoded_ len - Byte size of an interleaved FRM1 frame section for
countvertices, with 4-byte normals and/or 8-byte tangents per vertex.Nonewhen neither stream is present or on overflow. - inspect_
mesh_ frames - Validate the entire payload, including every late tangent, without mutation or allocation. Unaligned bytes and LE headers share the native/WASM path.
- is_
normal_ section - Whether a FieldSidecar payload uses the per-vertex normal codec.