Transfer an entity to a spatial domain
After a custom app or service app creates an entity, the app must transfer the
entity to a spatial domain in order for the entity to exist spatially in the
simulation. Entities in a spatial domain can be read by other apps and updated by a
spatial app. Use the ModifyEntityDomain()
API to transfer an entity to a spatial
domain.
AWS_WEAVERRUNTIME_API Result<void> ModifyEntityDomain(Transaction& txn, const Entity& entity, DomainId domainId) noexcept;
If the DomainId
doesn't match the assigned Partition
of the calling app, then the
DomainId
must be for a DomainType::Spatial
Domain
. The ownership transfer to the new
Domain
occurs during the Commit(Transaction&&)
.
Parameters
txn
The current
Transaction
.entity
The target
Entity
for the change ofDomain
.domainId
The
DomainId
of the destinationDomain
for theEntity
.
This API returns Success
if the entity domain was successfully changed.