DetPhysDocs日本語

detphys.hworld, step, hash, workers, snapshots (version 2)

FunctionDescription
detphys_abi_versionThis header's version (DETPHYS_ABI_VERSION). Compare with >= at startup
detphys_build_infoOne line of build information (compiler, CPU, floating-point settings, SIMD), for comparison logs
detphys_world_desc_defaultDefault world settings (60 Hz, 4 substeps, gravity (0, −10000) mm/s²)
detphys_world_createCreates a world (NULL = defaults). Same as detphys_world_create_ex(desc, NULL)
detphys_world_destroyDestroys a world
detphys_world_stepAdvances one tick
detphys_world_tickCurrent tick number (0 right after creation)
detphys_world_hashState hash (FNV-1a 64 over the tick, body count and raw bits of every body's position, rotation, velocity and angular velocity)Usage: Concepts › Ticks
detphys_world_options_defaultDefault worker settings (1 worker, core pool, spin 4000, 4 bases)
detphys_world_create_exCreates a world with settings and worker settings
detphys_world_get_optionsReads the worker settings used at creation
detphys_world_snapshot_sizeCounts the size of a snapshot of the current state (dyn / full)
detphys_world_snapshot_writeWrites a snapshot into a caller buffer (takes a base here if a dyn has none)
detphys_world_snapshot_restoreRestores a snapshot (the tick and the body list come back too; restoring a full one always starts a new shape version, so the next dyn takes a new base)
detphys_snapshot_read_infoReads a snapshot image header (no world needed)
detphys_world_get_snapshot_statsBases held, shape version, write counts and so on
StructDescription
detphys_worldA world (opaque)Usage: Quick start › World and hash (one device)
detphys_world_descTick rate, substeps, gravity (mm/s²)
detphys_world_optionsWorker count (1–64), pool (DETPHYS_POOL_OWN / BOX2D / EXTERNAL), spin, base slots, engine job functions
detphys_snapshot_infoImage header (kind, size, body count, tick, base id)
detphys_snapshot_statsSnapshot statistics (for tuning)

Types: detphys_task_fn, detphys_enqueue_task_fn, detphys_finish_task_fn (function shapes for plugging in an engine's job system). Constants: DETPHYS_SNAPSHOT_DYNAMIC / DETPHYS_SNAPSHOT_FULL, DETPHYS_MAX_WORKERS (64).

↑↓ to choose, Enter to open, Esc to close