pub struct Character {
pub position: Vec3,
pub velocity: Vec3,
pub grounded: bool,
pub ground_normal: Vec3,
pub jump: JumpState,
pub support: Option<Support>,
}Fields§
§position: Vec3§velocity: Vec3Velocity relative to a supporting platform; airborne velocity is in world space.
grounded: bool§ground_normal: Vec3§jump: JumpState§support: Option<Support>Implementations§
Source§impl Character
impl Character
pub fn new(feet: Vec3) -> Character
Sourcepub fn step<T>(
&mut self,
world: &T,
shape: CharacterShape,
settings: CharacterSettings,
input: CharacterInput,
dt: f32,
) -> Result<CharacterStep, CharacterError>
pub fn step<T>( &mut self, world: &T, shape: CharacterShape, settings: CharacterSettings, input: CharacterInput, dt: f32, ) -> Result<CharacterStep, CharacterError>
Advance at a fixed dt in (0, 0.1]. Terrain must already have this tick’s pose. All state updates commit together; invalid input or exhausted queries leave self unchanged.
Trait Implementations§
impl Copy for Character
impl StructuralPartialEq for Character
Auto Trait Implementations§
impl Freeze for Character
impl RefUnwindSafe for Character
impl Send for Character
impl Sync for Character
impl Unpin for Character
impl UnwindSafe for Character
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