Module ecs

Module ecs 

Source
Expand description

Implements Khora’s custom Chunked Relational Page ECS (CRPECS).

This module contains the complete implementation of the engine’s Entity-Component-System, which is the heart of the [D]ata layer in the CLAD architecture.

The CRPECS is designed from the ground up to enable the Adaptive Game Data Flows (AGDF) concept from the SAA philosophy. Its key architectural feature is the dissociation of an entity’s identity from the physical storage of its component data, which allows for extremely fast structural changes (adding/removing components).

The primary entry point for interacting with the ECS is the World struct.

Structs§

ActiveEvents
Indicates that an entity should receive collision events. By default, the physics engine does not report collisions for every entity to save on performance. Adding this component enables reporting for this entity.
AudioListener
An ECS component that defines the point of audition in the scene.
AudioSource
An ECS component that makes an entity an emitter of sound.
Camera
A component that defines a camera’s projection parameters.
Children
A component that lists the direct children of an entity.
Collider
Component representing a collider attached to an entity.
CollisionEvents
A component that stores collision events for the current frame. Typically attached to a singleton entity or used as a resource.
CollisionPair
A pair of entities that are potentially colliding.
CollisionPairs
A component that stores potential collision pairs identified during broadphase.
ComponentPage
A page of memory that stores the component data for multiple entities in a Structure of Arrays (SoA) layout.
ComponentRegistry
A registry that maps component types to their semantic domains.
DomainBitset
A simple bitset wrapped around a Vec<u64>.
DomainStats
Simple statistics for a semantic domain.
EntityMetadata
Represents the central record for an entity, acting as a “table of contents” that points to the physical location of its component data across various ComponentPages.
GlobalTransform
A component that stores the final, calculated, world-space transformation of an entity.
HandleComponent
A generic ECS component that associates an entity with a shared asset resource. It holds both a handle to the loaded data and the asset’s unique identifier.
KinematicCharacterController
Component for kinematic character movement. It provides high-level movement resolution (slopes, steps, etc.) that is more suitable for player characters than raw rigid-body physics.
Light
A component that adds a light source to an entity.
MaterialComponent
A component that attaches any type of material to an entity.
PageIndex
A logical address pointing to an entity’s component data within a specific ComponentPage.
Parent
A component that establishes a parent-child relationship.
PhysicsDebugData
Component that holds debug rendering data for the physics simulation.
PhysicsMaterial
Defines the physical properties of a collider surface.
PlaybackState
The internal playback state of an active sound. This will be managed by the AudioMixingLane.
Query
An iterator that yields the results of a WorldQuery.
QueryMut
An iterator that yields the results of a mutable WorldQuery.
QueryPlan
A pre-calculated execution strategy for a specific set of component types.
RigidBody
Component representing a rigid body in the physics simulation.
SerializableParent
Serializable representation of a Parent component.
SerializableTransform
Serializable representation of a Transform component.
Transform
A component that describes an entity’s position, rotation, and scale relative to its Parent. If the entity has no Parent, this is relative to the world origin.
TypeRegistry
A registry that provides reflection data, like type names.
Without
A WorldQuery filter that matches entities that do NOT have component T.
World
The central container for the entire ECS, holding all entities, components, and metadata.

Enums§

AddComponentError
Errors that can occur when adding a component to an entity.
ProjectionType
Defines the type of camera projection.
QueryMode
Defines whether a query can be executed “natively” or requires a transversal join.
SemanticDomain
Defines the semantic domains a component can belong to.

Traits§

AnyVec
An internal helper trait to perform vector operations on a type-erased Box<dyn Any>.
Component
A marker trait for types that can be used as components in the ECS.
ComponentBundle
A trait for any collection of components that can be spawned together as a single unit.
WorldMaintenance
A trait providing low-level access to the World for maintenance tasks.
WorldQuery
A trait implemented by types that can be used to query data from the World.