pub struct KinematicCharacterController {Show 13 fields
pub translation: Option<Vect>,
pub custom_shape: Option<(Collider, Vect, Rot)>,
pub custom_mass: Option<Real>,
pub up: Vect,
pub offset: CharacterLength,
pub slide: bool,
pub autostep: Option<CharacterAutostep>,
pub max_slope_climb_angle: Real,
pub min_slope_slide_angle: Real,
pub apply_impulse_to_dynamic_bodies: bool,
pub snap_to_ground: Option<CharacterLength>,
pub filter_flags: QueryFilterFlags,
pub filter_groups: Option<InteractionGroups>,
}
Expand description
A character controller for kinematic bodies and free-standing colliders.
Fields
translation: Option<Vect>
The translations we desire the character to move by if it doesn’t meet any obstacle.
custom_shape: Option<(Collider, Vect, Rot)>
The shape, and its position, to be used instead of the shape of the collider attached to
the same entity is this KinematicCharacterController
.
custom_mass: Option<Real>
The mass to be used for impulse of dynamic bodies. This replaces the mass of the rigid-body
potentially associated to the collider attached to the same entity as this
KinematicCharacterController
.
This field isn’t used if Self::apply_impulse_to_dynamic_bodies
is set to false
.
up: Vect
The direction that goes “up”. Used to determine where the floor is, and the floor’s angle.
offset: CharacterLength
A small gap to preserve between the character and its surroundings.
This value should not be too large to avoid visual artifacts, but shouldn’t be too small (must not be zero) to improve numerical stability of the character controller.
slide: bool
Should the character try to slide against the floor if it hits it?
autostep: Option<CharacterAutostep>
Should the character automatically step over small obstacles?
max_slope_climb_angle: Real
The maximum angle (radians) between the floor’s normal and the up
vector that the
character is able to climb.
min_slope_slide_angle: Real
The minimum angle (radians) between the floor’s normal and the up
vector before the
character starts to slide down automatically.
apply_impulse_to_dynamic_bodies: bool
Should the character apply forces to dynamic bodies in its path?
snap_to_ground: Option<CharacterLength>
Should the character be automatically snapped to the ground if the distance between the ground and its feed are smaller than the specified threshold?
filter_flags: QueryFilterFlags
Flags for filtering-out some categories of entities from the environment seen by the character controller.
filter_groups: Option<InteractionGroups>
Groups for filtering-out some colliders from the environment seen by the character controller.
Trait Implementations
sourceimpl Clone for KinematicCharacterController
impl Clone for KinematicCharacterController
sourcefn clone(&self) -> KinematicCharacterController
fn clone(&self) -> KinematicCharacterController
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Component for KinematicCharacterControllerwhere
Self: Send + Sync + 'static,
impl Component for KinematicCharacterControllerwhere
Self: Send + Sync + 'static,
type Storage = TableStorage
sourceimpl Debug for KinematicCharacterController
impl Debug for KinematicCharacterController
Auto Trait Implementations
impl !RefUnwindSafe for KinematicCharacterController
impl Send for KinematicCharacterController
impl Sync for KinematicCharacterController
impl Unpin for KinematicCharacterController
impl !UnwindSafe for KinematicCharacterController
Blanket Implementations
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
impl<T, U> AsBindGroupShaderType<U> for Twhere
U: ShaderType,
&'a T: for<'a> Into<U>,
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
[ShaderType
] for self
. When used in [AsBindGroup
]
derives, it is safe to assume that all images in self
exist. Read moresourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids(
components: &mut Components,
storages: &mut Storages,
ids: &mut impl FnMut(ComponentId)
)
unsafe fn from_components<T, F>(ctx: &mut T, func: &mut F) -> Cwhere
F: for<'a> FnMut(&'a mut T) -> OwningPtr<'a>,
fn get_components(self, func: &mut impl FnMut(OwningPtr<'_>))
impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read morefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read morefn 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. Read morefn 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. Read moreimpl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given [World]sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read morefn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.