pub struct Bounds { /* private fields */ }
Expand description
Bounds component.
Use to set custom bounds or read bounds defined by a mesh.
If an entity has a render component and it doesn’t exist it will be added and set to match the mesh, but will be available a frame later.
Implementations
sourceimpl Bounds
impl Bounds
sourcepub fn bounding_box(&self) -> BoundingBox
pub fn bounding_box(&self) -> BoundingBox
Get the local space bounding box.
Convenience for calling Self::bounding_box_min
and Self::bounding_box_max
.
sourcepub fn set_bounding_box(&self, bbox: BoundingBox)
pub fn set_bounding_box(&self, bbox: BoundingBox)
Set the local space bounding box.
Convenience for calling Self::bounding_box_min
and Self::bounding_box_max
.
sourceimpl Bounds
impl Bounds
sourcepub fn bounding_box_min(&self) -> ValueAccessorReadWriteAnimate<Vec3>
pub fn bounding_box_min(&self) -> ValueAccessorReadWriteAnimate<Vec3>
Returns a ValueAccessor
for the bounding box min of the entity.
Used to set/get/animate the min.
For physics this will be used when the body is setup, for spatial queries it will be used as is.
sourcepub fn bounding_box_max(&self) -> ValueAccessorReadWriteAnimate<Vec3>
pub fn bounding_box_max(&self) -> ValueAccessorReadWriteAnimate<Vec3>
Returns a ValueAccessor
for the bounding box max of the entity.
Used to set/get/animate the max.
For physics this will be used when the body is setup, for spatial queries it will be used as is.
sourcepub fn bounding_sphere_radius(&self) -> ValueAccessorReadWriteAnimate<f32>
pub fn bounding_sphere_radius(&self) -> ValueAccessorReadWriteAnimate<f32>
Returns a ValueAccessor
for the bounding sphere radius of the entity.
Used to set/get/animate the radius.
For physics this will be used when the body is setup, for spatial queries it will be used as is.
sourcepub fn match_render_shape(&self) -> ValueAccessorReadWrite<bool>
pub fn match_render_shape(&self) -> ValueAccessorReadWrite<bool>
Returns a ValueAccessor
for the match render shape toggle of the entity.
Used to set/get whether these bounds will match the render shape.
Set this to false if you want to set a custom bounding shape, box or sphere when the entity has a render component with a shape set.
sourcepub fn shape(&self) -> ValueAccessorDataReadWrite<Shape>
pub fn shape(&self) -> ValueAccessorDataReadWrite<Shape>
Returns a ValueAccessor
for the bounding shape of the entity.
Used to set/get the bounding shape.
Use this to set a custom collider/physics/spatial query shape with MatchRenderShape set to false.
sourcepub fn create_sphere_bounds(&self, radius: f32)
pub fn create_sphere_bounds(&self, radius: f32)
Convenience method to set up both the sphere and the bounding box to contain a certain radius.
Trait Implementations
sourceimpl ComponentTrait for Bounds
impl ComponentTrait for Bounds
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 Bounds
impl Send for Bounds
impl Sync for Bounds
impl Unpin for Bounds
impl UnwindSafe for Bounds
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