physics::CharacterBody
kn::physics::CharacterBody Inherits kn::physics::Body
Declared in kraken/physics/bodies/CharacterBody.hpp
At a glance
17 membersMotionModeenummotionModevariablevelocityvariablemassvariablemaxSpeedvariableaccelerationvariablefrictionvariablestopSpeedvariableairSteervariableCharacterBodyfunction~CharacterBodyfunctionmoveAndSlidefunctionisOnFloorfunctionisOnCeilingfunctionisOnWallfunctionsetCapsuleShapefunctiongetCapsuleShapefunctionReference
C++ APIMotionMode
enumenum MotionModeNo description in the source header.
| Value | Initializer | Description |
|---|---|---|
Grounded | Automatic | — |
Floating | Automatic | — |
motionMode
variableenum kn::physics::CharacterBody::MotionMode motionMode = MotionMode::GroundedNo description in the source header.
velocity
variableVec2 velocityNo description in the source header.
mass
variablefloat mass = 1.0fNo description in the source header.
maxSpeed
variablefloat maxSpeed = 6.0fNo description in the source header.
acceleration
variablefloat acceleration = 20.0fNo description in the source header.
friction
variablefloat friction = 8.0fNo description in the source header.
stopSpeed
variablefloat stopSpeed = 3.0fNo description in the source header.
airSteer
variablefloat airSteer = 0.2fNo description in the source header.
CharacterBody
functionCharacterBody(World &world)No description in the source header.
~CharacterBody
function~CharacterBody()=defaultNo description in the source header.
moveAndSlide
functionvoid moveAndSlide(double delta=-1.0)No description in the source header.
isOnFloor
functionbool isOnFloor() constNo description in the source header.
isOnCeiling
functionbool isOnCeiling() constNo description in the source header.
isOnWall
functionbool isOnWall() constNo description in the source header.
setCapsuleShape
functionvoid setCapsuleShape(const class Capsule &capsule)No description in the source header.
getCapsuleShape
functionclass Capsule getCapsuleShape() constNo description in the source header.