Skip to content

Engine → Scene

scene.h

One authored scene over one ecs::world: roots in order, the hierarchy and transform operations, names, tags, layers, guids, enabled state, the destroy queue and the archive instantiation shared by scene files, prefabs, duplication and snapshots. Every method is owner-thread only (the world's rules apply); observers registered in the constructor keep the children cache, the guid index and the transform companions consistent when scripts reach the raw ECS.

Structs

File Description
instantiate_options Placement and guid handling of an archive instantiation.
instantiate_report What an instantiation produced.
root_entry One root of the scene and the loaded scene asset it belongs to.
scene::repair_entry One hierarchy repair scheduled for scene.apply_hierarchy_changes. A deferred_set_parent entry carries the parent the caller's command buffer installs at its flush (hasIntent): the repair waits until the live parent component agrees, since the flush may land after the TRANSFORM phase that first sees the entry.
scene_id Identity of a loaded scene asset inside a scene_manager. Generation 0 means "none".

Classes

File Description
scene
scene::operation_scope Marks a scene operation: observers skip their bookkeeping while one is running.

Enumerations

guid_policy

enum class guid_policy : u8 {
    KEEP,                     // every guid kept (a null one stays null); a collision is DUPLICATE_GUID
    REGENERATE_ON_CONFLICT,   // colliding entries get fresh guids (one WARN per call), null guids too
    REGENERATE_ALL            // every entity gets a fresh guid (prefabs, duplicates, count > 1)
};

What happens to the guids of an archive when it is instantiated.

reparent_mode

enum class reparent_mode : u8 {
    KEEP_WORLD,               // the local transform is recomputed so the world pose stays where it is
    KEEP_LOCAL                // the local transform is kept: the world pose follows the new parent
};

Which transform a reparent preserves (scene::set_parent, scene::deferred_set_parent). An enum rather than a bool so a sibling index cannot bind to the mode by mistake.

Forward Declarations

detail::archive_shape

struct archive_shape;

Constants

Name Type Value Description
SCENE_ID_AUTHORED inline constexpr scene_id scene_id{0, 1} The implicit owner of entities created by hand (not loaded from a scene asset).