pub struct CuboidVisual3d { /* private fields */ }Expand description
One opaque, independently transformed solid cuboid in a managed World.
Size is the full extent along local axes, before rotation. There is no physics, lighting, interpolation, mesh import, or screen-layer sorting. Hardware depth resolves overlap; stable managed identity orders CPU records. FrameUpdate may change this presentation component. Hidden cuboids and disabled entities consume no extracted 3D object or triangle budget.
Implementations§
Source§impl CuboidVisual3d
impl CuboidVisual3d
Sourcepub fn new(
center: Vec3,
size: Vec3,
color: Color,
) -> Result<Self, CuboidVisualError>
pub fn new( center: Vec3, size: Vec3, color: Color, ) -> Result<Self, CuboidVisualError>
Creates an axis-aligned cuboid with finite, representable solid geometry.
Every size component must be positive; color must be normalized and fully opaque. Invalid values allocate no renderer resources.
Sourcepub const fn transform(self) -> Transform3d
pub const fn transform(self) -> Transform3d
Returns the unit cube’s world transform.
Sourcepub const fn wireframe(self) -> Option<WireframeStyle3d>
pub const fn wireframe(self) -> Option<WireframeStyle3d>
Returns the optional retained outer-edge style.
Sourcepub const fn visible(self) -> bool
pub const fn visible(self) -> bool
Reports whether this cuboid participates in enabled 3D extraction.
Sourcepub fn set_transform(
&mut self,
transform: Transform3d,
) -> Result<(), CuboidVisualError>
pub fn set_transform( &mut self, transform: Transform3d, ) -> Result<(), CuboidVisualError>
Replaces translation, rotation, and positive scale atomically.
Overflow and floating-point collapse of any filled triangle leave the previous transform unchanged. Frustum portability is checked by Engine at submission, not by this viewport-independent setter.
Sourcepub fn set_color(&mut self, color: Color) -> Result<(), CuboidVisualError>
pub fn set_color(&mut self, color: Color) -> Result<(), CuboidVisualError>
Replaces the normalized opaque surface color, or changes nothing.
Sourcepub fn set_wireframe(&mut self, wireframe: Option<WireframeStyle3d>)
pub fn set_wireframe(&mut self, wireframe: Option<WireframeStyle3d>)
Selects an already validated wireframe style for the twelve outer edges.
Wireframe adds bounded edge draws, not additional surface triangles.
Sourcepub fn set_visible(&mut self, visible: bool)
pub fn set_visible(&mut self, visible: bool)
Changes extraction visibility without changing geometry or style.
Trait Implementations§
Source§impl Clone for CuboidVisual3d
impl Clone for CuboidVisual3d
Source§impl Component for CuboidVisual3d
impl Component for CuboidVisual3d
Source§const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
const STORAGE_TYPE: StorageType = bevy_ecs::component::StorageType::Table
Source§type Mutability = Mutable
type Mutability = Mutable
Component<Mutability = Mutable>,
while immutable components will instead have Component<Mutability = Immutable>. Read moreSource§fn register_required_components(
_requiree: ComponentId,
required_components: &mut RequiredComponentsRegistrator<'_, '_>,
)
fn register_required_components( _requiree: ComponentId, required_components: &mut RequiredComponentsRegistrator<'_, '_>, )
Source§fn clone_behavior() -> ComponentCloneBehavior
fn clone_behavior() -> ComponentCloneBehavior
Source§fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
fn relationship_accessor() -> Option<ComponentRelationshipAccessor<Self>>
ComponentRelationshipAccessor required for working with relationships in dynamic contexts. Read moreSource§fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_add() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_insert() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_discard() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_remove() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
fn on_despawn() -> Option<for<'w> fn(DeferredWorld<'w>, HookContext)>
Source§fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
fn map_entities<E>(_this: &mut Self, _mapper: &mut E)where
E: EntityMapper,
EntityMapper. This is used to remap entities in contexts like scenes and entity cloning.
When deriving Component, this is populated by annotating fields containing entities with #[entities] Read moreimpl Copy for CuboidVisual3d
Source§impl Debug for CuboidVisual3d
impl Debug for CuboidVisual3d
Source§impl PartialEq for CuboidVisual3d
impl PartialEq for CuboidVisual3d
impl StructuralPartialEq for CuboidVisual3d
Auto Trait Implementations§
impl Freeze for CuboidVisual3d
impl RefUnwindSafe for CuboidVisual3d
impl Send for CuboidVisual3d
impl Sync for CuboidVisual3d
impl Unpin for CuboidVisual3d
impl UnsafeUnpin for CuboidVisual3d
impl UnwindSafe for CuboidVisual3d
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<C> Bundle for Cwhere
C: Component,
impl<C> Bundle for Cwhere
C: Component,
fn component_ids( components: &mut ComponentsRegistrator<'_>, ) -> impl Iterator<Item = ComponentId> + use<C>
Source§fn get_component_ids(
components: &Components,
) -> impl Iterator<Item = Option<ComponentId>>
fn get_component_ids( components: &Components, ) -> impl Iterator<Item = Option<ComponentId>>
Source§impl<C> BundleFromComponents for Cwhere
C: Component,
impl<C> BundleFromComponents for Cwhere
C: Component,
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn 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.Source§fn 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.