pub struct TnuaBuiltinWalk {
pub desired_motion: Vector3,
pub desired_forward: Option<Dir3>,
}Fields§
§desired_motion: Vector3The direction (in the world space) and speed to accelerate to.
Tnua assumes that this vector is orthogonal to the up dierction.
desired_forward: Option<Dir3>If non-zero, Tnua will rotate the character so that its negative Z will face in that direction.
Tnua assumes that this vector is orthogonal to the up direction.
Trait Implementations§
Source§impl Default for TnuaBuiltinWalk
impl Default for TnuaBuiltinWalk
Source§fn default() -> TnuaBuiltinWalk
fn default() -> TnuaBuiltinWalk
Returns the “default value” for a type. Read more
Source§impl TnuaBasis for TnuaBuiltinWalk
impl TnuaBasis for TnuaBuiltinWalk
type Config = TnuaBuiltinWalkConfig
type Memory = TnuaBuiltinWalkMemory
type Sensors<'a> = TnuaBuiltinWalkSensors<'a>
Source§fn apply(
&self,
config: &Self::Config,
memory: &mut Self::Memory,
sensors: &Self::Sensors<'_>,
ctx: TnuaBasisContext<'_>,
motor: &mut TnuaMotor,
)
fn apply( &self, config: &Self::Config, memory: &mut Self::Memory, sensors: &Self::Sensors<'_>, ctx: TnuaBasisContext<'_>, motor: &mut TnuaMotor, )
This is where the basis affects the character’s motion. Read more
Source§fn get_or_create_sensors<'a: 'b, 'b>(
up_direction: Dir3,
config: &'a Self::Config,
memory: &Self::Memory,
entities: &'a mut <Self::Sensors<'static> as TnuaSensors<'static>>::Entities,
proximity_sensors_query: &'b Query<'_, '_, (&TnuaProximitySensor, Has<TnuaGhostSensor>)>,
controller_entity: Entity,
commands: &mut Commands<'_, '_>,
has_ghost_overwrites: bool,
) -> Option<Self::Sensors<'b>>
fn get_or_create_sensors<'a: 'b, 'b>( up_direction: Dir3, config: &'a Self::Config, memory: &Self::Memory, entities: &'a mut <Self::Sensors<'static> as TnuaSensors<'static>>::Entities, proximity_sensors_query: &'b Query<'_, '_, (&TnuaProximitySensor, Has<TnuaGhostSensor>)>, controller_entity: Entity, commands: &mut Commands<'_, '_>, has_ghost_overwrites: bool, ) -> Option<Self::Sensors<'b>>
This is where the basis initiates its sensors. Read more
Source§fn ghost_sensor_overwrites<'a>(
ghost_overwrites: &'a mut <Self::Sensors<'static> as TnuaSensors<'static>>::GhostOverwrites,
entities: &<Self::Sensors<'static> as TnuaSensors<'static>>::Entities,
) -> impl Iterator<Item = (&'a mut TnuaGhostOverwrite, Entity)>
fn ghost_sensor_overwrites<'a>( ghost_overwrites: &'a mut <Self::Sensors<'static> as TnuaSensors<'static>>::GhostOverwrites, entities: &<Self::Sensors<'static> as TnuaSensors<'static>>::Entities, ) -> impl Iterator<Item = (&'a mut TnuaGhostOverwrite, Entity)>
Iterate over each ghost overwrite and the sensor entity of the relevant sensor. Read more
Source§impl TnuaBasisWithDisplacement for TnuaBuiltinWalk
impl TnuaBasisWithDisplacement for TnuaBuiltinWalk
Source§fn displacement(access: &TnuaBasisAccess<'_, Self>) -> Option<Vector3>
fn displacement(access: &TnuaBasisAccess<'_, Self>) -> Option<Vector3>
The displacement of the character from where the basis wants it to be. Read more
Source§impl TnuaBasisWithFloating for TnuaBuiltinWalk
impl TnuaBasisWithFloating for TnuaBuiltinWalk
Source§fn float_height(access: &TnuaBasisAccess<'_, Self>) -> Float
fn float_height(access: &TnuaBasisAccess<'_, Self>) -> Float
The height the basis is configured to float at, measured from the ground to the center of
the character collider.
Source§impl TnuaBasisWithFrameOfReferenceSurface for TnuaBuiltinWalk
impl TnuaBasisWithFrameOfReferenceSurface for TnuaBuiltinWalk
Source§fn effective_velocity(access: &TnuaBasisAccess<'_, Self>) -> Vector3
fn effective_velocity(access: &TnuaBasisAccess<'_, Self>) -> Vector3
The velocity of the character, relative the what the basis considers its frame of
reference. Read more
Source§fn vertical_velocity(access: &TnuaBasisAccess<'_, Self>) -> Float
fn vertical_velocity(access: &TnuaBasisAccess<'_, Self>) -> Float
The vertical velocity the character requires to stay the same height if it wants to move in
effective_velocity.Source§impl TnuaBasisWithGround for TnuaBuiltinWalk
impl TnuaBasisWithGround for TnuaBuiltinWalk
Source§fn is_airborne(access: &TnuaBasisAccess<'_, Self>) -> bool
fn is_airborne(access: &TnuaBasisAccess<'_, Self>) -> bool
Can be queried by an action to determine if the character should be considered “in the air”. Read more
Source§fn violate_coyote_time(memory: &mut Self::Memory)
fn violate_coyote_time(memory: &mut Self::Memory)
If the basis is at coyote time - finish the coyote time. Read more
Source§fn ground_sensor<'a>(sensors: &Self::Sensors<'a>) -> &'a TnuaProximitySensor
fn ground_sensor<'a>(sensors: &Self::Sensors<'a>) -> &'a TnuaProximitySensor
The sensor used to detect the ground.
Source§impl TnuaBasisWithHeadroom for TnuaBuiltinWalk
impl TnuaBasisWithHeadroom for TnuaBuiltinWalk
Source§fn headroom_intrusion<'a>(
access: &TnuaBasisAccess<'_, Self>,
sensors: &Self::Sensors<'a>,
) -> Option<Range<Float>>
fn headroom_intrusion<'a>( access: &TnuaBasisAccess<'_, Self>, sensors: &Self::Sensors<'a>, ) -> Option<Range<Float>>
The headroom sensor has detected a ceiling above the character’s head. Read more
Source§fn set_extra_headroom(memory: &mut Self::Memory, extra_headroom: Float)
fn set_extra_headroom(memory: &mut Self::Memory, extra_headroom: Float)
Increase the range of the headroom sensor.
Source§impl TnuaBasisWithSpring for TnuaBuiltinWalk
impl TnuaBasisWithSpring for TnuaBuiltinWalk
Source§fn spring_force(
access: &TnuaBasisAccess<'_, Self>,
ctx: &TnuaBasisContext<'_>,
spring_offset: Float,
) -> TnuaVelChange
fn spring_force( access: &TnuaBasisAccess<'_, Self>, ctx: &TnuaBasisContext<'_>, spring_offset: Float, ) -> TnuaVelChange
Calculate the vertical spring force that this basis would need to apply assuming its
vertical distance from the vertical distance it needs to be at equals the
spring_offset
argument.Auto Trait Implementations§
impl Freeze for TnuaBuiltinWalk
impl RefUnwindSafe for TnuaBuiltinWalk
impl Send for TnuaBuiltinWalk
impl Sync for TnuaBuiltinWalk
impl Unpin for TnuaBuiltinWalk
impl UnwindSafe for TnuaBuiltinWalk
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
Return the
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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>
Converts
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>
Converts
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 moreSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
Source§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.