An Entity Identifier Can Be Either Unique or Nonunique.
Components
Entities themselves cannot comprise custom logic. Instead, they can compriseComponents. For case, a Camera component could be attached to an entity, exposing functionality for rendering a specific viewpoint in the level:
Entities are stored and managed in theEntity Organisation, represented by the IEntitySystem interface, and accessible through gEnv->pEntitySystem . The arrangement is responsible for spawning, managing entities throughout their lifetime, and finally removing them. See IEntitySystem::SpawnEntity for an example on how to spawn entities.
Identifiers
Afterwards being spawned, each entity is assigned an entityidentifier, represented by the EntityId type definition. Entity identifiers are 32-bit and consist of two parts: a 16-bitsalt, used to facilitate re-use of each index without resulting in Entity Identifiers existence reused over the lifetime of the application, and a 16-bitindex, representing theposition of the entity in the entity organisation'southward internal storage. This allows for abiding-time retrieval of an entity, as we tin can simply look upwardly an entity by index in contiguous storage.
This means that despite being a 32-bit unsigned integer, the index is simply 16 bits – resulting in a max limit of 65533 entities in the globe at whatsoever given time(0 and 65534+ are reserved).Whatever game expecting to exceed this number would demand to stream in logical entities using a custom setup tailored for the projection.
Globally Unique Identifier
Entities are likewise assigned globally unique identifiers, noted by theEntityGUID type definition. These identifiers differ from entity IDs in that they are guaranteed to exist the same when saving and loading entities – allowing the Editor and other systems to track which entity belongs where.
EntityIds are not unique across sessions or over the network. The aforementioned entity in a multiplayer match is very likely to accept different identifiers on two clients.
The multiplayer aspect of this applies to EntityGUIDs equally well – please see Entity Networking to find out how entities can be identified over the network.
Transform & Parent / Child Hierarchy
Entities in CRYENGINE have a transform by default, meaning they have location, orientation and scale in relation to their parent (and if no parent, to the earth). We can retrieve the world transformation through the following functions:
Similarly, we can change the world transformation easily using
Hierarchy
Entities tin exist linked together in a bureaucracy, ensuring that the entity'south position is relative to the parent. This is useful to pair entities together in a parent / child relationship where the child should e'er follow its parent.
An entity tin can exist linked to a parent at spawn fourth dimension, or at any signal during an during an instance's lifetime.
In one case linked, nosotros can recollect the local-space transformation (relative to the parent) of the entity through the following functions:
The local transformation tin can be modified using
Slots / Entity Geometry
Entities tin can contain geometry, handled via the concept of Slots. Any entity can load geometry into slots, assuasive them to either be rendered or treated every bit a physical part. This is made possible through the following functions in IEntity
:
For more than information, meet Slots, Geometry and Effects.
Conclusion
This concludes the commodity on entities. You may also exist interested in:
- Components
- Execution Order and Lifecycle
- Networking
Source: https://docs.cryengine.com/display/CEPROG/Entity
0 Response to "An Entity Identifier Can Be Either Unique or Nonunique."
Enregistrer un commentaire