Struct ark_api::world::PhysicsCharacter
source · [−]pub struct PhysicsCharacter { /* private fields */ }
Expand description
Physics character component
Use to get predictable collisions against the physics world for an entity. Suitable for things like FPS shooter characters and other similar things that are directly controlled by the player and would be impractical to get to behave correctly using real physics.
Puts a capsule around the entity, defined by the height and radius properties, to do collisions.
Uses the Velocity
component to update the position of the entity and leaves adding gravity to that
to the user.
Implementations
sourceimpl PhysicsCharacter
impl PhysicsCharacter
sourcepub fn radius(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn radius(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the character radius (horizontal plane).
sourcepub fn height(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn height(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the character vertical height.
sourcepub fn up_direction(&self) -> ValueAccessorReadWriteAnimate<Vec3>
pub fn up_direction(&self) -> ValueAccessorReadWriteAnimate<Vec3>
Returns a ValueAccessor
for the character up direction.
sourcepub fn collision_flags(&self) -> ValueAccessorRead<CharacterCollisionFlags>
pub fn collision_flags(&self) -> ValueAccessorRead<CharacterCollisionFlags>
Returns a ValueAccessor
for the character collision flags.
Use it to see what collisions the last frame resulted in, for instance to reset velocity if ground was hit. Can only be read.
sourcepub fn velocity(&self) -> ValueAccessorReadWriteAnimate<Vec3>
pub fn velocity(&self) -> ValueAccessorReadWriteAnimate<Vec3>
Returns a ValueAccessor
for the world linear velocity of the physics character.
Used to set/get/animate the velocity.
Trait Implementations
sourceimpl ComponentTrait for PhysicsCharacter
impl ComponentTrait for PhysicsCharacter
sourcefn get_type() -> ComponentType
fn get_type() -> ComponentType
The type of the component, as a ComponentType
enum.
sourcefn from_entity(handle: Entity) -> Self
fn from_entity(handle: Entity) -> Self
Adopt an Entity
, wrap in a component struct.
Auto Trait Implementations
impl RefUnwindSafe for PhysicsCharacter
impl Send for PhysicsCharacter
impl Sync for PhysicsCharacter
impl Unpin for PhysicsCharacter
impl UnwindSafe for PhysicsCharacter
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more