Skip to main content

concinnity_core/components/
parent.rs

1// src/components/parent.rs
2
3use crate::ecs::Entity;
4
5/// The entity whose world transform this entity inherits.
6///
7/// Runtime-only. When present, this entity's `Transform` is relative to the
8/// parent's world transform. Carries the relationship a `Prop` declares with
9/// its `parent` field, resolved from a name to a live `Entity`.
10#[derive(Debug, Clone, Copy)]
11pub struct Parent(pub Entity);
12
13impl Default for Parent {
14    fn default() -> Self {
15        // Never observed: Parent is inserted at runtime with a real parent, not
16        // built from serialized args.
17        Parent(Entity::dangling())
18    }
19}