|
Unravel Engine C++ Reference
|
Component for character controller physics with sweep-based movement. More...
#include <character_controller_component.h>
Public Member Functions | |
| void | set_radius (float radius) |
| auto | get_radius () const noexcept -> float |
| void | set_height (float height) |
| auto | get_height () const noexcept -> float |
| void | set_center (const math::vec3 ¢er) |
| auto | get_center () const noexcept -> const math::vec3 & |
| void | set_step_height (float step_height) |
| auto | get_step_height () const noexcept -> float |
| void | set_slope_limit (float slope_limit_degrees) |
| auto | get_slope_limit () const noexcept -> float |
| void | set_skin_width (float skin_width) |
| auto | get_skin_width () const noexcept -> float |
| void | set_gravity_scale (float scale) |
| auto | get_gravity_scale () const noexcept -> float |
| void | set_collision_include_mask (layer_mask mask) |
| auto | get_collision_include_mask () const -> layer_mask |
| void | set_collision_exclude_mask (layer_mask mask) |
| auto | get_collision_exclude_mask () const -> layer_mask |
| auto | get_collision_mask () const -> layer_mask |
| void | move (const math::vec3 &displacement) |
| void | jump (float speed) |
| Trigger a jump straight up with the given speed (m/s). | |
| void | jump (const math::vec3 &velocity) |
| Trigger a directional jump. The velocity's magnitude is the jump speed and its direction is the jump axis. | |
| void | apply_impulse (const math::vec3 &impulse) |
| void | warp (const math::vec3 &position) |
| void | set_terminal_velocity (float speed) |
| auto | get_terminal_velocity () const noexcept -> float |
| void | set_linear_velocity (const math::vec3 &velocity) |
| auto | get_linear_velocity () const noexcept -> math::vec3 |
| void | set_linear_damping (float damping) |
| auto | get_linear_damping () const noexcept -> float |
| auto | can_jump () const noexcept -> bool |
| auto | is_grounded () const noexcept -> bool |
| auto | get_velocity () const noexcept -> const math::vec3 & |
| auto | is_dirty (uint8_t id) const noexcept -> bool |
| void | set_dirty (uint8_t id, bool dirty) noexcept |
| auto | is_property_dirty (character_controller_property prop) const noexcept -> bool |
| auto | are_any_properties_dirty () const noexcept -> bool |
| void | set_property_dirty (character_controller_property prop, bool dirty) noexcept |
| void | set_grounded (bool grounded) noexcept |
| void | set_velocity_internal (const math::vec3 &vel) noexcept |
Public Member Functions inherited from unravel::owned_component | |
| auto | operator= (const owned_component &other) -> owned_component &=default |
| void | set_owner (entt::handle owner) |
| Sets the owner of the component. | |
| auto | get_owner () const noexcept -> entt::const_handle |
| Gets the owner of the component. | |
| auto | get_owner () noexcept -> entt::handle |
| Gets the owner of the component. | |
Public Member Functions inherited from unravel::basic_component | |
| void | touch () |
| Marks the component as 'touched'. | |
Static Public Member Functions | |
| static void | on_create_component (entt::registry &r, entt::entity e) |
| Called when the component is created. | |
| static void | on_destroy_component (entt::registry &r, entt::entity e) |
| Called when the component is destroyed. | |
Static Public Member Functions inherited from unravel::owned_component | |
| template<typename T > | |
| static void | on_create_component (entt::registry &r, entt::entity e) |
| template<typename T > | |
| static void | on_destroy_component (entt::registry &r, entt::entity e) |
Additional Inherited Members | |
Public Types inherited from unravel::component_crtp< character_controller_component, owned_component > | |
| using | base |
Public Attributes inherited from unravel::basic_component | |
| bool | eto {} |
| Disable empty type optimizations. | |
Static Public Attributes inherited from unravel::component_crtp< character_controller_component, owned_component > | |
| static constexpr bool | in_place_delete |
| Indicates if the component can be deleted in place. | |
Component for character controller physics with sweep-based movement.
Uses a capsule shape internally. Movement is performed via move(displacement) rather than forces/impulses. Mutually exclusive with physics_component.
Definition at line 36 of file character_controller_component.h.
| void unravel::character_controller_component::apply_impulse | ( | const math::vec3 & | impulse | ) |
Definition at line 173 of file character_controller_component.cpp.
|
noexcept |
Definition at line 269 of file character_controller_component.cpp.
|
noexcept |
Definition at line 225 of file character_controller_component.cpp.
|
noexcept |
Definition at line 60 of file character_controller_component.cpp.
| auto unravel::character_controller_component::get_collision_exclude_mask | ( | ) | const -> layer_mask |
Definition at line 148 of file character_controller_component.cpp.
| auto unravel::character_controller_component::get_collision_include_mask | ( | ) | const -> layer_mask |
Definition at line 136 of file character_controller_component.cpp.
| auto unravel::character_controller_component::get_collision_mask | ( | ) | const -> layer_mask |
Definition at line 153 of file character_controller_component.cpp.
|
noexcept |
Definition at line 124 of file character_controller_component.cpp.
|
noexcept |
Definition at line 45 of file character_controller_component.cpp.
|
noexcept |
Definition at line 220 of file character_controller_component.cpp.
|
noexcept |
Definition at line 204 of file character_controller_component.cpp.
|
noexcept |
Definition at line 30 of file character_controller_component.cpp.
|
noexcept |
Definition at line 108 of file character_controller_component.cpp.
|
noexcept |
Definition at line 92 of file character_controller_component.cpp.
|
noexcept |
Definition at line 76 of file character_controller_component.cpp.
|
noexcept |
Definition at line 194 of file character_controller_component.cpp.
|
noexcept |
Definition at line 235 of file character_controller_component.cpp.
|
noexcept |
Definition at line 250 of file character_controller_component.cpp.
|
noexcept |
Definition at line 230 of file character_controller_component.cpp.
|
noexcept |
Definition at line 264 of file character_controller_component.cpp.
| void unravel::character_controller_component::jump | ( | const math::vec3 & | velocity | ) |
Trigger a directional jump. The velocity's magnitude is the jump speed and its direction is the jump axis.
| velocity | World-space jump velocity; must be non-zero. |
Definition at line 168 of file character_controller_component.cpp.
| void unravel::character_controller_component::jump | ( | float | speed | ) |
Trigger a jump straight up with the given speed (m/s).
| speed | Initial upward speed; must be > 0. |
Definition at line 163 of file character_controller_component.cpp.
| void unravel::character_controller_component::move | ( | const math::vec3 & | displacement | ) |
Definition at line 158 of file character_controller_component.cpp.
|
static |
Called when the component is created.
| r | The registry containing the component. |
| e | The entity associated with the component. |
Definition at line 7 of file character_controller_component.cpp.
|
static |
Called when the component is destroyed.
| r | The registry containing the component. |
| e | The entity associated with the component. |
Definition at line 16 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_center | ( | const math::vec3 & | center | ) |
Definition at line 50 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_collision_exclude_mask | ( | layer_mask | mask | ) |
Definition at line 141 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_collision_include_mask | ( | layer_mask | mask | ) |
Definition at line 129 of file character_controller_component.cpp.
|
noexcept |
Definition at line 255 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_gravity_scale | ( | float | scale | ) |
Definition at line 113 of file character_controller_component.cpp.
|
noexcept |
Definition at line 240 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_height | ( | float | height | ) |
Definition at line 35 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_linear_damping | ( | float | damping | ) |
Definition at line 209 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_linear_velocity | ( | const math::vec3 & | velocity | ) |
Definition at line 199 of file character_controller_component.cpp.
|
noexcept |
Definition at line 274 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_radius | ( | float | radius | ) |
Definition at line 20 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_skin_width | ( | float | skin_width | ) |
Definition at line 97 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_slope_limit | ( | float | slope_limit_degrees | ) |
Definition at line 81 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_step_height | ( | float | step_height | ) |
Definition at line 65 of file character_controller_component.cpp.
| void unravel::character_controller_component::set_terminal_velocity | ( | float | speed | ) |
Definition at line 183 of file character_controller_component.cpp.
|
noexcept |
Definition at line 245 of file character_controller_component.cpp.
| void unravel::character_controller_component::warp | ( | const math::vec3 & | position | ) |
Definition at line 178 of file character_controller_component.cpp.