Skip to main content

Module world

Module world 

Source

Structs§

CameraComponent
A camera lens attached to an entity. active marks the single camera entity Play mode should look through — a bool flag rather than a separate “active camera entity” reference, since entities aren’t referenced by stable ID across a scene save/load (scripts look entities up by name for the same reason). The UI is responsible for keeping at most one entity’s flag set (radio-button semantics, see editor::draw_camera_editor); World::active_camera defends against more than one somehow being set by just using the first it finds.
Name
Transform
Position/rotation/scale, kept as separate fields (rather than a raw Mat4) so an editor inspector can show and edit them independently. The ECS component is the source of truth; Renderable::sync_transform copies it into the actual GPU-facing Sprite/Model matrix each frame via Transformable::set_transform.
World
A spatial container of entities, distinct from crate::scene::Scene (which means “game state/screen” in this framework, not a place). Each entity is a Transform plus a Renderable and an optional Name.

Enums§

Renderable
What an entity draws as. An entity is a sprite or a model, never both, so this is one enum rather than two parallel component stores that would otherwise need to be kept in sync.