Skip to content

Physics public root and subpaths ​

EntryRuntime functionsArguments and result
RootcreatePhysicsWorld, createUprightCapsuleQuery, createUprightCapsuleController, PhysicsErrorRigid config/world; immutable static-box query; bounded character controller.
/cad-proxyadmitCadSurfaceProxy, assertCadProxyCurrent, cadProxyPoseExact source/revision and native Surface request; copied proxy and display pose.
/replaycreatePhysicsScene, createPhysicsReplaySession, restorePhysicsReplaySessionAdmitted config/revisions, accepted command replay and qualified restore.
/fluidcreateFluidWorld, PhysicsErrorVersioned 256-particle basin scene → caller-stepped world.
/clothcreateClothWorld, PhysicsErrorFixed pinned-sheet scene → copied topology/positions/diagnostics.
/fluid-cadcreateCadFluidWorld, PhysicsErrorVersion 1 fluid scene, original CAD text/request → static-box obstacle world.

Rigid world contracts ​

createPhysicsWorld(config:PhysicsWorldConfig):PhysicsWorld takes fixedStepSeconds, gravityMps2, bodies, optional bounded joints and opt-in profile fields.

getState():PhysicsState and step(fixedStepSeconds:number,commands?:PhysicsStepCommand[]):PhysicsState return copies. overlapSphere(query):string[] returns matching body IDs. raycast(query):PhysicsRayHit|null returns body ID and distance in metres. dispose():void is idempotent. The rigid interface has no reset method; create a new world for a fresh baseline.

Commands are force, impulse, torque, angularImpulse or kinematicTarget. Shape unions are sphere, box and capsule. Type-level shape existence does not admit every pair/profile combination.

Simulation family lifetimes ​

Fluid/cloth worlds expose getState, step, reset and dispose; their exact dt, state arrays and numerical acceptance gates belong to those profiles. CAD fluid step/reset additionally require current source text/revision. Replay session step takes command frames under its saved fixed step.

packages/barocss-physics/package.json (Manifest and version; local source) · packages/barocss-physics/README.md (Package task notes; local source)

Local manual snapshot. Availability is stated on each package page.