跳转到内容

SpringBoneAPI

此内容尚不支持你的语言。

Defined in: sdk/src/springbone/SpringBoneAPI.ts:24

Per-app secondary-motion API. Wraps the C++ registry-scoped spring-bone system, so two App instances (editor tabs) simulate independent chains.

Consumed as a resource: declare Res(SpringBone) as a system param, or grab it with app.getResource(SpringBone).

new SpringBoneAPI(module, registry): SpringBoneAPI

Defined in: sdk/src/springbone/SpringBoneAPI.ts:29

NonNullable<EngineApi>

whichever engine core is present (see ecs/engineApi.ts).

CppRegistry

SpringBoneAPI

release(root): void

Defined in: sdk/src/springbone/SpringBoneAPI.ts:62

Give a chain’s bones back as the animation had them and forget its state: what ends a preview in an editor.

number

void


reset(root): void

Defined in: sdk/src/springbone/SpringBoneAPI.ts:67

Put a chain back at its animated pose on its next frame: a teleport, a respawn, a pose set by hand.

number

void


snapshot(root): SpringBoneParticle[]

Defined in: sdk/src/springbone/SpringBoneAPI.ts:43

A chain as the engine has it now, for an editor to draw: each particle’s simulated position, the position the animation gives it, and its parent’s index (-1 for the root). Empty when the chain has not been stepped yet.

number

SpringBoneParticle[]


update(dt): void

Defined in: sdk/src/springbone/SpringBoneAPI.ts:35

Advance every chain: step the springs toward the pose the animation gave, then turn the bones to match.

number

void