Ricochet3DFSM
@zylem/game-lib / behavior / Ricochet3DFSM
Class: Ricochet3DFSM
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:66
Behaviors Module Index
Behaviors now live in the standalone, tree-shakable @zylem/behaviors
package (built on @zylem/behaviors/core). This barrel re-exports that public
surface so existing @zylem/game-lib/behavior consumers keep working.
IMPORTANT: do NOT use export * from '@zylem/behaviors' here. Because
@zylem/behaviors is external in game-lib's tsup build, esbuild compiles a
star re-export of an external into a runtime __reExport helper with no
static export names. Downstream bundlers (e.g. the examples/arena Vite
builds) then cannot statically resolve named value imports such as
FractureOptions and fail with "X is not exported by game-lib/dist/behavior.js".
Explicit named re-exports below are preserved statically and keep a single
runtime copy of @zylem/behaviors (no bundling/duplication).
The lists mirror the full public API of @zylem/behaviors (values from its
built dist/index.js export block; types are the remaining dist/index.d.ts
exports). When behaviors are added/removed in @zylem/behaviors, update these
lists to match.
Constructors
Constructor
new Ricochet3DFSM():
Ricochet3DFSM
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:72
Returns
Ricochet3DFSM
Properties
machine
readonlymachine:SyncStateMachine<Ricochet3DState,Ricochet3DEvent,never>
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:67
Methods
addListener()
addListener(
callback): () =>void
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:73
Parameters
callback
Returns
() => void
clearRicochet()
clearRicochet():
void
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:87
Returns
void
computeRicochet()
computeRicochet(
ctx,options?):Ricochet3DResult|null
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:80
Parameters
ctx
options?
maxAngleDeg?
number
maxSpeed?
number
minSpeed?
number
reflectionMode?
"simple" | "angled"
speedMultiplier?
number
Returns
Ricochet3DResult | null
getLastResult()
getLastResult():
Ricochet3DResult|null
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:75
Returns
Ricochet3DResult | null
getLastUpdatedAtMs()
getLastUpdatedAtMs():
number|null
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:76
Returns
number | null
getState()
getState():
Ricochet3DState
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:74
Returns
isOnCooldown()
isOnCooldown(
cooldownMs?):boolean
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:78
Parameters
cooldownMs?
number
Returns
boolean
resetCooldown()
resetCooldown():
void
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:79
Returns
void
setCurrentTimeMs()
setCurrentTimeMs(
timeMs):void
Defined in: node_modules/.pnpm/@zylem+behaviors@0.8.9_@types+react@19.3.0_react@19.3.0_three@0.185.1/node_modules/@zylem/behaviors/dist/ricochet-3d.d.ts:77
Parameters
timeMs
number
Returns
void