logo
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

Get the local space bounding box.

Convenience for calling Self::bounding_box_min and Self::bounding_box_max.

Set the local space bounding box.

Convenience for calling Self::bounding_box_min and Self::bounding_box_max.

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.

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.

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.

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.

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.

Convenience method to set up both the sphere and the bounding box to contain a certain radius.

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.