mirror of
https://github.com/bevyengine/bevy
synced 2024-11-10 07:04:33 +00:00
Document None conditions on compute_aabb (#11051)
The error conditions were not documented, this requires the user to inspect the source code to know when to expect a `None`. Error conditions should always be documented, so we document them. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com>
This commit is contained in:
parent
049de6fcbe
commit
fcb49a5d80
1 changed files with 3 additions and 0 deletions
|
@ -566,6 +566,9 @@ impl Mesh {
|
|||
}
|
||||
|
||||
/// Compute the Axis-Aligned Bounding Box of the mesh vertices in model space
|
||||
///
|
||||
/// Returns `None` if `self` doesn't have [`Mesh::ATTRIBUTE_POSITION`] of
|
||||
/// type [`VertexAttributeValues::Float32x3`], or if `self` doesn't have any vertices.
|
||||
pub fn compute_aabb(&self) -> Option<Aabb> {
|
||||
let Some(VertexAttributeValues::Float32x3(values)) =
|
||||
self.attribute(Mesh::ATTRIBUTE_POSITION)
|
||||
|
|
Loading…
Reference in a new issue