Skip to content

Engine → Scene

components.h

The scene components. Plain structs with camelCase fields, named "conjure.scene.<name>" and registered in a fixed order by register_components() (register.h) so the ids agree in every world of a process. The hierarchy is parent (the single serialised truth) plus the TRANSIENT children cache; depth is encoded as one depth_tag<D> per level so the transform pass can run one level at a time over chunks. interpolated_transform is defined here but added, written and removed by physics.

Structs

File Description
children Cache of the children in sibling order, rebuilt from parent on load (TRANSIENT).
conjure::ecs::component_name<conjure::scene::depth_tag<Depth>>
depth_tag Depth marker: entities at hierarchy depth Depth carry depth_tag<Depth>; roots carry none (TRANSIENT, EDITOR_HIDDEN). Registered as "conjure.scene.depth_01" .. "conjure.scene.depth_31".
detail::depth_tag_name Static storage for the name of one depth tag so a string_view may point at it.
disabled Self state: the entity is switched off (serialised as {}).
guid Editor identity, indexed by guid_index.
inactive On every descendant of a disabled entity; consumers filter without<disabled>().without<inactive>() (TRANSIENT, EDITOR_HIDDEN).
interpolated_transform World-space poses of the two most recent fixed steps. Scene defines and registers it; physics adds, writes and removes it.
layer Layer 0..31, a grouping index for find_by_layer, scripts and the editor; names live in layer_table. It does not decide what a camera draws: mesh_renderer_component::layerMask against the camera's layerMask does (the same bit numbering), and sprites are not masked. Captures (snapshot, save, duplicate, prefab) and instantiate_archive refuse an index of 32 or more with BAD_FORMAT.
local_bounds Local-space bounds written by engine subsystems; scene::world_bounds transforms them (TRANSIENT).
local_transform Position, rotation and scale relative to the parent (or to the world for roots). Byte-identical to math::transform and mirrored by the C# LocalTransform struct.
name Display name, interned in every configuration.
parent Link to the parent entity plus the position among its siblings. Roots have no parent component.
prefab_instance On the root of a prefab instance: the prefab asset it was instantiated from (24 bytes, the C# PrefabInstance mirror).
prefab_link On every entity instantiated from a prefab: the guid of the matching entry in the prefab file.
render_world_transform What renderer extraction reads: the world matrix, or the interpolated pose for physics-driven entities and their descendants (TRANSIENT).
scene_component_ids The component ids of every scene component in one registry, resolved once (depth[0] is INVALID: roots carry no tag).
tag Gameplay tag.
transform_dirty Set by structural hierarchy changes; cleared by the propagation pass (TRANSIENT, EDITOR_HIDDEN).
transform_state Bookkeeping of the propagation pass: the run that last recomputed the world matrix (children compare it against the current run), the flags, and the pending mark the parent's level pass sets on a child that must be revisited this run (its parent recomputed, sits in an interpolated subtree or changed flags); the child's level clears it. The mark lets a level find its dirty rows with a sequential scan of this column instead of a parent lookup per row (TRANSIENT, EDITOR_HIDDEN).
world_transform Simulation truth: the world matrix computed by scene.propagate_transforms (TRANSIENT).

Enumerations

transform_state_flags

enum class transform_state_flags : u8 {
    NONE = 0,
    INTERPOLATED_SUBTREE = 1 << 0    // self or an ancestor carries interpolated_transform
};

Per-entity propagation flags.

Forward Declarations

prefab_asset

struct prefab_asset;

Constants

Name Type Value Description
APPEND_CHILD inline constexpr u32 0xFFFFFFFFu Sibling index meaning "after the last child" (or "after the last root").
detail::DEPTH_TAG_NAME_LENGTH inline constexpr usize DEPTH_TAG_PREFIX.size() + 2
detail::DEPTH_TAG_PREFIX inline constexpr std::string_view "conjure.scene.depth_"
MAX_HIERARCHY_DEPTH inline constexpr u32 32 Depth 0 is a root; children carry depth_tag<1> .. depth_tag<31>.
SCENE_FORMAT_VERSION inline constexpr u32 1 Version written into every scene and prefab file; a newer version is UNSUPPORTED_VERSION.

Macros

CONJURE_COMPONENT

CONJURE_COMPONENT(conjure::scene::parent, "conjure.scene.parent")

CONJURE_ENUM_FLAGS

CONJURE_ENUM_FLAGS(transform_state_flags)

CONJURE_REFLECT_STRUCT

CONJURE_REFLECT_STRUCT(conjure::scene::parent, "conjure.scene.parent", CONJURE_FIELD(value), CONJURE_FIELD(siblingIndex, .readOnly = true))

Functions

Public

detail::make_depth_tag_name

[[nodiscard]] constexpr std::array<char, DEPTH_TAG_NAME_LENGTH> make_depth_tag_name(u8 depth) noexcept;

Builds "conjure.scene.depth_DD" at compile time.