Skip to main content

Module scene_io

Module scene_io 

Source
Expand description

Scene I/O — save and load scenes to/from a custom binary format and a human-readable TOML format.

§Binary format (.scene)

magic:   [u8; 8]  = b"PROOFSCN"
version: u32      = SCENE_VERSION
flags:   u32      = SceneFlags bits
--- sections ---
[SectionKind::Entities]
  count: u32
  for each entity: EntityRecord (variable-length)
[SectionKind::Lights]
  count: u32
  for each: LightRecord
[SectionKind::ForceFields]
  count: u32
  for each: ForceFieldRecord
[SectionKind::KitParams]
  count: u32
  for each: KitParamRecord (key:String, value:f32|bool|Vec4)
[SectionKind::Eof]

Strings are length-prefixed u16 UTF-8. Vec3/Vec4 are four f32. All multi-byte integers are little-endian.

§TOML format (.toml)

Human-readable subset; intended for version control diffing. Round-trips perfectly with the binary format for the supported fields.

Structs§

CameraRecord
EntityRecord
ForceFieldRecord
KitParamRecord
LightRecord
Scene
A complete scene in memory.
SceneFlags
SceneMetadata
SceneSerializer
SceneUndoManager
Manages undo/redo for scene-level edits using full-snapshot approach.

Enums§

ForceFieldKind
IoError
KitParamValue
LightKind
SectionKind