pub struct Parent {
pub entity: Entity,
pub offset: Vec2,
}Expand description
Puts an entity at another’s position plus offset: the system
nadir::parent_offsets writes its Transform after each tick’s
movement, and frames draw it at its parent’s drawn position plus the
offset.
A parent may have a parent of its own: a child goes with the first
entity up the chain that has none, its root, by the offsets along the
way, up to 8 steps. Entities on the way need no Transform. A child
whose chain is longer, or loops, or ends at an entity without a
Transform (one that was despawned, say) is left where it is.
It is not reflected until saves bring the Entity encoding (roadmap
M9.4, ADR-0020).
Fields§
§entity: EntityThe entity it goes with.
offset: Vec2Where it is from that entity, in pixels.
Trait Implementations§
impl Component for Parent
impl Copy for Parent
impl StructuralPartialEq for Parent
Auto Trait Implementations§
impl Forget for Parent
impl Freeze for Parent
impl Move for Parent
impl RefUnwindSafe for Parent
impl Send for Parent
impl Sync for Parent
impl Unpin for Parent
impl UnsafeUnpin for Parent
impl UnwindSafe for Parent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more