# Class KinematicCharacterController

A character controller for controlling kinematic bodies and parentless colliders by hitting and sliding against obstacles.

- Defined in control/character_controller.d.ts:30

#####
Index

### Constructors

constructor

### Properties

_applyImpulsesToDynamicBodies
_characterMass
bodies
broadPhase
colliders
narrowPhase
params
raw
rawCharacterCollision

### Methods

applyImpulsesToDynamicBodies
autostepEnabled
autostepIncludesDynamicBodies
autostepMaxHeight
autostepMinWidth
characterMass
computeColliderMovement
computedCollision
computedGrounded
computedMovement
disableAutostep
disableSnapToGround
enableAutostep
enableSnapToGround
free
maxSlopeClimbAngle
minSlopeSlideAngle
normalNudgeFactor
numComputedCollisions
offset
setApplyImpulsesToDynamicBodies
setCharacterMass
setMaxSlopeClimbAngle
setMinSlopeSlideAngle
setNormalNudgeFactor
setOffset
setSlideEnabled
setUp
slideEnabled
snapToGroundDistance
snapToGroundEnabled
up

## Constructors

### constructor

- new KinematicCharacterController(offset, params, broadPhase, narrowPhase, bodies, colliders): KinematicCharacterController

- #### Parameters

  - offset: number
  - params: IntegrationParameters
  - broadPhase: BroadPhase
  - narrowPhase: NarrowPhase
  - bodies: RigidBodySet
  - colliders: ColliderSet

  #### Returns KinematicCharacterController

  - Defined in control/character_controller.d.ts:40

## Properties

### `Private` _applyImpulsesToDynamicBodies

_applyImpulsesToDynamicBodies: any

- Defined in control/character_controller.d.ts:38

### `Private` _characterMass

_characterMass: any

- Defined in control/character_controller.d.ts:39

### `Private` bodies

bodies: any

- Defined in control/character_controller.d.ts:36

### `Private` broadPhase

broadPhase: any

- Defined in control/character_controller.d.ts:34

### `Private` colliders

colliders: any

- Defined in control/character_controller.d.ts:37

### `Private` narrowPhase

narrowPhase: any

- Defined in control/character_controller.d.ts:35

### `Private` params

params: any

- Defined in control/character_controller.d.ts:33

### `Private` raw

raw: any

- Defined in control/character_controller.d.ts:31

### `Private` rawCharacterCollision

rawCharacterCollision: any

- Defined in control/character_controller.d.ts:32

## Methods

### applyImpulsesToDynamicBodies

- applyImpulsesToDynamicBodies(): boolean

- #### Returns boolean

  - Defined in control/character_controller.d.ts:51

### autostepEnabled

- autostepEnabled(): boolean

- Is automatically stepping over small objects enabled?

  #### Returns boolean

  - Defined in control/character_controller.d.ts:107

### autostepIncludesDynamicBodies

- autostepIncludesDynamicBodies(): boolean

- Can the character automatically step over dynamic bodies too?

  #### Returns boolean

  - Defined in control/character_controller.d.ts:103

### autostepMaxHeight

- autostepMaxHeight(): number

- The maximum step height a character can automatically step over.

  #### Returns number

  - Defined in control/character_controller.d.ts:95

### autostepMinWidth

- autostepMinWidth(): number

- The minimum width of free space that must be available after stepping on a stair.

  #### Returns number

  - Defined in control/character_controller.d.ts:99

### characterMass

- characterMass(): number

- Returns the custom value of the character mass, if it was set by `this.setCharacterMass`.

  #### Returns number

  - Defined in control/character_controller.d.ts:56

### computeColliderMovement

- computeColliderMovement(collider, desiredTranslationDelta, filterFlags?, filterGroups?, filterPredicate?): void

- Computes the movement the given collider is able to execute after hitting and sliding on obstacles.

  #### Parameters

  - collider: Collider

    The collider to move.

  - desiredTranslationDelta: Vector

    The desired collider movement.

  - `Optional` filterFlags: QueryFilterFlags

    Flags for excluding whole subsets of colliders from the obstacles taken into account.

  - `Optional` filterGroups: number

    Groups for excluding colliders with incompatible collision groups from the obstacles taken into account.

  - `Optional` filterPredicate: ((collider) => boolean)

    Any collider for which this closure returns `false` will be excluded from the obstacles taken into account.

    - - (collider): boolean

      - #### Parameters

        - collider: Collider

        #### Returns boolean

  #### Returns void

  - Defined in control/character_controller.d.ts:169

### computedCollision

- computedCollision(i, out?): CharacterCollision

- Returns the collision against one of the obstacles detected along the path of the last call to `this.computeColliderMovement`.

  #### Parameters

  - i: number

    The i-th collision will be returned.

  - `Optional` out: CharacterCollision

    If this argument is set, it will be filled with the collision information.

  #### Returns CharacterCollision

  - Defined in control/character_controller.d.ts:190

### computedGrounded

- computedGrounded(): boolean

- The result of ground detection computed by the last call to `this.computeColliderMovement`.

  #### Returns boolean

  - Defined in control/character_controller.d.ts:177

### computedMovement

- computedMovement(): Vector

- The movement computed by the last call to `this.computeColliderMovement`.

  #### Returns Vector

  - Defined in control/character_controller.d.ts:173

### disableAutostep

- disableAutostep(): void

- Disable automatically stepping over small objects.

  #### Returns void

  - Defined in control/character_controller.d.ts:119

### disableSnapToGround

- disableSnapToGround(): void

- Disables automatically snapping the character to the ground.

  #### Returns void

  - Defined in control/character_controller.d.ts:153

### enableAutostep

- enableAutostep(maxHeight, minWidth, includeDynamicBodies): void

- Enabled automatically stepping over small objects.

  #### Parameters

  - maxHeight: number

    The maximum step height a character can automatically step over.

  - minWidth: number

    The minimum width of free space that must be available after stepping on a stair.

  - includeDynamicBodies: boolean

    Can the character automatically step over dynamic bodies too?

  #### Returns void

  - Defined in control/character_controller.d.ts:115

### enableSnapToGround

- enableSnapToGround(distance): void

- Enables automatically snapping the character to the ground if the distance between the ground and its feet are smaller than the specified threshold.

  #### Parameters

  - distance: number

  #### Returns void

  - Defined in control/character_controller.d.ts:149

### free

- free(): void
- `Internal`

  #### Returns void

  - Defined in control/character_controller.d.ts:42

### maxSlopeClimbAngle

- maxSlopeClimbAngle(): number

- The maximum angle (radians) between the floor’s normal and the `up` vector that the character is able to climb.

  #### Returns number

  - Defined in control/character_controller.d.ts:124

### minSlopeSlideAngle

- minSlopeSlideAngle(): number

- The minimum angle (radians) between the floor’s normal and the `up` vector before the character starts to slide down automatically.

  #### Returns number

  - Defined in control/character_controller.d.ts:134

### normalNudgeFactor

- normalNudgeFactor(): number

- #### Returns number

  - Defined in control/character_controller.d.ts:82

### numComputedCollisions

- numComputedCollisions(): number

- The number of collisions against obstacles detected along the path of the last call to `this.computeColliderMovement`.

  #### Returns number

  - Defined in control/character_controller.d.ts:182

### offset

- offset(): number

- A small gap to preserve between the character and its surroundings.

  This value should not be too large to avoid visual artifacts, but shouldn’t be too small (must not be zero) to improve numerical stability of the character controller.

  #### Returns number

  - Defined in control/character_controller.d.ts:74

### setApplyImpulsesToDynamicBodies

- setApplyImpulsesToDynamicBodies(enabled): void

- #### Parameters

  - enabled: boolean

  #### Returns void

  - Defined in control/character_controller.d.ts:52

### setCharacterMass

- setCharacterMass(mass): void

- Set the mass of the character to be used for impulse resolution if `self.applyImpulsesToDynamicBodies` is set to `true`.

  If no character mass is set explicitly (or if it is set to `null`) it is automatically assumed to be equal to the mass of the rigid-body the character collider is attached to; or equal to 0 if the character collider isn’t attached to any rigid-body.

  #### Parameters

  - mass: number

    The mass to set.

  #### Returns void

  - Defined in control/character_controller.d.ts:67

### setMaxSlopeClimbAngle

- setMaxSlopeClimbAngle(angle): void

- Sets the maximum angle (radians) between the floor’s normal and the `up` vector that the character is able to climb.

  #### Parameters

  - angle: number

  #### Returns void

  - Defined in control/character_controller.d.ts:129

### setMinSlopeSlideAngle

- setMinSlopeSlideAngle(angle): void

- Sets the minimum angle (radians) between the floor’s normal and the `up` vector before the character starts to slide down automatically.

  #### Parameters

  - angle: number

  #### Returns void

  - Defined in control/character_controller.d.ts:139

### setNormalNudgeFactor

- setNormalNudgeFactor(value): void

- #### Parameters

  - value: number

  #### Returns void

  - Defined in control/character_controller.d.ts:83

### setOffset

- setOffset(value): void

- Sets a small gap to preserve between the character and its surroundings.

  This value should not be too large to avoid visual artifacts, but shouldn’t be too small (must not be zero) to improve numerical stability of the character controller.

  #### Parameters

  - value: number

  #### Returns void

  - Defined in control/character_controller.d.ts:81

### setSlideEnabled

- setSlideEnabled(enabled): void

- Enable or disable sliding against obstacles.

  #### Parameters

  - enabled: boolean

  #### Returns void

  - Defined in control/character_controller.d.ts:91

### setUp

- setUp(vector): void

- Sets the direction that goes "up". Used to determine where the floor is, and the floor’s angle.

  #### Parameters

  - vector: Vector

  #### Returns void

  - Defined in control/character_controller.d.ts:50

### slideEnabled

- slideEnabled(): boolean

- Is sliding against obstacles enabled?

  #### Returns boolean

  - Defined in control/character_controller.d.ts:87

### snapToGroundDistance

- snapToGroundDistance(): number

- If snap-to-ground is enabled, should the character be automatically snapped to the ground if the distance between the ground and its feet are smaller than the specified threshold?

  #### Returns number

  - Defined in control/character_controller.d.ts:144

### snapToGroundEnabled

- snapToGroundEnabled(): boolean

- Is automatically snapping the character to the ground enabled?

  #### Returns boolean

  - Defined in control/character_controller.d.ts:157

### up

- up(): Vector

- The direction that goes "up". Used to determine where the floor is, and the floor’s angle.

  #### Returns Vector

  - Defined in control/character_controller.d.ts:46