Struct ambient_api::core::physics::concepts::CharacterController
source · pub struct CharacterController {
pub character_controller_height: f32,
pub character_controller_radius: f32,
pub physics_controlled: (),
}
Expand description
Character Controller: A capsule character controller. The capsule is defined as a position, a vertical height, and a radius. The height is the distance between the two sphere centers at the end of the capsule.
Note: The character controller is not affected by gravity; you will have to manually simulate gravity by moving the character down in accordance with a vertical velocity you maintain. See the character_movement
package for an example.
Required:
character_controller_height
: The height of the physics character controller attached to this entity. If an entity has both this and acharacter_controller_radius
, it will be given a physical character collider.character_controller_radius
: The radius of the physics character controller attached to this entity. If an entity has both this and acharacter_controller_height
, it will be given a physical character collider.physics_controlled
: If attached, this entity will be controlled by physics. Note that this requires the entity to have a collider.
Fields§
§character_controller_height: f32
Component: ambient_core::physics::character_controller_height
Suggested value: 2f32
Component description: The height of the physics character controller attached to this entity.
If an entity has both this and a character_controller_radius
, it will be given a physical character collider.
character_controller_radius: f32
Component: ambient_core::physics::character_controller_radius
Suggested value: 0.5f32
Component description: The radius of the physics character controller attached to this entity.
If an entity has both this and a character_controller_height
, it will be given a physical character collider.
physics_controlled: ()
Component: ambient_core::physics::physics_controlled
Suggested value: ()
Component description: If attached, this entity will be controlled by physics. Note that this requires the entity to have a collider.
Trait Implementations§
source§impl Clone for CharacterController
impl Clone for CharacterController
source§fn clone(&self) -> CharacterController
fn clone(&self) -> CharacterController
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Concept for CharacterController
impl Concept for CharacterController
source§fn get_spawned(id: EntityId) -> Option<CharacterController>
fn get_spawned(id: EntityId) -> Option<CharacterController>
id
exists and has the components defined by this concept, returns this concept with all of the values of the components in the entity. Read moresource§fn get_unspawned(entity: &Entity) -> Option<CharacterController>
fn get_unspawned(entity: &Entity) -> Option<CharacterController>
entity
has the components defined by this concept, returns this concept with all of the values of the components in the entity. Read moresource§fn contained_by_spawned(id: EntityId) -> bool
fn contained_by_spawned(id: EntityId) -> bool
id
exists and contains the components defined by this concept. Read moresource§impl ConceptComponents for CharacterController
impl ConceptComponents for CharacterController
§type Required = (Component<f32>, Component<f32>, Component<()>)
type Required = (Component<f32>, Component<f32>, Component<()>)
source§fn required() -> <CharacterController as ConceptComponents>::Required
fn required() -> <CharacterController as ConceptComponents>::Required
source§fn optional() -> <CharacterController as ConceptComponents>::Optional
fn optional() -> <CharacterController as ConceptComponents>::Optional
source§fn from_required_data(
required: <<CharacterController as ConceptComponents>::Required as ComponentsTuple>::Data
) -> CharacterController
fn from_required_data( required: <<CharacterController as ConceptComponents>::Required as ComponentsTuple>::Data ) -> CharacterController
source§fn as_query() -> ConceptQuery<Self>where
Self: Sized,
fn as_query() -> ConceptQuery<Self>where
Self: Sized,
ConceptQuery
that can be passed into queries. Read moresource§impl ConceptSuggested for CharacterController
impl ConceptSuggested for CharacterController
source§fn suggested() -> CharacterController
fn suggested() -> CharacterController
character_controller_height: 2f32,
character_controller_radius: 0.5f32,
physics_controlled: (),
source§impl Debug for CharacterController
impl Debug for CharacterController
source§impl<'de> Deserialize<'de> for CharacterController
impl<'de> Deserialize<'de> for CharacterController
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<CharacterController, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<CharacterController, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for CharacterController
impl PartialEq for CharacterController
source§fn eq(&self, other: &CharacterController) -> bool
fn eq(&self, other: &CharacterController) -> bool
self
and other
values to be equal, and is used
by ==
.