Skip to main content

Module surface

Module surface 

Source
Expand description

The surface paint chunk (SPEC.md, section 10): what a person painted on the faces of models, one mask per leaf and kind.

Only the envelope is checked: each entry names a leaf, and no two entries share a leaf and a kind. Documents are carried without being read, since a document never makes a file unreadable; the program that uses the paint checks it against the leaf’s mesh.

entries   u32 count, then per entry:
          u32 the leaf's node index in the scene chunk
          u8  the kind: 0 detail, 1 supports must touch, 2 must not touch
          u32 document version
          u32 length, document

Structs§

SurfaceEntry
One painted mask of one leaf.

Enums§

DecodeSurfaceError
Why a surface paint payload could not be decoded.
EncodeSurfaceError
Why a list of paint entries could not be encoded.

Constants§

SURFACE_TAG
The tag of the surface paint chunk.
SURFACE_VERSION
The surface paint payload layout this build writes and reads.

Functions§

decode_surface
Decodes a surface paint payload, checking it against scene, the scene of the same file.
encode_surface
Encodes entries as a surface paint payload, in their order, checking them against scene.