Skip to content

@fibbojs / 3d / FCharacterController

Class: abstract FCharacterController

An abstract pre-defined character controller.

Extends

Extended by

Constructors

new FCharacterController()

new FCharacterController(scene, options): FCharacterController

Parameters

scene: FScene

options: FCharacterControllerOptions

Returns

FCharacterController

Overrides

FController.constructor

Defined in

3d/src/controllers/FCharacterController.ts:41

Methods

getCorrectedRotation()

getCorrectedRotation(): Quaternion

Return the corrected rotation for the current frame. Uses the camera so the character nevers faces the camera.

Returns

Quaternion

Defined in

3d/src/controllers/FCharacterController.ts:122


onFrame()

abstract onFrame(delta): void

Update the controller. Should be called every frame. The purpose of onFrame on FController is to update the component's transform in the desired way. Any rendering process should be done on the component, not here.

Parameters

delta: number

The time since the last frame.

Returns

void

Inherited from

FController.onFrame

Defined in

core/dist/index.d.ts:26

Properties

component

component: FComponent

The component attached to the controller. It is redefined here to get the correct type (with 3D properties).

Inherited from

FController.component

Defined in

3d/src/controllers/FController.ts:17


inputs

inputs: object

The inputs that will be used to move the character.

backward

backward: boolean

forward

forward: boolean

left

left: boolean

right: boolean

Defined in

3d/src/controllers/FCharacterController.ts:24


scene

scene: FScene

The scene where the character is.

Defined in

3d/src/controllers/FCharacterController.ts:39


speed

speed: number

The speed of the character.

Defined in

3d/src/controllers/FCharacterController.ts:34