Skip to content

@fibbojs / 3d / FCharacterControllerK

Class: abstract FCharacterControllerK

An abstract pre-defined character controller based on Kinematic rigidbodies.

Extends

Extended by

Constructors

new FCharacterControllerK()

new FCharacterControllerK(scene, options): FCharacterControllerK

Parameters

scene: FScene

options: FCharacterControllerOptions

Returns

FCharacterControllerK

Overrides

FCharacterController.constructor

Defined in

3d/src/controllers/FCharacterControllerK.ts:23

Methods

getCorrectedMovements()

getCorrectedMovements(): object

Return the corrected movements for the current frame.

Returns

object

x

x: number

y

y: number

z

z: number

Defined in

3d/src/controllers/FCharacterControllerK.ts:47


getCorrectedRotation()

getCorrectedRotation(): Quaternion

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

Returns

Quaternion

Inherited from

FCharacterController.getCorrectedRotation

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

FCharacterController.onFrame

Defined in

core/dist/index.d.ts:26

Properties

characterController

characterController: KinematicCharacterController

The character controller that will be used to move the character.

Defined in

3d/src/controllers/FCharacterControllerK.ts:21


component

component: FComponent

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

Inherited from

FCharacterController.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

Inherited from

FCharacterController.inputs

Defined in

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


scene

scene: FScene

The scene where the character is.

Inherited from

FCharacterController.scene

Defined in

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


speed

speed: number

The speed of the character.

Inherited from

FCharacterController.speed

Defined in

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


yVelocity

yVelocity: number

The y velocity of the character. Used to apply gravity.

Defined in

3d/src/controllers/FCharacterControllerK.ts:16