CharacterController

Inherited: Collider

Description

The CharacterController class provides methods to control the movement and properties of a character in a 3D physics environment.

Public Methods

Vector3

center () const

Vector3

gravity () const

float

height () const

bool

isGrounded () const

void

move (const Vector3 & direction)

float

radius () const

void

setCenter (const Vector3 center)

void

setGravity (const Vector3 gravity)

void

setHeight (float height)

void

setRadius (float radius)

void

setSkinWidth (float width)

void

setSlopeLimit (float limit)

void

setStepOffset (float height)

float

skinWidth () const

float

slopeLimit () const

float

stepOffset () const

Static Methods

None

Methods Description

Vector3 CharacterController::center () const

Returns the local center of the character controller.

See also setCenter().


Vector3 CharacterController::gravity () const

Returns the gravity vector applied to the character controller.

See also setGravity().


float CharacterController::height () const

Returns the height of the character controller’s capsule shape.

See also setHeight().


bool CharacterController::isGrounded () const

Returns true if the character controller is currently grounded (on the floor); otherwise, returns false.


void CharacterController::move (Vector3 & direction)

Moves the character controller in the specified direction.


float CharacterController::radius () const

Returns the radius of the character controller’s capsule shape.

See also setRadius().


void CharacterController::setCenter (Vector3 center)

Sets the local center of the character controller.

See also *center*().


void CharacterController::setGravity (Vector3 gravity)

Sets the gravity vector applied to the character controller.

See also *gravity*().


void CharacterController::setHeight (float height)

Sets the height of the character controller’s capsule shape.

See also *height*().


void CharacterController::setRadius (float radius)

Sets the radius of the character controller’s capsule shape.

See also *radius*().


void CharacterController::setSkinWidth (float width)

Sets the skin width of the character controller.

See also skinWidth().


void CharacterController::setSlopeLimit (float limit)

Sets the slope limit angle for the character controller.

See also slopeLimit().


void CharacterController::setStepOffset (float height)

Sets the maximum height of steps that the character controller can climb.

See also stepOffset().


float CharacterController::skinWidth () const

Returns the skin width of the character controller.

See also setSkinWidth().


float CharacterController::slopeLimit () const

Returns the slope limit angle for the character controller.

See also setSlopeLimit().


float CharacterController::stepOffset () const

Returns the maximum height of steps that the character controller can climb.

See also setStepOffset().