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).
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new SpringBoneAPI(
module,registry):SpringBoneAPI
Defined in: sdk/src/springbone/SpringBoneAPI.ts:29
Parameters
Section titled “Parameters”module
Section titled “module”NonNullable<EngineApi>
whichever engine core is present (see ecs/engineApi.ts).
registry
Section titled “registry”CppRegistry
Returns
Section titled “Returns”SpringBoneAPI
Methods
Section titled “Methods”release()
Section titled “release()”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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
reset()
Section titled “reset()”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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void
snapshot()
Section titled “snapshot()”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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”update()
Section titled “update()”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.
Parameters
Section titled “Parameters”number
Returns
Section titled “Returns”void