logo
pub struct Layer { /* private fields */ }
Expand description

Layer component.

Use to group and identify entities. An added layer to an entity will have its mask initialized to 1 (belonging to the first layer).

Implementations

Returns a ValueAccessor for the layer mask of the entity.

Used to set/get the layer mask. It is a bit mask that can be used for filtering collisions, spatial queries among other things.

Utility function to set to a single layer (an entity can be a member of multiple).

Generates a layer mask from an index (max index is 63)

Trait Implementations

The type of the component, as a ComponentType enum.

Adopt an Entity, wrap in a component struct.

Get the entity that the component belongs to.

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.