Struct CharacterState
#[repr(C)]pub struct CharacterState {
pub position: [f32; 3],
pub velocity: [f32; 3],
pub yaw: f32,
pub pitch: f32,
pub is_grounded: bool,
pub is_crouching: bool,
pub ground_normal: [f32; 3],
pub platform_velocity: [f32; 3],
pub stride_distance: f32,
pub submersion: SubmersionState,
pub water_depth: f32,
pub wetness: f32,
}Expand description
Dynamic runtime state of the character.
Fields§
§position: [f32; 3]3D position [x, y, z] in world meters (at the base/feet of the capsule).
velocity: [f32; 3]3D velocity [vx, vy, vz] in m/s.
yaw: f32Facing yaw in radians.
pitch: f32Pitch angle in radians (for head/look).
is_grounded: boolTrue if the character’s feet are currently contacting traversable ground.
is_crouching: boolTrue if the character is currently crouching.
ground_normal: [f32; 3]Surface normal vector [nx, ny, nz] of the contacted ground.
platform_velocity: [f32; 3]Moving platform velocity [vx, vy, vz] imparted to the character.
stride_distance: f32Accumulated walking distance in meters (drives footstep sounds & head bob).
submersion: SubmersionStateFluid submersion locomotion state.
water_depth: f32Water depth at character feet in meters.
wetness: f32Dynamic surface wetness ratio in [0.0, 1.0].
Trait Implementations§
§impl Clone for CharacterState
impl Clone for CharacterState
§fn clone(&self) -> CharacterState
fn clone(&self) -> CharacterState
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for CharacterState
§impl Debug for CharacterState
impl Debug for CharacterState
§impl Default for CharacterState
impl Default for CharacterState
§fn default() -> CharacterState
fn default() -> CharacterState
Returns the “default value” for a type. Read more
§impl PartialEq for CharacterState
impl PartialEq for CharacterState
impl StructuralPartialEq for CharacterState
Auto Trait Implementations§
impl Freeze for CharacterState
impl RefUnwindSafe for CharacterState
impl Send for CharacterState
impl Sync for CharacterState
impl Unpin for CharacterState
impl UnsafeUnpin for CharacterState
impl UnwindSafe for CharacterState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more