logo
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

Returns a ValueAccessor for the character radius (horizontal plane).

Returns a ValueAccessor for the character vertical height.

Returns a ValueAccessor for the character up direction.

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.

Returns a ValueAccessor for the world linear velocity of the physics character.

Used to set/get/animate the velocity.

Trait Implementations

The type of the component, as a ComponentType enum.

Adopt an Entity, wrap in a component struct.

Get the entity that the component belongs to.

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.