@fibbojs / 3d / FCharacterControllerD
Class: FCharacterControllerD
A pre-defined character controller based on a Dynamic RigidBody.
Example
import { FCapsule, FCharacterControllerD, FScene } from '@fibbojs/3d'
const scene = new FScene()
const capsule = new FCapsule()
capsule.controller = new FCharacterControllerD()
scene.addComponent(capsule)
Extends
Constructors
new FCharacterControllerD()
new FCharacterControllerD(
options
):FCharacterControllerD
Parameters
• options: FCharacterControllerOptions
Returns
Overrides
FCharacterController
.constructor
Defined in
3d/src/controllers/FCharacterControllerD.ts:22
Methods
frame()
frame(
_delta
):void
Update the controller. Should be called every frame. The purpose of this method is to update the component transform based on the controller logic.
Parameters
• _delta: number
Returns
void
Overrides
Defined in
3d/src/controllers/FCharacterControllerD.ts:40
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:125
Properties
__RUN_IN_PHYSIC_PIPELINE__
__RUN_IN_PHYSIC_PIPELINE__:
boolean
True if the controller should run in the physic pipeline.
Inherited from
FCharacterController
.__RUN_IN_PHYSIC_PIPELINE__
Defined in
core/dist/index.d.ts:20
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
right:
boolean
Inherited from
Defined in
3d/src/controllers/FCharacterController.ts:24
scene
scene:
FScene
The scene where the character is.
Inherited from
Defined in
3d/src/controllers/FCharacterController.ts:39
speed
speed:
number
The speed of the character.