Struct ambient_api_core::core::primitives::concepts::Capsule
source · pub struct Capsule {
pub capsule: (),
pub capsule_radius: f32,
pub capsule_half_height: f32,
pub capsule_rings: u32,
pub capsule_latitudes: u32,
pub capsule_longitudes: u32,
}
Expand description
Capsule: A primitive capsule. Defined as a cylinder capped by hemispheres.
Required:
capsule
: If attached to an entity alongside the othercapsule_*
components, the entity will be converted to a capsule primitive. To easily instantiate a defaultcapsule
, consider using theCapsule
concept.capsule_radius
: Set the radius of acapsule
entity, spanning XY-plane.capsule_half_height
: Set the half-height of thecapsule
entity, spanning Z-axis, excluding the caps.capsule_rings
: Set the number of sections between the caps.capsule_latitudes
: Set the number of latitudinal sections. Should be even.capsule_longitudes
: Set the number of longitudinal sections.
Fields§
§capsule: ()
Component: ambient_core::primitives::capsule
Suggested value: ()
Component description: If attached to an entity alongside the other capsule_*
components, the entity will be converted to a capsule primitive.
To easily instantiate a default capsule
, consider using the Capsule
concept.
capsule_radius: f32
Component: ambient_core::primitives::capsule_radius
Suggested value: 0.5f32
Component description: Set the radius of a capsule
entity, spanning XY-plane.
capsule_half_height: f32
Component: ambient_core::primitives::capsule_half_height
Suggested value: 0.5f32
Component description: Set the half-height of the capsule
entity, spanning Z-axis, excluding the caps.
capsule_rings: u32
Component: ambient_core::primitives::capsule_rings
Suggested value: 0u32
Component description: Set the number of sections between the caps.
capsule_latitudes: u32
Component: ambient_core::primitives::capsule_latitudes
Suggested value: 16u32
Component description: Set the number of latitudinal sections. Should be even.
capsule_longitudes: u32
Component: ambient_core::primitives::capsule_longitudes
Suggested value: 32u32
Component description: Set the number of longitudinal sections.
Trait Implementations§
source§impl Concept for Capsule
impl Concept for Capsule
source§fn get_spawned(id: EntityId) -> Option<Self>
fn get_spawned(id: EntityId) -> Option<Self>
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<Self>
fn get_unspawned(entity: &Entity) -> Option<Self>
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 Capsule
impl ConceptComponents for Capsule
§type Required = (Component<()>, Component<f32>, Component<f32>, Component<u32>, Component<u32>, Component<u32>)
type Required = (Component<()>, Component<f32>, Component<f32>, Component<u32>, Component<u32>, Component<u32>)
source§fn from_required_data(
required: <Self::Required as ComponentsTuple>::Data
) -> Self
fn from_required_data( required: <Self::Required as ComponentsTuple>::Data ) -> Self
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 more