Skip to main content

FirstPersonFSM

@zylem/game-lib


@zylem/game-lib / behavior / FirstPersonFSM

Class: FirstPersonFSM

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/first-person.d.ts:46

First Person Controller FSM

Constructors​

Constructor​

new FirstPersonFSM(ctx): FirstPersonFSM

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/first-person.d.ts:49

Parameters​

ctx​

FirstPersonContext

Returns​

FirstPersonFSM

Properties​

machine​

machine: SyncStateMachine<FirstPersonState, FirstPersonEvent, 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/first-person.d.ts:48

Methods​

dispatch()​

dispatch(event): 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/first-person.d.ts:53

Dispatch an event to the FSM

Parameters​

event​

FirstPersonEvent

Returns​

void


getPitch()​

getPitch(): number

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/first-person.d.ts:57

Get the current pitch from context

Returns​

number


getState()​

getState(): FirstPersonState

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/first-person.d.ts:51

Get the current state

Returns​

FirstPersonState


getYaw()​

getYaw(): number

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/first-person.d.ts:55

Get the current yaw from context

Returns​

number


update()​

update(input, state): 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/first-person.d.ts:61

Update FSM based on current input and state.

Parameters​

input​

FirstPersonInputComponent

state​

FirstPersonStateComponent

Returns​

void