DefaultControlsWrapper class
This class implements the default platformer controls, with support for jumping, running, etc
the controls use keyboard keys W, A, S, D or Arrow keys for movement, and SPACE for jumping;
The meaning of object
& target
options is intepreted as follows:
-
The
object
is moved by the controls actions -
The
target
is used to determine the forward direction of the movement
The behavior of the controls can be customized using the params object. See DefaultControlParams for more info
Signature:
export declare class DefaultControlsWrapper extends ControlsAbstract
Extends: ControlsAbstract
Constructors
Constructor |
Modifiers |
Description |
---|---|---|
Constructs a new instance of the |
Properties
Property |
Modifiers |
Type |
Description |
---|---|---|---|
boolean | |||
{ wasJumping: boolean; jumpAnimCount: number; isDropAnimPlaying: boolean; } | |||
{ speed: number; delay: number; jumpedCount: number; jumped: boolean; isJumping: boolean; reachedPeak: boolean; coyoteTimeLeft: number; elapsedTime: number; jumpGravity: number; jumpVelocity: number; currentHeight: number; jumpMaxHeight: number; prevJumpKeyState: boolean; } | |||
boolean | |||
number | |||
{ isMoving: boolean; onFloor: boolean; speed: number; } | |||
PCActions |
The actions influence the movement of the attached object. Those are typically set automtically from the user input. If you deactivate the controls's controller, you can set those manually to control the movement of the attached object | ||
boolean | |||
boolean | |||
{ idle: string; run: string; sprint: string; jump_idle: string; jump_walking: string; jump_sprinting: string; jump_running: string; falling: string; drop_idle: string; drop_walking: string; drop_walking_roll: string; drop_running: string; drop_running_roll: string; drop_sprinting: string; drop_sprinting_roll: string; walk: string; jump_double: string; } | |||
boolean | |||
boolean | |||
boolean | |||
any[] | |||
Controller |
The controller handles the input events and sets the corresponding actions | ||
Vector3 | |||
Vector3 | |||
{ x: number; y: number; z: number; } | |||
{ airAcceleration: number; hold: boolean; duration: number; height: number; max: number; coyote: number; maxFallSpeed: number; peakSpeed: number; delay: number; } | |||
any | |||
boolean | |||
(animationName: any, animationsToCheck?: any[]) => void | |||
(animationName: any, animationsToCheck: any, opts?: {}) => Promise<unknown> | |||
Vector3 | |||
Quaternion | |||
{ maxSpeed: number; maxAcceleration: number; maxDeceleration: number; accelerationFactor: number; decelerationFactor: number; boost: number; } | |||
boolean | |||
Quaternion | |||
number | |||
(deltaTime: any) => void | |||
Vector3 |
Methods
Method |
Modifiers |
Description |
---|---|---|