Skip to content

Engine → Physics

register.h

Registration entry points the engine's physics_subsystem calls: the eight component types (startup step 12, after scene::register_components), the collision mesh asset type with its importer, and the four systems.

Constants

Name Type Value Description
SYSTEM_CONTACT_EVENTS inline constexpr core::string_id {"physics.contact_events"}
SYSTEM_PULL_TRANSFORMS inline constexpr core::string_id {"physics.pull_transforms"}
SYSTEM_PUSH_TRANSFORMS inline constexpr core::string_id {"physics.push_transforms"}
SYSTEM_STEP inline constexpr core::string_id {"physics.step"}

Functions

Public

register_asset_types

[[nodiscard]] CONJURE_API core::result<void> register_asset_types(
    assets::asset_type_registry &types,
    assets::importer_registry &importers);

Registers conjure.physics.collision_mesh (version 1) with its CPU-only loader and its importer, which claims .obj by extension and also reads a .gltf or .glb whose .meta names it.

register_components

[[nodiscard]] CONJURE_API core::result<void> register_components(
    ecs::component_registry &registry);

Registers rigid_body, the five colliders, physics_material and character_controller in a fixed order. Idempotent per registry; errors are the registry's (NAME_CONFLICT, ...).

register_systems

[[nodiscard]] CONJURE_API core::result<void> register_systems(
    ecs::scheduler &scheduler,
    physics_world &world);

Adds physics.push_transforms and physics.step (PHYSICS_STEP, MAIN_THREAD) and physics.pull_transforms (FIXED_END, PARALLEL) and physics.contact_events (FIXED_END, MAIN_THREAD). None runs while paused. NOT_ATTACHED before physics_world::attach. The world must outlive the scheduler. Call once per scheduler: a second call returns NAME_CONFLICT from its first system and adds nothing.