Class RealmKeyAttribute
- Namespace
- Typhon.Schema.Definition
- Assembly
- Typhon.Schema.Definition.dll
Marks the ushort field that names the realm an entity is in (Typhon Realms): the frame the archetype's SpatialIndexAttribute
field's coordinates are expressed in. An archetype without one lives in realm 0. Transaction.Teleport moves an entity to another realm at the
next tick fence; so does a WriteSpatial whose value carries a new key, when the key sits in the spatial component itself.
[AttributeUsage(AttributeTargets.Field)]
public sealed class RealmKeyAttribute : Attribute
- Inheritance
-
RealmKeyAttribute
- Inherited Members
Remarks
At most one per archetype, on a SingleVersion component, of type ushort, without IndexAttribute; the archetype must have a spatial component.
Beside the spatial field or in a component of its own. A key of its own keeps a 2D AABB spatial component at 16 bytes, the stride the
SIMD narrowphase requires — measured on the SWG demo, a query-heavy workload loses ~20 % of a tick without it. Realm changes then go through
Transaction.Teleport (or a raw write of the key, found by the fence's dirty scan on a non-barrier archetype).
Constructors
RealmKeyAttribute()
public RealmKeyAttribute()