nightshade 0.8.0

A cross-platform data-oriented game engine.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use freecs::Entity;

/// Establishes a parent-child hierarchy relationship.
///
/// When an entity has a [`Parent`], its [`super::LocalTransform`] is relative to
/// the parent's world-space transform. The transform propagation system computes
/// [`super::GlobalTransform`] by multiplying transforms up the hierarchy.
///
/// Use `Parent(None)` to explicitly mark an entity as a root (equivalent to no Parent component).
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, serde::Serialize, serde::Deserialize)]
pub struct Parent(pub Option<Entity>);