Runtime wrapper around a Jolt character.
More...
#include <kcharactercontroller.h>
Runtime wrapper around a Jolt character.
Created by kPhysicsManager::createCharacter(); never instantiated directly by editor code. Call update() once per physics step (kPhysicsManager does this) and read getPosition() to drive the scene node.
◆ kCharacterController()
| kemena::kCharacterController::kCharacterController |
( |
| ) |
|
Constructs an uninitialised character controller; call init() before use.
◆ ~kCharacterController()
| kemena::kCharacterController::~kCharacterController |
( |
| ) |
|
Destroys the controller, releasing any underlying Jolt character.
◆ getLinearVelocity()
| kVec3 kemena::kCharacterController::getLinearVelocity |
( |
| ) |
const |
Returns the character's current world-space velocity (m/s).
◆ getPosition()
| kVec3 kemena::kCharacterController::getPosition |
( |
| ) |
const |
Returns the character's current world-space position (capsule feet origin).
◆ getRotation()
| kQuat kemena::kCharacterController::getRotation |
( |
| ) |
const |
Returns the character's current world-space orientation.
◆ init()
Initialises the Jolt character.
- Parameters
-
| physicsSystem | Opaque JPH::PhysicsSystem* from kPhysicsManager. |
| desc | Capsule + motion parameters. |
- Returns
- true on success.
◆ isOnGround()
| bool kemena::kCharacterController::isOnGround |
( |
| ) |
const |
True when the character is standing on walkable ground.
◆ setLinearVelocity()
| void kemena::kCharacterController::setLinearVelocity |
( |
const kVec3 & | velocity | ) |
|
Sets the character's world-space velocity (m/s).
- Parameters
-
| velocity | Desired linear velocity in metres per second. |
◆ setPosition()
| void kemena::kCharacterController::setPosition |
( |
const kVec3 & | position | ) |
|
Teleports the character to a world-space position.
- Parameters
-
| position | New world-space position (capsule feet origin). |
◆ setRotation()
| void kemena::kCharacterController::setRotation |
( |
const kQuat & | rotation | ) |
|
Sets the character's world-space orientation.
- Parameters
-
| rotation | New world-space orientation. |
◆ uninit()
| void kemena::kCharacterController::uninit |
( |
| ) |
|
Removes the character from the physics system.
◆ update()
| void kemena::kCharacterController::update |
( |
float | deltaTime | ) |
|
The documentation for this class was generated from the following file: