class

CharacterController

Module
Physics
Header
#include "Physics/CharacterController.h"
Namespace
Mowo

Constructors

SignatureNameDescription
CharacterController()CharacterController
~CharacterController()~CharacterController
CharacterController(const CharacterController&) = deleteCharacterController

Public functions

ReturnsNameDescription
CharacterController&operator=
voidInitialize
voidShutdown
voidUpdate
Vec3GetPosition
voidSetPosition
boolIsGrounded
Vec3GetGroundNormal
Vec3GetLinearVelocityThe character's OWN velocity.
Vec3GetGroundVelocityVelocity of whatever the character last stood on at the contact point, zero while airborne or on static ground.
FPhysicsBodyIdGetGroundBodyID
ESurfaceTypeGetGroundSurfaceSurface under the feet, taken from the ground contact Jolt already tracks — no extra downward ray needed.
boolSetCrouchedSwap the capsule between standing and crouched height.
boolIsCrouched
floatGetShapeHeightTotal capsule height currently applied (crouch shrinks it).
FPhysicsBodyIdGetInnerBodyIDThe kinematic body that gives the capsule presence in the broad phase.
voidSetInnerBodyEnabledTake the inner body out of / back into the simulation.
voidSetPushFlagsLive push gating, so the details panel's flags take effect without rebuilding the controller.
voidApplyTuningLive stair, slope, strength and character-collision settings, so the details panel edits take effect without rebuilding the controller.
uint32_t&EntitySlotHintThe owning entity's ECS slot, cached for PhysicsSystem's per-frame controller loops (World::GetComponentsHinted refreshes it in place).

Function details

CharacterController

C++
CharacterController()

~CharacterController

C++
~CharacterController()

CharacterController

C++
CharacterController(const CharacterController&) = delete

operator=

C++
CharacterController& operator=(const CharacterController&) = delete

Initialize

C++
void Initialize(PhysicsWorld* world, CharacterControllerComponent& component, Vec3 position)

Shutdown

C++
void Shutdown()

Update

C++
void Update(float dt, Vec3 desiredVelocity, Vec3 gravity)

GetPosition

C++
Vec3 GetPosition() const

SetPosition

C++
void SetPosition(Vec3 position)

IsGrounded

C++
bool IsGrounded() const

GetGroundNormal

C++
Vec3 GetGroundNormal() const

GetLinearVelocity

C++
Vec3 GetLinearVelocity() const

The character's OWN velocity. While grounded on a moving body the ground's velocity at the contact (linear plus angular about it) is added underneath for the step and the same share subtracted again here, so gameplay reasons about walking speed relative to the platform; the moment the feet leave it — a jump, the edge — the last ground velocity stays folded in and the reported value becomes the world velocity the character is carrying, and a landing re-bases that world velocity on the new ground.

GetGroundVelocity

C++
Vec3 GetGroundVelocity() const

Velocity of whatever the character last stood on at the contact point, zero while airborne or on static ground.

GetGroundBodyID

C++
FPhysicsBodyId GetGroundBodyID() const

GetGroundSurface

C++
ESurfaceType GetGroundSurface() const

Surface under the feet, taken from the ground contact Jolt already tracks — no extra downward ray needed.

SetCrouched

C++
bool SetCrouched(bool crouched, float heightScale)

Swap the capsule between standing and crouched height. Standing up is refused (stays crouched) while an obstruction above would penetrate the taller shape, and a changed heightScale re-shapes an already-crouched capsule the same way. Returns the ACTUAL crouch state after the attempt.

IsCrouched

C++
bool IsCrouched() const

GetShapeHeight

C++
float GetShapeHeight() const

Total capsule height currently applied (crouch shrinks it).

GetInnerBodyID

C++
FPhysicsBodyId GetInnerBodyID() const

The kinematic body that gives the capsule presence in the broad phase. Invalid when the component asked for no physical presence. PhysicsSystem maps it back to the owning entity so a trace that strikes a character resolves to an actor.

SetInnerBodyEnabled

C++
void SetInnerBodyEnabled(bool enabled)

Take the inner body out of / back into the simulation. A removed body stops answering traces and contacts entirely — a disabled character must not stay a wall. The BodyID (and its shape) survive.

SetPushFlags

C++
void SetPushFlags(bool pushBodies, bool pushable)

Live push gating, so the details panel's flags take effect without rebuilding the controller.

ApplyTuning

C++
void ApplyTuning(const CharacterControllerComponent& component)

Live stair, slope, strength and character-collision settings, so the details panel edits take effect without rebuilding the controller.

EntitySlotHint

C++
uint32_t& EntitySlotHint()

The owning entity's ECS slot, cached for PhysicsSystem's per-frame controller loops (World::GetComponentsHinted refreshes it in place).

Generated from Physics/CharacterController.h via physics.json · Nov 4, 2026Version 1.0.0