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

Utility for submitting message queues and collecting message responses.

For this to work, you must call EntityMessenger::get().process_messages(); first thing in your world_update.

Implementations

Poll a spatial query request to see if a result has been received.

Poll an animation request to see if a reply has been received.

Register this entity as a listener for collision events

The entity needs a Physics component for this to work. If its collision events mask is set to 0 this function will automatically set it to listen to collisions from all layers (!0u64).

Register this entity as a listener for trigger events

The entity needs a Physics component for this to work. If its collision events mask is set to 0 this function will automatically set it to listen to collisions from all layers (!0u64).

Will return a collision if is has been received, otherwise register a listener for collisions (collisions will be returned in a later invocation if they happen).

Will return a trigger event if is has been received, otherwise register a listener for trigger events (trigger events will be returned in a later invocation if they happen).

Returns a global EntityMessageQueue that can be used to send delayed messages from anywhere.

This can be called anytime to send away all globally pending messages, will otherwise be called from process_messages

Submits an EntityMessageQueue

An EntityMessageQueue will however automatically be submitted when it goes out of scope.

Creates a new EntityMessageQueue that can be used for sending messages.

Turn this on to allow sending messages to dead entities Useful for debugging

This needs to be called first once per frame in the world update function as it sends pending messages and processes incoming messages and builds a database of all replies gathered.

These replies will be cleared every frame so one need to poll for replies every frame if one is expecting them.

Get the EntityMessenger singleton.

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.