pub struct TnuaBuiltinWalkConfig {Show 14 fields
pub speed: Float,
pub float_height: Float,
pub headroom: Option<TnuaBuiltinWalkHeadroom>,
pub cling_distance: Float,
pub spring_strength: Float,
pub spring_dampening: Float,
pub acceleration: Float,
pub air_acceleration: Float,
pub coyote_time: Float,
pub free_fall_extra_gravity: Float,
pub tilt_offset_angvel: Float,
pub tilt_offset_angacl: Float,
pub turning_angvel: Float,
pub max_slope: Float,
}Fields§
§speed: Float§float_height: FloatThe height at which the character will float above ground at rest.
Note that this is the height of the character’s center of mass - not the distance from its collision mesh.
To make a character crouch, instead of altering this field, prefer to use the
TnuaBuiltinCrouch action.
headroom: Option<TnuaBuiltinWalkHeadroom>Add an upward-facing proximity sensor that can check if the character has room above it.
This is not (currently) used by TnuaBuiltinWalk itself, but
TnuaBuiltinCrouch uses it to determine
cling_distance: FloatExtra distance above the float_height where the spring is still in effect.
When the character is at at most this distance above the
float_height, the spring force will kick in and move it to the
float height - even if that means pushing it down. If the character is above that distance
above the float_height, Tnua will consider it to be in the air.
spring_strength: FloatThe force that pushes the character to the float height.
The actual force applied is in direct linear relationship to the displacement from the
float_height.
spring_dampening: FloatA force that slows down the characters vertical spring motion.
The actual dampening is in direct linear relationship to the vertical velocity it tries to dampen.
Note that as this approaches 2.0, the character starts to shake violently and eventually get launched upward at great speed.
acceleration: FloatThe acceleration for horizontal movement.
Note that this is the acceleration for starting the horizontal motion and for reaching the
top speed. When braking or changing direction the acceleration is greater, up to 2 times
acceleration when doing a 180 turn.
air_acceleration: FloatThe acceleration for horizontal movement while in the air.
Set to 0.0 to completely disable air movement.
coyote_time: FloatThe time, in seconds, the character can still jump after losing their footing.
free_fall_extra_gravity: FloatExtra gravity for free fall (fall that’s not initiated by a jump or some other action that provides its own fall gravity)
NOTE: This force will be added to the normal gravity.
NOTE: If the parameter set to this option is too low, the character may be able to run up a slope and “jump” potentially even higher than a regular jump, even without pressing the jump button.
tilt_offset_angvel: FloatThe maximum angular velocity used for keeping the character standing upright.
NOTE: The character’s rotation can also be locked to prevent it from being tilted, in which case this paramter is redundant and can be set to 0.0.
tilt_offset_angacl: FloatThe maximum angular acceleration used for reaching tilt_offset_angvel.
NOTE: The character’s rotation can also be locked to prevent it from being tilted, in which case this paramter is redundant and can be set to 0.0.
turning_angvel: FloatThe maximum angular velocity used for turning the character when the direction changes.
max_slope: FloatThe maximum slope, in radians, that the character can stand on without slipping.
Trait Implementations§
Source§impl Clone for TnuaBuiltinWalkConfig
impl Clone for TnuaBuiltinWalkConfig
Source§fn clone(&self) -> TnuaBuiltinWalkConfig
fn clone(&self) -> TnuaBuiltinWalkConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Default for TnuaBuiltinWalkConfig
impl Default for TnuaBuiltinWalkConfig
Source§impl<'de> Deserialize<'de> for TnuaBuiltinWalkConfig
impl<'de> Deserialize<'de> for TnuaBuiltinWalkConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TnuaBuiltinWalkConfig
impl RefUnwindSafe for TnuaBuiltinWalkConfig
impl Send for TnuaBuiltinWalkConfig
impl Sync for TnuaBuiltinWalkConfig
impl Unpin for TnuaBuiltinWalkConfig
impl UnwindSafe for TnuaBuiltinWalkConfig
Blanket Implementations§
Source§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
Source§fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<GpuImage>) -> U
T ShaderType for self. When used in AsBindGroup
derives, it is safe to assume that all images in self exist.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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
Source§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more