pub fn remove_component<T: Component>(&mut self) {
        if !self.archetype().layout().has_component::<T>() {
            return;
        }

        let target_arch = {
            let mut source = DynamicArchetype {
                base: self.world.archetypes()[self.location.archetype()]
                    .layout()
                    .clone(),
                add: &[],
                add_constructors: &[],
                remove: &[ComponentTypeId::of::<T>()],
            };
            self.world.get_archetype_for_components(&mut source)
        };
        unsafe {
            let idx = self.world.transfer_archetype(
                self.location.archetype(),
                target_arch,
                self.location.component(),
            );
            self.location = EntityLocation::new(target_arch, idx);
        };
    }
/// Removes a component from the entity.
/// Does nothing if the entity does not have the component.
Removes a component from the entity.
Does nothing if the entity does not have the component.
Removes a component from the entity . Does nothing if the entity does not have the component .
pub fn remove_component<T: Component>(&mut self) {
        if !self.archetype().layout().has_component::<T>() {
            return;
        }
        let target_arch = {
            let mut source = DynamicArchetype {
                base: self.world.archetypes()[self.location.archetype()]
                    .layout()
                    .clone(),
                add: &[],
                add_constructors: &[],
                remove: &[ComponentTypeId::of::<T>()],
            };
            self.world.get_archetype_for_components(&mut source)
        };
        unsafe {
            let idx = self.world.transfer_archetype(
                self.location.archetype(),
                target_arch,
                self.location.component(),
            );
            self.location = EntityLocation::new(target_arch, idx);
        };
    }
pub fn remove_component < T : Component > ( & mut self ) { if ! self . archetype ( ) . layout ( ) . has_component :: < T > ( ) { return ; } let target_arch = { let mut source = DynamicArchetype { base : self . world . archetypes ( ) [ self . location . archetype ( ) ] . layout ( ) . clone ( ) , add : & [ ] , add_constructors : & [ ] , remove : & [ ComponentTypeId :: of :: < T > ( ) ] , } ; self . world . get_archetype_for_components ( & mut source ) } ; unsafe { let idx = self . world . transfer_archetype ( self . location . archetype ( ) , target_arch , self . location . component ( ) , ) ; self . location = EntityLocation :: new ( target_arch , idx ) ; } ; }
Removes a component from the entity.
Removes a component from the entity .
&mut self
&mut self