character_controller.h¶
| File Path | engine/include/conjure/physics/character_controller.h |
| API ↗ | Bodies, colliders and characters, Physics |
"conjure.physics.character_controller": a capsule of the given radius and total height whose feet sit at the entity origin. 68 bytes (entity fields are 4-aligned, reflection rule).
Structs¶
| File | Description |
|---|---|
character_capsule |
The capsule a character_controller collides with: its radius, the half height of the cylinder between its two half spheres, and how far above the entity's origin its centre lies (half its total height, so its feet sit at the origin). The entity's position and rotation place it; its scale never applies. |
character_controller |
"conjure.physics.character_controller": a capsule of the given radius and total height whose feet sit at the entity origin. 68 bytes (entity fields are 4-aligned, reflection rule). |
Enumerations¶
character_flags¶
enum class character_flags : u8 {
NONE = 0,
STICK_TO_FLOOR = 1 << 0, // ExtendedUpdateSettings::mStickToFloorStepDown = (0, -stepHeight, 0)
WALK_STAIRS = 1 << 1, // ExtendedUpdateSettings::mWalkStairsStepUp = (0, stepHeight, 0)
APPLY_GRAVITY = 1 << 2 // integrate settings.gravity into velocity while not ON_GROUND
};
Character behaviour switches.
ground_state¶
Where the character stands (CharacterBase::EGroundState).
Macros¶
CONJURE_COMPONENT¶
CONJURE_ENUM_FLAGS¶
CONJURE_REFLECT_ENUM¶
CONJURE_REFLECT_ENUM(conjure::physics::ground_state, "conjure.physics.ground_state", ON_GROUND, ON_STEEP_GROUND, NOT_SUPPORTED, IN_AIR)
CONJURE_REFLECT_FLAGS¶
CONJURE_REFLECT_FLAGS(conjure::physics::character_flags, "conjure.physics.character_flags", NONE, STICK_TO_FLOOR, WALK_STAIRS, APPLY_GRAVITY)
CONJURE_REFLECT_STRUCT¶
CONJURE_REFLECT_STRUCT(conjure::physics::character_controller, "conjure.physics.character_controller", CONJURE_FIELD(radius, .min = 0.0), CONJURE_FIELD(height, .min = 0.0), CONJURE_FIELD(maxSlopeAngleRadians, .min = 0.0, .max = std::numbers::pi / 2.0, .unit = conjure::core::reflect::field_unit::RADIANS), CONJURE_FIELD(stepHeight, .min = 0.0), CONJURE_FIELD(mass, .min = 0.0), CONJURE_FIELD(maxStrength, .min = 0.0), CONJURE_FIELD(padding, .min = 0.0), CONJURE_FIELD(layer, .min = 0.0, .max = 31.0), CONJURE_FIELD(flags), CONJURE_FIELD(velocity), CONJURE_FIELD(ground, .readOnly = true), CONJURE_FIELD(groundNormal, .readOnly = true), CONJURE_FIELD(groundEntity, .readOnly = true))
Functions¶
Public¶
character_capsule_of¶
character_capsule_of¶[[nodiscard]] CONJURE_API character_capsule character_capsule_of(
const character_controller &controller) noexcept;The capsule the physics world builds for a character (its CharacterVirtual's shape): the radius |radius| and the cylinder's half height |height| / 2 - radius, each at least a centimetre, lifted by their sum. An editor draws the character's collision volume from it.